Sparse MoE Architecture and Training Strategies in Chinese Large Language Models
This article breaks down the sparse Mixture-of-Experts (MoE) architecture and training strategies behind recent Chinese flagship large language models. It explains why trillion-parameter models do not necessarily bring proportionally higher inference costs, then covers MoE structure, Multi-head Latent Attention (MLA) for KV cache compression, expert granularity versus hidden dimensions, token efficiency, optimizers and training stability, and deployment bottlenecks such as All-to-All communication. The goal is to help developers understand the tradeoffs between sparsity, expert granularity, attention compression, token efficiency, and optimizer state, and to make model selection decisions based on their own workloads and benchmarks.
1. Introduction: Why “More Parameters” Does Not Mean “More Compute Cost”
Over the past two years, the flagship versions of Chinese large language models have rapidly scaled into the trillion-parameter range, yet inference costs have not risen at the same pace. The reason is that the industry has almost universally shifted toward the sparse Mixture-of-Experts (MoE) architecture: the total parameter count determines the upper bound of the model’s knowledge capacity, while the number of parameters actually activated per token determines the real cost of a single forward pass. Understanding this decoupling is a prerequisite for reading the technical reports of each flagship model.
A common misreading is to treat different vendors’ flagship models as entirely different technical species. In fact, based on public technical disclosures, they look more like siblings with the same architectural parent: they share the same broad direction and differ in details such as expert granularity, number of attention heads, optimizer, and data mixture. This article abstracts away specific products and discusses only the paradigm itself.
2. The Basic Structure of Sparse MoE
The core of sparse MoE is to replace the feed-forward layer with several parallel “expert” subnetworks, and then use a gating network to select a few experts to participate in the computation for each token.
# Illustration: forward logic of an MoE layer (pseudocode)logits = router(x) # [batch, seq, num_experts]topk_idx, topk_w = topk_softmax(logits, k=8)y = 0for e in unique(topk_idx):mask = (topk_idx == e)y[mask] += topk_w[mask] * expert_e(x[mask])
There are three key metrics: total parameter count, activated parameter count, and sparsity (total parameters / activated parameters). The higher the sparsity, the more knowledge capacity each unit of compute can carry, but the higher the requirements on routing balance, communication bandwidth, and GPU memory capacity.
3. Attention Mechanisms: Trading Low-Rank Compression for Memory Bandwidth
The mainstream approach follows the idea of Multi-head Latent Attention (MLA): instead of caching the full Key/Value directly, it compresses them into a low-dimensional latent vector and projects them back up during inference. The benefit is concentrated on the inference side—in long-context scenarios, the KV cache often consumes more memory bandwidth than the weights, and after compression, the concurrency and context length that a single GPU can support increase significantly.
From an engineering perspective, note that low-rank compression introduces additional projection matrix computation, which is a trade of compute for bandwidth. Therefore, in short-input, high-concurrency scenarios, the benefit may be diluted, so it should be verified by actual testing rather than copying conclusions.
4. The Ratio Between the Number of Experts and the Hidden Dimension
A repeatedly validated rule of thumb is that, with a fixed total compute budget, allocating more parameters to “fine-grained experts” rather than to a “wider single expert” is usually more cost-effective. A typical practice is to make the hidden dimension of a single expert clearly smaller than the backbone hidden dimension (for example, a backbone of several thousand dimensions and experts on the order of two thousand dimensions), while increasing the number of experts from just over two hundred to several hundred and activating a fixed number of them (such as 8).
At the same time, more attention heads are not always better. Increasing the number of heads linearly amplifies the KV cache and attention computation; under a total activation budget constraint, moderately reducing the number of heads and giving the budget to expert capacity is a common tradeoff.
5. Token Efficiency: The Core Variable in a Data-Constrained Era
The available increment of high-quality human text is narrowing, and the growth of model capability increasingly depends on “how much effective gradient signal can be extracted from each token.” Feasible approaches include: strict data deduplication and quality grading, increasing the proportion of high-density corpora such as math and code, synthetic data and verifiable tasks, and multi-stage annealing-style data mixture adjustments. The evaluation metric should also shift from “how many tokens were trained on” to “how many tokens are needed to reach the same level of performance.”
6. Optimizers and Training Stability
Adaptive moment-based optimizers converge stably but incur large memory overhead; matrix-based low-rank optimizers (such as the Muon family) reduce optimizer state overhead by maintaining only low-rank momentum, which can improve throughput in large-scale training but is more sensitive to hyperparameters. The stability of trillion-scale training also relies on: the load-balancing loss brought by fine-grained experts, suppression of routing collapse, gradient clipping and numerical precision strategies (such as fine-grained quantization with high-precision accumulation), and structured fault tolerance and checkpoint resumption.
Training stability checklist- Whether the load deviation across experts keeps widening- Whether the gating entropy drops rapidly (an early sign of routing collapse)- Frequency of gradient norm spikes and the clipping threshold- The tradeoff between optimizer state memory share and throughput
7. Inference Cost and Deployment Essentials
On the deployment side, the core is not peak compute but memory and bandwidth. High-sparsity models need to split hundreds of experts across multiple GPUs, and All-to-All communication can easily become the bottleneck; in practice, people commonly combine expert parallelism with tensor/pipeline parallelism, overlap communication with computation, and use redundant expert replication to alleviate hotspots. If business concurrency fluctuates greatly, you can leverage container platforms for elastic scaling, message queues for peak shaving, object storage for hosting model weights, and logging services plus monitoring and alerting for full-link observability. Baidu AI Cloud offers corresponding product categories for these general capabilities that can be combined.
8. Selection Recommendations
- Long context, high-concurrency dialogue: prioritize KV cache compression capability and memory footprint.
- Complex reasoning and code: prioritize the mixture of high-information-density corpora and transparency of post-training methods.
- Private deployment: prioritize expert partitioning strategy, communication overhead, and operational observability.
- Cost-sensitive scenarios: estimate the compute budget using activated parameters rather than total parameters, and run small-scale benchmarks on your own business datasets.
9. Conclusion
The differences among vendors’ flagship models are reflected more in engineering tradeoffs than in paradigm divergence. What developers really need to master is the interaction among the sets of knobs: sparsity, expert granularity, attention compression, token efficiency, and optimizer state. Building evaluation on your own data and real stress tests is more valuable than chasing parameter leaderboards.
