Architecture Analysis of Trillion-Parameter Open-Source LLMs: Balancing Capability and Inference Cost Through Sparsity

    This article analyzes the architecture of emerging trillion-parameter open-source large language models, focusing on how Mixture of Experts (MoE) and sparse activation designs balance enhanced capabilities with controlled inference costs. It explores key architectural adjustments, including expert expansion, attention mechanism optimization via Multi-head Latent Attention (MLA), and training stability improvements using the MuonClip optimizer, providing insights for deploying ultra-large-scale models.

    1. From 671B to 1T: What the Parameter Scale Leap Means

    In recent years, the parameter scale of open-source large models has steadily climbed. When a model’s underlying structure expands from the hundreds of billions to the trillion level, it does not mean that training and inference costs increase linearly. The core reason for this is the sparse activation design in the Mixture of Experts (MoE) architecture.

    Taking representative industry solutions as a reference, previous mainstream hundred-billion-level MoE models had a total parameter count of around 671B with roughly 37B active parameters. In contrast, newly released trillion-level models reach 1T total parameters while utilizing only about 32B active parameters. In other words, total parameters increased by nearly 50%, but the parameters actually involved in a single inference pass slightly decreased. This combination of “increased total parameters, decreased active parameters” is the essence of modern large model architecture design: using a larger expert pool to exchange for greater knowledge capacity while controlling computational overhead through more refined routing mechanisms.

    2. Expert Expansion: The Core Driver of Higher Sparsity

    The primary source of parameter growth is the increase in the number of experts. The original solution utilized 256 experts, while the new model expands to 384, marking a 50% growth rate. This change brings several impacts:

    1. Expanded Knowledge Capacity. In an MoE architecture, each expert is essentially an independent feedforward network submodule. The more experts there are, the more “knowledge shards” the model can learn. The routing network can dynamically select the most appropriate experts for computation based on the features of the input tokens. Against the backdrop of training data scaling slightly from 14.8T to 15.5T tokens, a larger expert pool can more thoroughly digest long-tail knowledge within the data.

    2. Significantly Improved Sparsity. Sparsity can be roughly understood as the “ratio of total parameters to active parameters.” The 1T total parameters corresponding to 32B active parameters yields a sparsity ratio of about 31:1, whereas the 671B/37B scheme has a ratio of about 18:1. Higher sparsity means that a unit of computation can mobilize a larger knowledge reserve, which is an effective path for scaling model capabilities under limited compute constraints.

    3. Routing and Load Balancing Challenges. The increase in experts also introduces engineering challenges. The router requires more granular load balancing strategies to prevent some experts from being overused while others remain idle (known as routing collapse). This typically requires introducing auxiliary load balancing losses and dynamically adjusting expert capacity factors during training to ensure all 384 experts are adequately trained.

    3. Attention Mechanism Optimization: Long-Sequence Benefits of Halving MLA Heads

    The new model retains the MLA (Multi-head Latent Attention) architecture, a highly efficient attention solution validated in current hundred-billion-level MoE models. Its core idea is to reduce the memory footprint of the KV cache through low-rank latent compression, thereby improving inference throughput.

    A notable change is the reduction of attention heads from 128 to 64. This adjustment brings two direct benefits:

    1. Reduced Long-Sequence Compute Cost. Attention computation is positively correlated with the number of heads. In long-context scenarios (e.g., inputs of hundreds of thousands of tokens), the compute and memory overhead of the attention mechanism accounts for a significant proportion. Halving the number of heads significantly reduces the inference cost for long sequences, while model capability can be compensated by the larger expert pool.

    2. Further KV Cache Compression. MLA already performs latent space compression on the KV cache; halving the heads further reduces cache usage. This is crucial for improving the concurrency of large-scale inference clusters, allowing more requests to be served in parallel under the same memory constraints.

    Additionally, regarding shallow structures, the new model retains dense computation only in the first layer, with all other layers being expert layers. This further increases overall sparsity compared to the previous scheme where the first three layers were dense. Dense layers are typically used to stabilize low-level feature extraction, but in practice, keeping just one dense layer can also converge well in ultra-large-scale training.

    4. Training Optimization: The Value of the MuonClip Optimizer

    Training a trillion-parameter model places extreme demands on optimizer stability. The new model employs the MuonClip optimizer, which can be understood as a combination of Muon-style optimizers and attention logits clipping techniques:

    • The Muon component is based on a matrix orthogonalization approach for parameter updates. Compared to traditional Adam-style optimizers, it can achieve higher parameter update efficiency in certain scenarios, improving the “cost-effectiveness” of training throughput.
    • The Clip component limits the numerical upper bound of attention logits, mitigating occasional attention explosion issues in ultra-large-scale training and reducing the probability of loss spikes.

    For trillion-level models that often undergo uninterrupted training for weeks, training stability directly determines the return on investment. A severe loss spike can lead to a rollback and restart, wasting massive amounts of compute. Therefore, improvements at the optimizer level, though “invisible,” are one of the key guarantees for the successful training of trillion-parameter models.

    5. Inference Cost Evaluation: The Practical Significance of 32B Active Parameters

    From a deployment perspective, 32B active parameters mean that the computational volume of a single forward pass is comparable to a mid-sized dense model. On the inference side, it can be estimated that:

    • If using a large-scale expert parallel deployment architecture, referencing mature optimization methods (expert parallelism, KV cache paged management, operator fusion, etc.), using a cluster of 128 or more GPUs, the inference cost per token is expected to be comparable to or even lower than previous 671B-level solutions.
    • In terms of hardware utilization, expert parallelism allows experts on different devices to process tokens from different requests simultaneously. Combined with the reduction in attention overhead from halving the heads, there is further room to improve overall MFU (Model FLOPs Utilization).

    The following pseudo-code illustrates the computation flow of the MoE layer:

    1. def moe_layer(x, experts, router, top_k=8):
    2. # x: [batch, seq_len, hidden_dim]
    3. gate_scores = router(x) # [batch, seq, num_experts]
    4. topk_ids, topk_weights = topk(gate_scores, k=top_k)
    5. output = zeros_like(x)
    6. for expert_id in selected_experts: # Only activate selected experts
    7. mask = (topk_ids == expert_id)
    8. tokens = gather(x, mask)
    9. output += scatter(experts[expert_id](tokens), mask, topk_weights)
    10. return output # 8 out of 384, computing only about 2% of experts

    Although the details of expert parallelism and All-to-All communication in actual implementation are far more complex than this pseudo-code, the core logic it represents is clear: only a small fraction of experts are activated per forward pass, meaning the growth in total parameters does not directly translate to inference latency.

    6. Summary and Implications

    The implications of this architectural evolution can be summarized in three points:

    1. Sparsity is the Main Theme of Scaling. By expanding the expert pool to increase total capacity and compressing attention heads and active parameters to control inference cost, the two combine to achieve the goal of “stronger capability without increased cost.”
    2. Incremental Architecture Tweaks Beat Reinventing the Wheel. Structurally, the new model continues a proven technical path, making targeted optimizations only in key areas like expert count, head count, dense layer count, and the optimizer. This progressive improvement strategy reduces engineering risk.
    3. Training Stability Engineering is Indispensable. The deployment of trillion-level models relies not only on architectural innovation but also on the synergy of system-level engineering, including optimizers, parallel strategies, and fault tolerance mechanisms.

    For enterprises planning to build large-scale model services, the emergence of such open-source models means they can obtain cutting-edge capabilities while maintaining autonomous deployment. In actual deployment, it is recommended to combine infrastructure such as elastic compute, object storage, container orchestration, and monitoring to build a complete technical pipeline from training to inference, truly translating the capabilities of trillion-parameter models into business value.