Technical Overview of Trillion-Scale Sparse Multimodal Models

    This article breaks down the technical paradigm behind trillion-scale sparse multimodal models, focusing on four reusable design patterns: lower-bounded decay parameterization for linear attention, quantile balancing for expert routing, block attention residuals, and multi-stage context extension with agentic reinforcement learning post-training. It also covers the overall architecture profile and practical engineering recommendations, helping readers understand how numerical stability, routing fairness, and information-path efficiency work together at extreme scale.

    1. Introduction: Why Scale Is No Longer the Only Story

    Over the past two years, the main thread of the large-model race has shifted from stacking parameters to maximizing output per unit of compute. As total parameter counts enter the trillions, context lengths move toward a million tokens, and modalities expand from pure text to native image-text mixtures, the engineering problems are no longer about whether the model is big enough. Instead, three questions dominate: can the attention cost of ultra-long sequences be linearized, can extremely sparse routing remain stable, and can representation and memory communication in deep networks be decoupled. This article uses a typical trillion-scale MoE multimodal technical report as a blueprint, abstracts its technical paradigm, and expands the reusable design points layer by layer.

    Note that this discussion does not involve any specific vendor product. It covers general industry technical routes: Mixture of Experts (MoE), linear attention, multi-stage context extension, and agentic reinforcement learning post-training.

    2. Overall Architecture Profile: Sparsity + Multimodality + Long Context

    A typical contemporary ultra-large-scale solution usually has the following outline:

    • Sparse MoE backbone: about 2.8 trillion total parameters, about 104 billion activated per token, an activation ratio of about 3.7%, and hundreds of routed experts (for example, 896 routed experts).
    • Native multimodality: the vision encoder and language backbone are jointly pre-trained rather than aligned and concatenated after the fact, avoiding the modality gap.
    • Million-level context: pre-training proceeds in four stages, 8K → 64K → 256K → 1M, with million-token-level agentic reinforcement learning added during post-training.
    • Hybrid attention design: incremental linear attention and Gated Multi-head Latent Attention (Gated MLA) are used together, with attention residuals enabling cross-layer information sharing.

    The objective function of this combination is clear: trade sparsity for capacity, trade linear attention for length, and trade cross-layer sharing for depth efficiency.

    3. Innovation 1: Lower-Bounded Decay Parameterization for Linear Attention

    3.1 Pain Point

    Linear attention and Delta Net-like structures need to handle the cumulative decay factor Γ during chunked computation. The traditional approach parameterizes the log decay as an unbounded negative-softplus form, whose reciprocal is extremely prone to overflow or underflow under the finite precision of BF16. The engineering compromise is to route the diagonal tile through an explicit position-pair path, while only off-diagonal tiles can use matrix multiplication acceleration. As a result, the computation graph branches, operator implementation becomes complex, and Tensor Core utilization drops.

    3.2 Mechanism and Illustration

    Change the log decay to a scaled Sigmoid with a lower bound:

    1. # Illustration: lower-bounded decay parameterization (g_min is a constant lower bound, e.g., -5)
    2. g = g_min * torch.sigmoid(theta) # theta is a learnable parameter
    3. decay = torch.exp(g) # ensures decay ∈ (exp(g_min), 1)
    4. inv_decay = torch.exp(-g) # reciprocal is locked in a safe numerical range

    Because g is constrained to [g_min, 0), the reciprocal scaling factor within any 16-token tile is limited to a representable range, so numerical stability holds naturally.

    3.3 Benefits

    • Eliminates the special branch for diagonal tiles; all causal tiles go through dense Tensor Core GEMM uniformly;
    • Significantly simplifies operator implementation, improves throughput, and regularizes memory access patterns;
    • Naturally compatible with the NoPE (no positional encoding) setting, supporting direct extrapolation to a million-token context without retraining.

    Reuse value judgment: High. It barely changes model semantics and only replaces a parameterization function, making it a typical optimization with minimal engineering change and maximal benefit.

    4. Innovation 2: Quantile Balancing

    4.1 The Cost of Traditional Load Balancing

    Ultra-large-scale MoE usually relies on an auxiliary loss to constrain the routing distribution. But with hundreds of experts and trillions of parameters, the auxiliary loss weight is extremely hard to tune: too small and experts collapse, too large and it harms main-task convergence, while also introducing extra gradient noise.

    4.2 The Idea Behind QB

    Quantile Balancing shifts the problem from “penalizing the distribution” to “constraining the cumulative distribution”: it divides capacity boundaries by quantiles of routing scores, so that the number of tokens each expert receives within a training window approaches balance. It requires no extra auxiliary loss term and is a dynamic, gradient-intervention-free scheduling strategy.

    In engineering terms, it can be understood as adding one quantile statistic and threshold mapping after routing scores:

    1. scores -> within-window quantile statistics -> capacity threshold -> top-k selection + overflow redistribution

    4.3 Benefits

    • Cleaner main-task loss curves and a smaller hyperparameter search space;
    • Reduced communication skew caused by expert hotspots in large-scale distributed training;
    • Orthogonal to the capacity factor mechanism and can be used in combination.

    5. Innovation 3: Block Attention Residuals (Block AttnRes)

    Deep Transformers face a “depth representation bottleneck”: increasing layers does not necessarily increase effective information linearly, while the memory and cross-device communication overhead of layer-by-layer activations remains high.

    Block AttnRes changes residuals from “layer-by-layer chaining” to “cross-layer sharing by block”: the network is divided into several blocks, conventional residuals are kept within each block, and information is passed between blocks through a shared attention residual channel. There are three benefits:

    1. Representation level: shallow details and deep semantics can interact directly across blocks, alleviating gradient and information decay;
    2. Memory level: no need to cache all layer-by-layer activations, reducing peak memory;
    3. Communication level: data volume for cross-device synchronization is aggregated by block, reducing frequent small-message transfers.

    6. Training Pipeline: Multi-Stage Context Extension + Agentic Post-Training

    The core idea of four-stage pre-training is “easy first, then hard, gradually lengthening”: the 8K stage quickly establishes language and multimodal alignment; the 64K and 256K stages introduce long documents and code-base-level dependencies; the 1M stage uses a mix of sparse attention and linear attention to handle ultra-long samples. At each stage transition, the learning rate, in-batch sequence packing strategy, and position extrapolation configuration must be adjusted accordingly.

    Post-training centers on million-token-level agentic reinforcement learning: task formats shift from single-turn question answering to multi-step tool calls and long-horizon planning, and reward signals must account for both result correctness and process compliance. Practical points include trajectory length truncation and segmented rewards, reuse of failed trajectories as negative samples, and incorporating inference cost into the reward to avoid “infinite thinking”.

    7. Engineering Implementation Recommendations

    • Operators first: do numerical stabilization (lower-bounded decay) first, then discuss parallel strategies; otherwise all throughput optimization is built on incorrect numerics;
    • Polarization-free balancing: prefer balancing schemes without auxiliary loss to reduce tuning cost;
    • Memory budget table: model attention cache, expert parameters, and activations separately, and identify which layer is the bottleneck;
    • Observability: on the cloud, consider combining a container platform to host the training cluster, object storage for corpora and checkpoints, and logging services with monitoring alerts to track routing distribution and loss spikes;
    • Layered evaluation: set separate gates for general benchmarks, long-context retrieval, multimodal understanding, and agentic long-horizon tasks to avoid misleading single metrics.