Trillion-Scale MoE Multimodal Models: Architecture Design and Engineering Practices
This article breaks down the architecture and engineering practices behind trillion-parameter sparse Mixture-of-Experts (MoE) multimodal models. It covers hybrid attention for long contexts, three techniques for training stability and efficiency (lower-bounded decay parameterization, quantile balancing, and block attention residuals), the multi-stage context extension and agentic reinforcement learning recipe, and practical takeaways for teams building their own large models.
Introduction
As large language models move into the harder territory of ultra-long context, multimodal input, and agentic reasoning, the traditional dense Transformer architecture is struggling to keep up in terms of computational efficiency and training cost. The mainstream industry direction combines sparse MoE, linear or hybrid attention mechanisms, and multi-stage context extension training. This approach builds models with a total parameter count in the trillions but only about 100 billion parameters activated per step.
A recent public technical report describes an MoE multimodal model with about 2.8 trillion total parameters and about 104 billion activated parameters. Its architecture offers systematic solutions in three areas: efficiency with very long contexts, training stability for very large MoE models, and long-horizon reasoning for agents. This article does not focus on any specific product. Instead, it provides an engineering breakdown of the general architectural techniques behind this class of models.
1. Overall Architecture: Combining Sparse MoE and Hybrid Attention
The overall design of such models can be summarized as one backbone and two mechanisms:
- Backbone: A natively multimodal Transformer that models vision and text in a shared representation space, with native support for context windows of 1 million tokens.
- Attention: Instead of a single attention form, the model combines incremental linear attention (Delta-style updates with decay gating) and Gated Multi-head Latent Attention (Gated MLA). An attention residual mechanism shares information across layers.
- Feed-forward network: An extremely sparse MoE structure with close to 900 routed experts, paired with a specialized activation function and an auxiliary-loss-free load balancing strategy.
The core motivation for this combination is as follows. Linear attention reduces the sequence-dimension complexity from quadratic to approximately linear, which addresses the compute bottleneck of million-token contexts. MLA compresses the KV cache with low-rank compression, which addresses the memory bottleneck of long-context inference. MoE raises model capacity to a new scale with almost no increase in inference cost. Each component targets one key constraint: compute, memory, or capacity. Together, they form a systematic set of trade-offs.
2. Innovation 1: Lower-Bounded Decay Parameterization for Full Tensor Core Utilization
Pain Point
In linear attention and Delta Net-style mechanisms, chunked parallel computation requires taking reciprocals of cumulative decay factors. With limited-precision formats such as BF16, these reciprocals can easily underflow or overflow. As a result, the diagonal tile cannot use the standard matrix multiplication path and must fall back to explicit position-by-position pair computation. This special branch is complex to implement. More importantly, it cannot use the dense GEMM acceleration of GPU Tensor Cores, which makes it one of the largest engineering obstacles to deploying linear attention.
Mechanism
The solution is simple. The log decay term of the gate changes from an unbounded parameterization based on negative Softplus to a lower-bounded, scaled Sigmoid parameterization. A minimum decay value is fixed (for example, -5), which constrains the gate output to the range gmin · Sigmoid(·). This keeps the reciprocal scaling factors within any 16-token chunk in a numerically safe range.
Benefits
- Diagonal and off-diagonal blocks can use a single, unified causal tile computation path that runs entirely on dense Tensor Core GEMM, which significantly increases throughput.
- Removing special-case branches from the operator implementation greatly reduces the development and maintenance cost of CUDA kernels.
- The decay parameterization works naturally with a No Positional Encoding (NoPE) design. This supports direct extrapolation to very long contexts and avoids the classic failure of positional encoding extrapolation.
Reuse recommendation: This technique requires a small engineering change and delivers a large benefit. Any team developing its own linear attention operator can first apply this parameterization to remove the special diagonal-block path, then consider further operator fusion.
3. Innovation 2: Quantile Balancing for Auxiliary-Loss-Free MoE Load Balancing
Pain Point
When the number of routed experts reaches hundreds, traditional auxiliary load balancing losses create a dilemma. A large weight disturbs the gradients of the main task and hurts model quality. A small weight makes balancing ineffective under extreme sparsity, leading to expert collapse, where a few experts are overloaded while most sit idle. Training can then easily diverge.
Mechanism
Quantile Balancing does not constrain the model indirectly through the loss function. Instead, it uses statistics on the quantiles of routing scores to dynamically adjust the routing bias terms. This makes the probability of each expert being selected statistically uniform over time. Because it does not inject extra gradients into the main loss, the optimization objective of the main task remains unchanged.
Benefits
- It removes the burden of tuning auxiliary loss hyperparameters, and training dynamics become more stable.
- With close to 900 routed experts under extreme sparsity, it maintains healthy expert utilization.
- Combined with a GLU-variant activation function suited to sparse structures, it further suppresses late-stage gradient spikes and loss oscillation.
Reuse recommendation: For teams building their own MoE training frameworks, the idea of correcting imbalance directly with statistics, rather than penalizing it indirectly through the loss, is broadly applicable. It is worth considering as the default balancing strategy.
4. Innovation 3: Block Attention Residuals for Breaking Deep Representation Bottlenecks
Pain Point
In deeper networks, standard residual connections only pass information between adjacent layers. Deep networks therefore tend to develop homogeneous representations. Layer-by-layer forward activations also place constant pressure on memory and distributed communication.
Mechanism
Block Attention Residuals (Block AttnRes) let the current block directly access the attention outputs of several earlier blocks. This creates a high-speed information path across blocks, rather than relying only on layer-by-layer chaining. In effect, it adds sparse, long-range skip connections along the depth dimension.
Benefits
- It alleviates representation degradation in deep Transformers and increases effective depth.
- Because intermediate results are shared across blocks, some inter-layer activations do not need to be materialized repeatedly. This reduces memory usage and cluster communication overhead, which matters most at the scale of tens of thousands of accelerators.
5. Training Strategy: Multi-Stage Context Extension and Agentic Reinforcement Learning
Beyond architecture, the training recipe also sets the performance ceiling. The approach uses a four-stage context extension during pretraining: 8K → 64K → 256K → 1M. It first trains most tokens on short contexts, then gradually extends the window. This concentrates the expensive long-sequence computation on a small number of later tokens, which is a typical cost-optimal schedule.
In post-training, the approach adds agentic reinforcement learning (Agentic RL) at the scale of about one million tokens. The model learns planning, tool use, and multi-step error correction from realistic long-horizon task trajectories, which directly builds capabilities for agent scenarios.
6. Takeaways and Practical Recommendations for Enterprises
- Start with low-cost, high-return techniques: Lower-bounded decay parameterization and quantile balancing both require small changes and deliver large gains. They are good starting points for iterating on in-house models.
- Use cloud services to reduce trial-and-error costs: Training with ultra-long contexts and large-scale distributed MoE requires substantial compute, storage, and networking. Enterprises can use general-purpose cloud products, such as container platforms, object storage, log services, and monitoring and alerting from Baidu AI Cloud, to build elastic training and inference pipelines and focus on model algorithms.
- Extend context in a curriculum-style progression: Rather than jumping straight to a million-token window, extend sequence length stage by stage and validate position extrapolation at each stage. This is a standard way to control budget and risk.
- Build agent capabilities through post-training: Long context is the foundation, but strong long-horizon reasoning requires task-oriented reinforcement learning during post-training. Teams should plan their evaluation baselines early in the project.
Conclusion
Competition among trillion-parameter MoE multimodal models has shifted from scaling parameters to systems-level architecture engineering. Attention numerical stability, expert load balancing, cross-layer information flow, and training curriculum design can each become a bottleneck. The three techniques discussed here, lower-bounded decay parameterization, quantile balancing, and block attention residuals, can each be reused independently of any specific model. For teams planning their next generation of large models, understanding and adopting these general design principles matters more than chasing any single model.
