Understanding Sparse Mixture-of-Experts Architecture in Chinese Large Models
This article explains why parameter count is no longer the sole metric for evaluating foundation models and how sparse Mixture-of-Experts (MoE) architectures decouple total capacity from per-request computation. It covers the core mechanisms of gating, capacity factors, and load balancing, offers guidance on choosing between dense and sparse designs, and outlines a practical evaluation workflow from load testing to production. Readers will also learn common pitfalls around memory planning, routing imbalance, and tail latency.
1. Why Parameter Count Is No Longer the Only Metric
In the past, a foundation model was evaluated almost entirely by its parameter count. Once inference cost became the primary constraint, the industry shifted its focus to how many parameters are actually activated per forward pass. This is the core value of sparse architectures: decoupling total capacity from the compute required for a single request.
A rough quantitative relationship helps build intuition. Let $P{total}$ be the total number of model parameters and $P{act}$ the number activated per inference. Compute is roughly proportional to $P{act}$, while memory footprint is roughly proportional to $P{total}$. Sparse architectures aim for “large capacity, small activation,” trading memory for throughput.
The route described in the source material is roughly 236 billion total parameters with about 66 billion activated per inference, an activation ratio of about 28%. This ratio is on the “denser” end of sparse configurations. The benefit is stable quality and low routing jitter; the cost is that compute savings are less pronounced than with more aggressive setups.
2. Three Key Mechanisms of Mixture-of-Experts Architecture
2.1 Gating Networks and Routing Decisions
The gating network computes an affinity score for each expert for every input token, then selects the top-K experts to participate in the computation. In practice, a capacity factor is used to cap the number of tokens a single expert can receive; tokens beyond the limit are either dropped or passed directly through a residual connection.
2.2 Load Balancing and Training Stability
Routing naturally exhibits a “rich-get-richer” effect: a few experts are selected repeatedly while the rest receive no gradient. The common industry practice is to add an auxiliary balancing loss that penalizes overly sharp routing distributions. Sample pseudocode:
# Pseudocode: common pattern for gating + balancing losslogits = gate(x) # [tokens, num_experts]probs = softmax(logits / temperature)topk_val, topk_idx = topk(probs, k=2)# Fraction of tokens assigned to each experttokens_per_expert = bincount(topk_idx, minlength=num_experts)f = tokens_per_expert / tokens_per_expert.sum()p = probs.mean(dim=0)aux_loss = num_experts * (f * p).sum() # smaller when more balancedloss = task_loss + alpha * aux_loss
The temperature coefficient affects two things at once: exploration strength in early training and routing determinism during inference. A low temperature makes selection more decisive; a high temperature smooths the distribution.
3. Choosing Between Dense and Sparse
- For scenarios that demand the lowest single-request latency with low concurrency, a small dense model is often more cost-effective, because the memory overhead of a sparse architecture cannot be amortized.
- For high-concurrency, long-context, or batch offline processing scenarios, the per-token cost advantage of sparse architectures is clear.
- When a team lacks distributed training experience, expert parallelism and routing synchronization in sparse architectures significantly raise operational complexity. Observability should first be established with a general-purpose container platform and monitoring/alerting.
4. A General Workflow for Deployment Evaluation
- Define metrics: keep first-token latency, overall throughput, and per-token cost as three separate curves; do not conflate them.
- Design load tests: build a request set from the real business prompt distribution, covering a mix of long and short text as well as burst concurrency.
- Capacity planning: estimate memory from total parameters, compute from activated parameters, and network bandwidth from the degree of expert parallelism.
- Elastic scaling: use a general-purpose container platform for horizontal scaling on the inference side, use a message queue to smooth peaks, and store model weights in object storage to speed up distribution.
- Continuous monitoring: use logging and monitoring/alerting to track routing distribution drift, cache hit rate, and retry rate.
5. Common Pitfalls
- Treating total parameters as the compute requirement, leading to severe over-provisioning.
- Ignoring the tail latency caused by routing imbalance: average load-test numbers look good while P99 collapses.
- Looking only at quality and not memory, overlooking the hard memory threshold that large-capacity models impose on a single card.
6. Summary
The essence of the sparse Mixture-of-Experts route is trading architectural design for an optimized cost structure. Understanding gating, capacity, and balancing is enough to make a rational judgment about the technical approach of most Chinese foundation models and to complete full validation from load testing to launch in a general cloud environment such as Baidu AI Cloud.
