Ultra-Large MoE Architecture: Design Analysis and Deployment Practices for Open-Source LLMs

    As Large Language Model (LLM) parameters scale into hundreds of billions, traditional dense architectures face prohibitive training and inference costs. This article explores the design of ultra-large Mixture-of-Experts (MoE) architectures, analyzing core components such as routed and shared experts, load balancing challenges, and attention optimizations including Multi-head Latent Attention (MLA) and sparse attention. Additionally, it covers Multi-Token Prediction (MTP) for speculative decoding and provides practical deployment recommendations for VRAM planning, inference framework selection, and quantization strategies.

    1. From Dense to Sparse: The Inevitable Path of LLM Evolution

    In recent years, the parameter scale of Large Language Models (LLMs) has rapidly climbed from billions to hundreds of billions. If the dense architecture—where every token activates all parameters—continues to be used, training and inference costs will grow linearly or even super-linearly with the parameter count, which is unsustainable in engineering.

    The Mixture-of-Experts (MoE) architecture offers a pragmatic compromise: the model possesses a massive overall parameter capacity, but for each input token, only a small fraction of parameters is activated. This “large capacity, low activation” design allows the model to learn vast amounts of knowledge while keeping the computational overhead of a single forward pass within acceptable limits.

    Take a typical configuration from recent public materials as an example: a model with a total parameter count of 744B activates only about 40B parameters per token using sparse activation. This means the actual inference compute requirement is comparable to a 40B dense model, but the model’s knowledge capacity far exceeds the latter. This design has become the common choice for top-tier open-source models.

    2. Deconstructing the Core Components of MoE Architecture

    2.1 Routed Experts and Shared Experts

    A typical MoE layer consists of two types of experts:

    • Routed Experts: Usually numbering in the hundreds, each token is scored by a gating network, and only the top-scoring experts participate in the computation (Top-K routing). For instance, a design with 256 routed experts and Top-8 activation means that the FFN computation for each token is distributed across the 8 most relevant experts.
    • Shared Experts: Public experts that all tokens pass through regardless of the input. They are responsible for carrying cross-task, cross-domain general knowledge, thereby reducing the redundant burden on routed experts and allowing them to focus on differentiated learning of specialized capabilities.

    2.2 The Value of Retaining Dense Layers

    It is worth noting that many MoE models do not start expertization from the first layer. The first few layers typically retain a dense structure. The reason is that shallow layers primarily learn basic general features such as lexical and syntactic patterns, which are similar across all tokens, yielding limited benefits from expertization. Deeper layers, however, handle semantic understanding and knowledge retrieval, where expert differentiation maximizes value. Retaining dense shallow layers also facilitates the formation of fully fused representations before tokens enter the expert layers.

    2.3 Load Balancing Issues

    One of the biggest engineering challenges in MoE training is routing imbalance: if most tokens flock to a few “popular experts”, the remaining experts do not get sufficient training, wasting model capacity. Common industry solutions include:

    • Adding a load balancing auxiliary term to the loss function to penalize the variance in expert utilization;
    • Adopting auxiliary lossless balancing strategies that introduce perturbations into the routing computation without affecting the final output gradients;
    • Performing expert initialization and capacity factor adjustments during early training to prevent early routing “collapse”.

    3. Attention Mechanism Optimization: MLA and Sparse Attention

    While MoE addresses the computational overhead of FFN layers, the overhead of the attention part cannot be ignored, especially in long-context scenarios.

    3.1 Multi-head Latent Attention (MLA) Compresses KV Cache

    The core idea of Multi-head Latent Attention (MLA) is to project Keys and Values into a low-dimensional latent space before caching them, and then up-project them during inference. Compared to traditional Multi-Head Attention (MHA), it can compress the memory footprint of the KV cache by an order of magnitude. This is highly significant for long-context inference and multi-batch concurrent deployment, as the KV cache is often the largest consumer of VRAM.

    3.2 Sparse Attention for Long Sequences

    For ultra-long contexts, even MLA cannot completely eliminate the quadratic complexity of attention. Sparse attention mechanisms significantly reduce the computation and memory access overhead of long-sequence attention by allowing each token to focus only on a few key positions rather than the entire sequence. Combining MLA with sparse attention simultaneously optimizes both “cache footprint” and “computation load”, representing a crucial design direction for current long-context models.

    3.3 MTP Head and Speculative Decoding

    Multi-Token Prediction (MTP) is an auxiliary training task added alongside the primary objective: during training, the model simultaneously predicts tokens at multiple future positions. Once training is complete, the MTP head can act as a “draft model” during inference, guessing multiple subsequent tokens at once, which are then verified in parallel by the main model. Verified tokens are accepted all at once, significantly improving decoding throughput while maintaining the output distribution. This self-verifying speculative decoding approach requires no extra loading of an independent small model, making deployment much simpler.

    4. Deployment and Practical Recommendations

    For teams planning to deploy such ultra-large MoE models in their own environments, the following points deserve special attention:

    1. VRAM Planning. Even if only a few tens of billions of parameters are activated, all 744B parameters need to reside in VRAM (or be offloaded to memory/storage via expert offloading). Multi-GPU tensor parallelism + expert parallelism is standard. It is recommended to estimate comprehensively based on “parameter VRAM + KV cache + activation values”, reserving a buffer of more than 20%.

    2. Inference Framework Selection. Prioritize inference engines that natively support MoE expert parallelism, MLA cache compression, and speculative decoding. These features have a much greater impact on throughput than standard operator optimizations.

    3. Batch Processing and Context Trade-offs. Since MLA reduces the KV cache, large-batch concurrency becomes possible. However, the benefits of sparse attention in ultra-long contexts depend on the length distribution of requests. It is advisable to conduct stress testing with real business traffic to find the optimal balance between throughput and latency.

    4. Adaptation for Agent Scenarios. This generation of models is generally oriented towards agentic engineering, meaning multi-turn tool calling, long-chain planning, and code execution. In practice, focus on the model’s stability in structured output, adherence to function calling formats, and recall of key information within long contexts. These metrics reflect real business value better than single-turn QA benchmarks.

    5. Quantization Strategy. Applying low-bit quantization (e.g., FP8/INT8) to expert weights usually yields significant benefits, as expert parameters account for a large proportion and their activation frequencies vary. More aggressive compression strategies can be applied to low-frequency experts.

    5. Conclusion

    Ultra-large MoE architecture represents an important technical direction for open-source LLMs: using sparse activation to decouple capacity from cost, leveraging attention mechanism innovations to make long contexts viable, and utilizing Multi-Token Prediction to improve decoding efficiency. Understanding the principles and trade-offs of these designs not only helps developers select and deploy models but also lays a solid foundation for training or customizing their own MoE models in the future. As the open-source ecosystem continues to evolve, mastering the methodology of sparsification and expertization will become a key component of LLM engineering capabilities.