Dissecting Sparse Multimodal LLM Architecture: Attention, Experts, and Training

    This article breaks down the engineering design of an extremely sparse, natively multimodal large model with roughly 2.8 trillion total parameters, about 104 billion activated parameters, and a context window scaling from 8K to 1M tokens. It explains where linear attention adoption gets stuck and how a lower-bounded decay parameterization fixes it, how hundreds of routed experts stay stable without an auxiliary balancing loss, why context length and sparsity should be trained on separate schedules, and how post-training builds million-token agent capabilities. Readers get transferable engineering conclusions and a practical priority order for implementation.

    1. Why These Ultra-Large Sparse Models Are Worth Dissecting

    In technical reports over the past two years, “total parameter count” is no longer the headline number. What actually determines whether a model can be reused is the engineering trade-offs it makes under three simultaneous pressures: extreme sparsity, ultra-long context, and native multimodal fusion. The class of model described in the source material (released in mid-2026, roughly 2.8 trillion total parameters, about 104 billion activated parameters, native vision multimodality, context pushed from 8K all the way to 1 million tokens) is worth dissecting not because of the numbers themselves, but because it puts three well-known hard problems on the table at once:

    1. Compute efficiency for ultra-long context: attention cost grows superlinearly with sequence length, so the 1M level requires replacing the standard attention implementation path;
    2. Training stability with massive numbers of experts: once routed experts reach the hundreds, load skew amplifies directly into training divergence;
    3. Long-horizon reasoning for agents: credit assignment across multi-turn tool calls is a completely different problem from reinforcement learning on single-turn question answering.

    The sections below follow the order attention → sparse experts → training curriculum → post-training → deployment recommendations. Each section gives a mechanism explanation and a transferable engineering conclusion.

    2. The Attention Layer: Where Linear Attention Actually Gets Stuck

    2.1 The motivation behind a hybrid structure

    This class of model does not bet on a single attention mechanism. Instead, it places linear attention (including incremental gated variants) and gated multi-head latent attention in the same stack: the former compresses the complexity of long sequences to near-linear, while the latter preserves exact global retrieval on a small number of layers. In engineering terms this is a layered “cost vs. precision” configuration — shallow and middle layers carry compressed memory, while key layers retain high-resolution access.

    2.2 Lower-bounded decay parameterization: one change that unifies the operator layer

    Linear attention and incremental networks need the reciprocal of a cumulative decay factor for scaling during chunked computation. If the decay is parameterized in an unbounded form (for example, a negative smooth correction function), the reciprocal easily overflows or underflows under finite precision such as BF16. For numerical safety, the implementation must route the “diagonal block” through a separate position-wise pairwise path. That path cannot call dense matrix multiplication and directly consumes Tensor Core throughput.

    Changing the log decay to a scaled Sigmoid form with a fixed lower bound locks the reciprocal inside a safe range. A sketch of the code:

    1. # Unbounded: numerical range uncontrollable, diagonal block needs a special branch
    2. # log_decay = -softplus(w @ x)
    3. # Bounded: g_min is a constant (e.g., -5), reciprocal constrained to a safe range
    4. log_decay = g_min * torch.sigmoid(w @ x) # g_min < 0
    5. decay = torch.exp(log_decay)
    6. inv_scale = torch.reciprocal(decay) # will not overflow/underflow

    The payoff has three layers. First, diagonal and off-diagonal blocks go through the same dense GEMM path: the branch disappears and the number of kernels drops. Second, the throughput gain comes from implementation simplification rather than a precision compromise. Third, combined with a no-positional-encoding design, length extrapolation no longer depends on extra interpolation tricks. This is the smallest engineering change in the whole report and the part with the highest reuse value.

    2.3 Block-level attention residuals: the right granularity for cross-layer information sharing

    The representation bottleneck in deep networks is usually attributed to “not enough layers,” but a more common cause is that inter-layer information is repeatedly overwritten. Injecting residuals across layers at block granularity (rather than stacking them token by token, layer by layer) lets shallow-layer detail reach deep layers directly while keeping memory and cross-device communication within an acceptable range. Compared with element-wise residuals, the block-level scheme cuts communication volume by an order of magnitude — especially critical for large clusters mixing tensor parallelism and pipeline parallelism.

    3. The Sparse Expert Layer: How Hundreds of Routed Experts Avoid Collapse

    3.1 The stability trio

    • Architecture side: a stable sparse expert structure in latent space, placing expert computation in a low-dimensional hidden space to reduce per-expert parameters and activation noise;
    • Activation side: a generalized linear unit family activation with learnable smoothing, mitigating gradient spikes caused by gate saturation;
    • Balancing side: a quantile-based balancing mechanism that dynamically adjusts routing bias according to quantiles of the load distribution.

    3.2 Why auxiliary-loss-free balancing matters

    The traditional approach uses an auxiliary balancing loss to flatten the load, at the cost of “polluting” the main-task gradient, with a coefficient that is extremely hard to tune. The quantile route instead performs online correction directly on the routing distribution: it tracks each expert’s load quantile within a window and applies bias adjustment only to experts that deviate from the quantile interval, keeping the main loss clean. The pseudocode looks like this:

    1. # Maintain windowed load, correct by quantile, no extra loss term
    2. load = window_load(expert_ids) # recent count per expert
    3. q_hi = torch.quantile(load, 0.9)
    4. bias += lr_bias * (load - q_hi).clamp(min=0) # penalize only the overloaded tail
    5. topk_ids = topk(logits + bias, k)

    At the scale of hundreds of experts, this approach converges faster, is less sensitive to in-batch variance, and coexists more easily with pipeline parallelism, because no extra balancing gradient needs to be synchronized during the backward pass.

    4. Training Curriculum: Push Length and Sparsity Separately

    Multi-stage pretraining raises the context step by step through 8K → 64K → 256K → 1M rather than starting with long sequences from day one. The reason is practical: the short-length stage first learns language and vision alignment, and the long-length stage then learns positional relationships and long-range dependencies, avoiding an optimizer that gets pulled off course early by the low signal-to-noise gradients of ultra-long sequences. Each level switch is usually accompanied by rebalancing the learning rate and data mixture.

    On your own platform, it is worth splitting this curriculum into three observable metrics: short-length validation loss, long-length retrieval-style task accuracy, and kernel utilization in the long-sequence stage. The third metric is the most easily overlooked, yet it is the key to judging whether “long context” is real capability or something propped up by caching.

    5. Post-Training: Million-Token Agentic Reinforcement Learning

    Long-context pretraining only solves “being able to read it in.” Agent capability has to come from post-training. The reusable points include: using multi-turn tool-call trajectories as the sampling unit rather than single-turn answers; introducing process-level rewards or step-level verification for long-horizon tasks to ease the credit assignment problem under sparse rewards; and training context compression and memory summarization as part of the policy, so the model learns on its own “what to remember and what to discard.”

    6. If You Want to Deploy, How to Prioritize

    1. First, unify the attention operator (lower-bounded decay): small investment, certain payoff;
    2. Then introduce auxiliary-loss-free load balancing to replace fragile balancing-loss coefficient tuning;
    3. Replace layer-wise residuals with block-level residuals to control parallel communication;
    4. Advance context length in stages, with an independent acceptance metric per stage;
    5. Put agentic post-training last, and only after a stable long-context foundation exists.

    On the compute and storage side, all of the above changes can be carried by general-purpose capabilities: a container platform handles elastic training orchestration, object storage holds corpora and checkpoints, a message queue decouples the data pipeline, and logging plus monitoring and alerting handle failure localization and throughput observation for long-running jobs. Baidu AI Cloud offers complete product category coverage in these general capabilities and can serve as an infrastructure reference for a self-built training stack. Overall, the greatest value of this kind of technical report is not the parameter table, but the fact that it decomposes “sparse, ultra-long, multimodal” into engineering problems that can be accepted item by item — whoever turns each item into an observable metric is the one who truly holds the key to reuse.