The Technical Evolution of Sparse Mixture-of-Experts Architectures in Large Language Models
This article breaks down how sparse Mixture-of-Experts (MoE) architectures reshape large language model design across three dimensions: parameter structure, attention, and residual information mixing. It explains how a model with roughly 300 billion total parameters but under 20 billion activated per token decouples memory from compute, why stacking only about 45 layers creates representation risks, how interleaving linear and sparse attention in a roughly 3:1 ratio cuts attention compute and KV cache, and how manifold-constrained hyper-connections use connection topology to compensate for reduced depth. Pseudocode for sparse routing is included.
1. Introduction: The Shift from Stacking Parameters to Restructuring
Over the past few years, gains in large language model capability came largely from expanding parameter counts and training data in lockstep. Once inference cost, memory footprint, and response latency became hard constraints on production deployment, however, the marginal return of simply increasing total parameters began to decline. The industry therefore turned to a different path: keep total capacity large enough, while pushing the number of parameters that actually participate in computation for each token down to a very low level, and make up for the representational loss caused by a shallow network through changes to the attention structure and the way residual connections are made.
A technical approach that has been discussed repeatedly recently is a concentrated expression of this idea: total parameters on the order of 300 billion, with fewer than roughly 20 billion activated per token; the number of layers deliberately compressed to around 45; attention layers arranged in a periodic interleave of “mostly linear attention plus a few sparse attention” layers; and native support for million-token context along with image and video input. The sections below unpack the technical implications along three dimensions: architecture, cost, and capability.
2. Parameter Structure: Extremely Sparse Expert Mixtures and Shallow Stacking
The approach uses a fine-grained expert mixture design with about 45 layers in total. The first three layers are dense feed-forward blocks; the remaining layers are routed expert layers, with the number of routed experts approaching 300 and each token selecting only 8 of them for computation. This combination of “large total capacity, small activation” has two direct consequences.
First, memory and compute are decoupled. Total parameters determine knowledge capacity and storage overhead, while activated parameters determine the floating-point operations of a single forward pass. Pushing the activation ratio down to around 6% means inference compute demand drops substantially, while knowledge capacity does not shrink accordingly.
Second, shallow structures carry risk. Fewer layers weaken the model’s ability to abstract layer by layer and progressively refine representations. The common industry response is to perform more complex cross-layer information mixing on the residual path rather than simple addition, so that a limited number of layers can carry richer information exchange. The residual mechanism is detailed later in this article.
It is worth stressing that sparse routing introduces load imbalance. In engineering practice this is generally controlled with common techniques such as router load-balancing loss, expert capacity limits, and capacity factors, preventing a few popular experts from being overloaded while the rest sit idle. The illustrative configuration logic is as follows (a generic illustration only, not the interface of any specific product):
# Pseudocode illustration of generic sparse routinglogits = router(hidden_state) # Score expertstopk_idx, topk_val = topk(logits, k=8) # Each token selects 8 expertsweights = softmax(topk_val)y = sum(weights[i] * experts[topk_idx[i]](x) for i in range(8))loss = task_loss + aux_loss * load_balance_penalty # Load-balancing constraint
3. Attention Design: Periodic Interleaving of Linear and Sparse Attention
The core tension in long context is that attention computation and memory grow quadratically with sequence length. The solution here replaces the large majority of the 45 layers (about 34) with linear-complexity attention, keeps sparse attention in the remaining roughly 11 layers, and interleaves the two periodically at about a 3:1 ratio.
This division of labor has a clear functional role. Linear attention is good at low-cost state compression and information transfer across continuous context, and suits “broad-range, low-precision” semantic association. Sparse attention handles “long-distance, high-precision” exact retrieval, compensating for the weakness of linear structures in long-range localization. Interleaving the two is equivalent to using a small number of high-precision layers to calibrate the output of a large number of low-cost layers.
The sparse attention layers also introduce an index pool mechanism that compresses index keys at roughly a 4:1 ratio, striking a compromise between retrieval precision and overhead. According to the public technical description, attention computation drops by about 3x and the key-value cache by about 4.4x relative to the dense attention version in the same series. For inference serving, the reduction in key-value cache is often more valuable than the reduction in compute, because it directly determines how many concurrent sessions a single card can support and whether long-context scenarios are feasible at all.
4. Residual Information Mixing: Trading Depth for Connectivity
The compensation for a shallow network is to let the residual path take on more complex information routing. One widely discussed generic idea is the hyper-connection under a manifold constraint: treat the residual stream as multiple reusable information channels, and use learnable matrices to mix and normalize across layers, so that information from different layers and different channels can be aggregated on demand instead of being compressed into a single vector.
Intuitively, this adds “widened information pathways” when depth is insufficient, letting the model trade the complexity of its connection topology for layer count. Engineering implementation needs to watch numerical stability: multi-channel residuals amplify gradient scale, and are usually paired with normalization and scaled initialization. Illustration as follows:
# Multi-channel residual mixing (schematic)
