Mixture of Experts (MoE) LLM Architecture: Design Principles and Engineering Practices
This article breaks down how Mixture of Experts (MoE) architectures decouple parameter capacity from per-token computation, and what that means for model selection. It covers the two core designs behind modern MoE models—fine-grained expert segmentation and shared expert isolation—along with the load balancing mechanisms needed to keep routing stable. You will also find practical engineering guidance on memory and parallelism, training stability, inference cost, capacity planning, and deployment, plus common pitfalls to avoid when evaluating MoE models.
1. Why Mixture of Experts
Scaling dense models has long depended on linear growth in parameter count, while compute cost scales roughly with the number of parameters. As a result, training and inference costs climb in step with capability requirements. The core value of Mixture of Experts (MoE) is that it decouples “parameter capacity” from “compute per token”: the model holds a massive pool of parameters, but each token only passes through a small subset of them.
In January 2024, the first open-source MoE LLM architecture in China became publicly available, with support for both Chinese and English and permission for free commercial use. It was subsequently used in base models across several parameter scales, reaching a total of around 671B parameters with roughly 37B activated per token, and was validated at 2B, 16B, and 145B scales as well as on vision-language models. This technical path continued to evolve in 2026: a new generation expert mode launched in April, built on an updated base model and integrating reinforcement learning results at the inference layer; a preview of the next-generation series released the same month offered two tiers, one oriented toward capability ceilings and one toward throughput and cost. The implication for developers is straightforward: when selecting a model, you cannot look at total parameters alone—you must also look at activated parameters.
2. Two Key Designs: Fine-Grained Segmentation and Shared Expert Isolation
2.1 Fine-Grained Expert Segmentation
Traditional MoE uses a small number of “wide” experts. The fine-grained approach splits experts into smaller units and increases their count, raising the number of combinations while keeping total activated parameters unchanged. The benefit is combinatorial growth in the routing options and more specialized division of labor among experts; the cost is more frequent routing decisions and greater sensitivity to communication and scheduling.
2.2 Shared Expert Isolation
If every expert is gated by the router, common knowledge gets learned repeatedly, wasting capacity. Shared expert isolation sets aside a small number of always-active shared experts to carry general knowledge, while the remaining routed experts focus on differentiated features. This yields higher parameter utilization under the same activation budget.
2.3 Load Balancing
Routing naturally exhibits a “Matthew effect,” so auxiliary loss, expert capacity limits, and dropping strategies are needed to constrain it. Example:
# Pseudocode: gating + load balancing + capacity truncationlogits = gate(x) # [tokens, num_experts]probs = softmax(logits, dim=-1)topk_val, topk_idx = topk(probs, k=route_k)# Shared experts always participate and do not compete in top-ky = shared_experts(x) + routed_experts(x, topk_idx, topk_val)# Auxiliary loss suppresses routing collapseload = scatter_count(topk_idx, num_experts)aux_loss = num_experts * sum(load_ratio * mean_prob)# Tokens beyond capacity take the residual shortcut to avoid memory and communication jittery = capacity_guard(y, x, capacity_factor=1.25)
3. Engineering Implementation
- Memory and parallelism: expert parameters need expert parallelism, combined with tensor and pipeline parallelism; communication volume grows with the number of experts and routing width, so prioritize high-speed interconnects.
- Training stability: routing is a discrete decision, so watch numerical precision, initialization scale, and auxiliary loss weight to avoid early collapse.
- Inference cost: the larger the batch, the higher the expert parallelism efficiency; with small batches or low concurrency, the activated-parameter advantage is offset by communication overhead.
- Capacity planning: estimate activated parameters and KV cache based on peak concurrency, and use general monitoring, alerting, and logging services to observe routing distribution and drop rates.
- Deployment: container platforms handle elastic scaling, object storage holds weights and datasets, and the model serving side provides canary release and rollback.
4. Common Pitfalls
The first is treating total parameters as a capability metric; the second is ignoring tail latency caused by routing distribution shift; the third is copying parallelism strategies from dense models; the fourth is underestimating the difficulty of coupling data mix and expert division of labor during fine-tuning. It is advisable to fix activated parameters for controlled experiments during evaluation, and to record throughput, latency, and routing entropy at the same time, forming a reproducible basis for model selection.
