Second-Generation Open-Source MoE LLMs: Architecture Evolution and Engineering Practice

    This article examines the architectural evolution of second-generation open-source Mixture-of-Experts (MoE) large language models. It explains how Multi-head Latent Attention (MLA) dramatically reduces KV cache memory, how fine-grained expert partitioning with shared experts improves parameter efficiency, and how these innovations enable 128K context windows and sparse activation at scale. It also covers pretraining data engineering, supervised fine-tuning alignment, and practical guidance for developers on deployment, fine-tuning, and evaluation of MoE models.

    1. Background: The Inevitable Shift from Dense to Sparse Architectures

    Over the past few years, the capability gains of large language models have relied heavily on scaling parameter counts. Dense architectures, however, carry a fundamental contradiction: during inference, every token passes through the entire parameter set, so compute cost and memory footprint grow linearly with model size. For enterprises deploying at scale, this directly drives up serving costs and hardware requirements.

    The Mixture-of-Experts (MoE) architecture is the engineering answer to this contradiction. Its core idea is “capability decoupling”: the model’s internal computation is split into multiple expert sub-networks, and a routing mechanism activates only a small subset of experts for each token. This allows the total parameter count—and therefore the knowledge capacity—to keep growing, while the actual compute per inference step stays low.

    The release of the second generation of open-source MoE models marks the point where this architecture moved from an experimental approach to a mature stage that can be benchmarked head-to-head against top-tier dense models. Public evaluations show that such models now rank in the first tier of the industry for comprehensive Chinese-language capability, match same-scale open-source dense models in English, and hold order-of-magnitude advantages in training and inference efficiency. Two key architectural innovations are responsible for these results.

    2. Key Innovation 1: Multi-head Latent Attention (MLA)

    2.1 The Memory Bottleneck of Standard Attention

    In the Transformer, the self-attention mechanism maintains a Key/Value cache for every token. During autoregressive decoding, the KV cache size grows proportionally with sequence length and batch size, and it often becomes the dominant factor in memory consumption for long-context inference. When the context window extends to the 128K range, the KV cache overhead of conventional multi-head attention makes it hard for a single GPU to handle enough concurrent requests, and throughput drops sharply.

    2.2 The Core Idea of Latent Compression

    Multi-head Latent Attention addresses this by compressing KV information into a low-rank “latent vector” space. Instead of storing full Keys and Values separately for each attention head, the model projects the token’s hidden state into a latent space whose dimension is far smaller than the number of heads multiplied by the head dimension. At inference time, only this compressed latent representation is cached; up-projection matrices reconstruct the Keys and Values required by each head on demand.

    Illustrative pseudocode:

    1. # Standard MHA: the cache grows linearly with the number of heads
    2. kv_cache = concat([k_head_1, ..., k_head_h, v_head_1, ..., v_head_h])
    3. # MLA: only cache the low-dimensional latent vector and reconstruct on demand
    4. latent = W_down(hidden_state) # Dimension far below h * head_dim
    5. kv_cache = latent # Cache size greatly reduced
    6. k_heads = W_up_k(latent).split_heads() # Reconstruct during decoding
    7. v_heads = W_up_v(latent).split_heads()

    Mathematically, this design is equivalent to applying a low-rank matrix factorization to the KV cache. In practice, it compresses inference-time KV cache to a small fraction of the conventional approach with essentially no loss of model accuracy, while remaining compatible with widely used techniques such as RoPE positional encoding. For applications that need 128K context support, the memory savings from MLA are architectural and systemic.

    3. Key Innovation 2: Fine-Grained Expert Partitioning and Sparse Activation

    3.1 Limitations of Traditional MoE

    Early MoE designs typically used a “few large experts” structure—several very large feed-forward networks as experts, with each token routed to one or two of them. This design has two problems. First, with so few experts, the granularity of knowledge partitioning is too coarse, and knowledge from different domains tends to couple across experts. Second, routing lacks the flexibility to compose knowledge finely for each token.

    3.2 The Combined Design: Fine-Grained Experts + Shared Experts

    The second-generation MoE architecture improves on this in two ways:

    Fine-grained expert partitioning: the original small number of large experts is split into a much larger number of smaller expert units, and each routing decision activates several of them. With finer expert granularity, the router can compose far richer expert combinations per token, effectively increasing the flexibility of knowledge composition and the model’s expressive capacity.

    Shared expert mechanism: a portion of experts is designated as “shared experts” that process every token regardless of routing results. Shared experts carry common knowledge across all inputs (such as syntactic structure and general language patterns), while the routed experts focus on domain- and task-specific knowledge. This division of labor prevents routed experts from redundantly learning general knowledge and further improves parameter utilization.

    3.3 Quantifying the Effect of Sparse Activation

    Combining these designs, this class of models achieves a typical high sparsity: total parameters at the hundred-billion scale, while the parameters actually activated per token are only at the ten-billion scale—an activation ratio below one-tenth. This means:

    • Inference compute drops substantially; the forward compute cost per token approaches that of a ten-billion-scale dense model.
    • Knowledge capacity is backed by the full parameter set, allowing the model to “remember” and distinguish knowledge across a broader range of domains.
    • Training efficiency improves significantly; public data indicates training efficiency can reach several times that of a same-scale dense model, far below the training cost level of traditional top-tier models.

    4. Long Context and Data Engineering as Supporting Pillars

    4.1 The Engineering Significance of 128K Context

    A 128K context window means the model can process long documents, complete code repositories, or extremely long conversation histories in a single pass. Combined with the KV cache compression from MLA, the memory and throughput costs of long-context inference become manageable in real deployments, making scenarios like long-document summarization, code understanding, and complex multi-turn tasks practically viable.

    4.2 Pretraining on High-Quality Multi-Source Corpora

    Architecture sets the efficiency ceiling; data sets the capability ceiling. This generation of models was pretrained on 8.1 trillion tokens of high-quality multi-source corpora, covering multilingual text, code, mathematics, and other domains. The value of multi-source corpora is that they let different experts naturally develop domain specializations, forming a positive “data–architecture” synergy with the MoE design.

    4.3 Alignment Through Supervised Fine-Tuning

    After pretraining, the model undergoes supervised fine-tuning on roughly 1.5 million conversation sessions spanning multiple domains. Rather than simply maximizing volume, this stage emphasizes the domain diversity and instruction quality of the dialogue data, enabling the model to maintain strong instruction-following and multi-turn interaction performance while preserving its foundational capabilities.

    5. Practical Takeaways for Developers and Enterprises

    1. Cost-sensitive deployments should prioritize sparse architectures: when a workload demands high-concurrency inference or long-context capability, MoE models offer a clear inference cost advantage at equivalent capability.
    2. Memory optimization is a systems engineering effort: beyond architectural MLA, teams can further squeeze hardware utilization with general techniques such as quantization, PagedAttention-style paged cache management, and batching schedulers.
    3. Fine-tuning strategy should match the architecture’s characteristics: when domain fine-tuning MoE models, pay attention to router stability and avoid training on small datasets in ways that cause drastic shifts in the routing distribution.
    4. Capability evaluation should be multi-dimensional: sparse models may perform unevenly across languages and tasks, so teams should build a multi-dimensional evaluation suite tailored to their own business scenarios when selecting a model.

    Conclusion

    By combining MLA with a fine-grained expert architecture, the second generation of open-source MoE models achieves a better balance among parameter scale, compute cost, and context length, validating the engineering viability of the sparse-model route. For developers, understanding the design logic behind these architectures not only helps with model selection and deployment tuning, but also provides a reusable technical paradigm for building their own model systems.