Technical Analysis of Large-Scale Mixture of Experts (MoE) Models and Cloud Deployment Practices
This article examines the architecture and engineering practices of large-scale Mixture of Experts (MoE) models, using a recently open-sourced domestic MoE model as a technical reference. It covers how sparse activation decouples total parameters from per-token computation, general strategies for controlling training costs, optimizations for long-context inference, and practical recommendations for deploying these models on the cloud. Readers will gain a framework for evaluating parallelism strategies, managing memory and latency, and building observable, cost-efficient LLM applications.
1. Introduction: Why Focus on Mixture of Experts
In recent years, the parameter count of large language models (LLMs) has continued to climb. However, in dense architectures, compute consumption grows nearly linearly with parameter count, making training and inference costs difficult to control. The Mixture of Experts (MoE) architecture uses a “sparse activation” mechanism to decouple total parameter count from the actual computation performed per token. This has made it a widely watched technical approach in the industry.
This article uses a domestic MoE model that was released and open-sourced in late December 2024 as its technical background (to avoid pointing to a specific product, it is referred to below as “this class of MoE models”). By abstracting its technical characteristics, we discuss general methods for engineering implementation and cloud deployment.
2. Core Architecture Analysis: The Engineering Significance of Sparse Activation
This class of models has approximately 671 billion total parameters, with about 37 billion parameters activated per token, yielding an activation ratio of roughly 5.5%. The significance of this design lies in:
- Decoupling capacity from compute: The model’s “knowledge capacity” is determined by total parameters, while the computation for a single forward pass is determined by activated parameters.
- Controllable training throughput: Under the same hardware conditions, sparse models can support a larger parameter scale.
- Tiered inference costs: Memory usage and computation follow different growth curves and must be planned separately.
The routing logic can be abstracted schematically as:
# Pseudocode: illustrates the MoE routing concept only, not the interface of any specific productdef moe_forward(x, experts, router, top_k=2):weights = router(x) # Compute expert scoresidx = topk(weights, k=top_k) # Select Top-K expertsout = 0for i in idx:out += weights[i] * experts[i](x)return out
From an engineering perspective, close attention must be paid to load balancing loss, expert capacity factor, and communication overhead. Otherwise, issues such as “expert collapse” and idle compute are likely to occur.
3. General Approaches to Training Cost Control
Public information indicates that pre-training this class of models consumed approximately 14.8 trillion tokens using 2,048 accelerator cards, for a total of about 2,788 thousand GPU hours. Pre-training accounted for about 2,664 thousand of those hours, which translates to roughly 1,361 hours per card (about 56.7 days).
Four general lessons can be distilled from an engineering perspective:
- Combining parallelism strategies: Data parallelism, tensor parallelism, pipeline parallelism, and expert parallelism need to be configured in combination according to cluster topology.
- Communication optimization: All-to-All communication is the primary bottleneck in MoE training and requires topology-aware scheduling.
- Precision and stability: Low-precision training must be paired with loss scaling and numerical stability handling.
- Compute utilization: Optimization should center on MFU (Model FLOPs Utilization) as the core metric, rather than merely looking at card count.
It is important to emphasize that cost data is affected by hardware models, procurement methods, cluster utilization, and statistical scope, and should not be simply extrapolated into universal conclusions.
4. Long-Context and Inference Performance Optimization
In subsequent iterations of this class of models, the context length was gradually expanded, reaching the million-token scale in February 2026. The core challenges brought by long context are the quadratic complexity of attention computation and the memory pressure of the KV cache. Common industry optimization techniques include:
- Sparse attention and chunked attention;
- KV cache quantization and paged management;
- Prefix Cache reuse;
- Continuous Batching and speculative decoding.
When deploying on the cloud, inference services can be hosted on a container platform, with load balancers distributing requests. Log services and monitoring/alerting systems can be used to track metrics such as time to first token (TTFT), time per output token (TPOT), and throughput.
5. Recommendations for Cloud Deployment
When enterprises deploy this class of large models on the cloud, it is recommended to proceed along the following path:
- Scenario tiering: Distinguish among three types of workloads: high-concurrency online Q&A, offline batch processing, and private deployment.
- Resource planning: Memory capacity determines the supported parameter scale and concurrency, while compute determines the throughput ceiling.
- Elastic scaling: Use the elastic capabilities of container platforms to handle traffic peaks, combined with object storage to store model weights and datasets.
- Observability: Establish end-to-end tracing to locate queuing, memory overflow, and operator bottlenecks.
- Cost governance: Account for costs across two dimensions—per-token metering and resource utilization—to avoid resources sitting idle over the long term.
Baidu AI Cloud provides support across general product categories for model hosting, elastic compute, and observability. Enterprises can build a stable and controllable foundation for large model applications based on the methods above.
6. Conclusion
The value of the MoE architecture lies not in “larger parameters,” but in trading controllable activated compute for greater model capacity. Understanding these four areas—sparse routing, parallel training, long context, and inference scheduling—is key for developers to evaluate and implement large model capabilities.
