Key Technologies Behind Next-Generation Mixture-of-Experts Models with Million-Token Context

    This article examines the architecture and training methods behind a multimodal MoE model with approximately 2.8 trillion total parameters, about 104 billion activated parameters per token, native vision support, and a one-million-token context window. It focuses on three reusable techniques: numerically safe decay parameterization for linear attention, auxiliary-loss-free quantile-based load balancing, and block-level attention residuals. It also explains how progressive context extension and agent-oriented reinforcement learning support reliable long-context reasoning.

    1. Background: The Dual Challenge of Long Context and MoE

    The capability frontier of large language models is moving beyond single-turn conversations toward long-horizon tasks. AI agents may need to read an entire code repository, maintain memory across hours of interaction, and preserve reasoning consistency through multiple tool calls. These use cases place demanding requirements on context length and parameter efficiency.

    However, increasing the context window by an order of magnitude can sharply increase attention costs, KV-cache memory usage, and training instability. Mixture-of-Experts (MoE) architectures address parameter efficiency through sparse activation, but a large number of experts also introduces problems such as load imbalance and routing oscillation, which can make convergence difficult.

    A recently published technical report describes an approach that addresses both challenges: a multimodal MoE model with approximately 2.8 trillion total parameters, around 104 billion activated parameters per token, native visual input support, and a one-million-token context window. Beyond the specifics of the product, its methodology—especially three core techniques—offers valuable guidance for teams building long-context sparse models.

    2. Overall Architecture

    2.1 Attention: Combining Linear Attention with Gating

    The reported attention module combines incremental linear attention with gated multi-head latent attention. It also shares information across layers through attention residuals. The design can be understood as follows:

    • Linear attention handles long sequences by reducing attention complexity from quadratic to linear, making million-token inputs computationally feasible.
    • Gating uses learnable signals to regulate information flow and mitigate the inherent weakness of linear attention on exact-retrieval tasks.
    • Latent compression projects the KV cache into a lower-dimensional latent space, substantially reducing inference-time memory usage.

    2.2 MoE: Stability with Hundreds of Experts

    The model uses 896 routed experts, representing an extremely sparse configuration. To improve training stability, the architecture introduces two supporting mechanisms: an improved activation function for smoother numerical behavior and a quantile-based load-balancing method, discussed in detail below.

    Pretraining uses a staged context-extension schedule of 8K → 64K → 256K → 1M tokens. This is followed by agent-oriented reinforcement learning at the million-token scale, creating an end-to-end path from short-context learning to long-context task execution.

    3. Three Highly Reusable Techniques

    3.1 Lower-Bounded Decay Parameterization for Linear Attention

    The problem: In linear attention and Delta-style operators, the reciprocal of accumulated decay factors can overflow or underflow under the limited precision of BF16 during block-parallel computation. As a result, diagonal blocks may need to fall back to an explicit position-wise computation path instead of using Tensor Core matrix multiplication. This creates a throughput bottleneck for long-sequence training.

    The approach: Instead of using an unbounded parameterization for log decay, the method applies a scaled sigmoid with a lower bound:

    1. # Pseudocode
    2. g = g_min * sigmoid(e_A_h) # g_min is fixed at -5

    Because g is constrained to the range [-5, 0], the reciprocal scaling factor within any 16-token block remains in a numerically safe range. This provides two benefits:

    1. Diagonal and non-diagonal blocks can both use dense GEMM, eliminating special-case execution paths and improving the efficiency of CUDA and CUTLASS implementations.
    2. The parameterization naturally supports long-context extrapolation in a NoPE (No Positional Encoding) configuration, simplifying positional modeling.

    Adoption cost: Very low. The change is essentially a one-line adjustment to the parameterization, yet it can deliver an operator-level throughput improvement. It is a typical example of a small modification producing a substantial return.

    3.2 Auxiliary-Loss-Free Quantile-Based Load Balancing

    The problem: Traditional MoE load balancing relies on an auxiliary loss. Because this loss is separate from the primary training objective, increasing its weight can hurt task performance, while reducing its weight may make it ineffective. The conflict becomes more pronounced when the model uses hundreds of experts.

    The approach: The model uses a dynamic quantile-based balancing strategy. Instead of adding another term to the loss function, it adjusts the probability of selecting experts directly at the routing layer according to statistical quantiles.

    This offers several advantages:

    • Gradients from the primary task are no longer affected by an auxiliary balancing term, allowing the model to use its capacity more effectively.
    • The balancing strength adapts naturally to the training state, reducing repeated hyperparameter tuning.
    • Expert loads can converge more evenly even under extremely sparse activation.

    For teams training large-scale MoE models, this is a strategy-level improvement that is largely independent of the overall architecture and can be transferred directly.

    3.3 Block-Level Attention Residuals

    The problem: Deep Transformers can encounter a representation bottleneck as depth increases. Signals may gradually weaken across layers, while storing complete attention intermediates for every layer creates significant memory and cross-device communication costs.

    The approach: Residual connections are introduced between attention modules at the block level, enabling information sharing across layers. This helps mitigate gradient and representation degradation in deep networks. By reusing intermediate states, it also reduces memory consumption and communication between devices, making the design particularly suitable for distributed training on clusters with thousands of GPUs.

    4. A Training Methodology for Million-Token Contexts

    The core idea behind progressive context extension—8K → 64K → 256K → 1M—is a gradual curriculum. At each stage, the model is allowed to converge sufficiently at a context length it has already learned to handle before moving to the next level. This avoids the attention collapse that can occur when training directly at extreme context lengths.

    Agent-oriented reinforcement learning is then used during post-training so that the model learns to actively retrieve information, plan, and perform multi-step reasoning within an ultra-long context window, rather than simply receiving all information passively.

    5. Conclusion

    The combination of numerically safe decay parameterization, auxiliary-loss-free load balancing, and block-level residuals is not a collection of isolated optimizations. Together, these techniques address the central engineering challenge of making long-context, highly sparse MoE models trainable and efficient.

    For teams developing or selecting large models, the main value lies in the portability of these principles. Even without targeting trillion-parameter scale, the same engineering ideas can apply to sparse models ranging from billions to tens of billions of parameters.