Large Language Model Architecture Explained: From Linear Attention to Mixture-of-Experts Design

    This article dissects large language model architecture through three core mechanisms—linear/gated attention (including the delta rule), residual connections, and mixture-of-experts—covering their principles, design trade-offs, and engineering interpretation. It then explains how to rationally read a model's adoption and deployment signals and how to evaluate benchmarks without being misled, helping readers look past surface numbers to judge whether an architectural innovation can actually ship.

    In recent years, the architectural evolution of large language models has followed two main tracks: making attention cheaper computationally under long contexts, and scaling parameter count while keeping compute controllable. Around three core mechanisms—linear/gated attention, residual connections, and mixture of experts—the discussion below works through the principles, design trade-offs, and engineering interpretation layer by layer.

    1. Attention Mechanisms: From Softmax to Linear Attention and the Delta Rule

    Standard self-attention is centered on softmax(QKᵀ)V. Because it must compute a pairwise similarity matrix between queries and keys, both time and memory complexity grow as O(N²) with sequence length N. In long-context, high-throughput inference, this quadratic cost becomes the main bottleneck.

    The linear attention idea is to replace softmax with a decomposable kernel feature map φ, exploiting the associativity of matrix multiplication to reorder the computation:

    1. Standard: (φ(Q) φ(K)ᵀ) V -> compute the N×N similarity first, O(N²)
    2. Linear: φ(Q) (φ(K)ᵀ V) -> compute the d×d accumulation first, O(N)

    This drops the complexity from quadratic to linear in sequence length, at the cost of some loss in representational power and attention accuracy from the approximation.

    Building on this, the delta rule (derived from error-driven update ideas in online learning) is introduced as a “memory write gate.” It treats the key-value accumulation of attention as a recursively updatable state matrix S, and corrects the memory based on the prediction error of the current key rather than simply accumulating:

    1. # Recursive state update of linear attention + delta rule (conceptual)
    2. # S: [d_k, d_v] memory state; k/v: key/value vector of the current token; beta: write strength
    3. def delta_rule_step(S, k, v, beta):
    4. pred = S.T @ k # prediction for the current key using existing memory
    5. err = v - pred # delta: prediction error
    6. S = S + beta * outer(err, k) # update only along the error direction; can "overwrite" old memory
    7. return S

    Compared with purely additive linear attention, the delta rule gives the model the ability to selectively overwrite existing memory, mitigating the dilution of information over long sequences. It also supports two paradigms at once: chunked parallel computation during training to preserve throughput, and a recurrent token-by-token state update during inference, which compresses the KV cache into a fixed-size state matrix and substantially reduces the memory footprint of long-context inference. The engineering value of this kind of design lies in rebalancing “efficiency vs. expressiveness,” but it is not universally better than standard attention across all tasks and needs to be evaluated against the specific workload.

    2. Residual Connections: The Foundation of Deep Trainability

    The residual connection y = x + f(x) is key to stable training of deep networks. It provides an identity-mapping path for gradients, mitigating the vanishing gradients and optimization difficulty that come with increasing depth.

    Around residuals, the industry has developed several mature practices:

    • Normalization placement: post-norm applies normalization after the residual addition, while pre-norm applies it before the sub-layer. Pre-norm is numerically more stable in deep training and is the current mainstream choice for large models.
    • Residual scaling and initialization: scaling the output of the residual branch, or using specific weight initialization, can control the variance growth of deep signals.
    • Attention residuals and multi-stream residuals: further explorations attempt to let multiple residual information streams exist in parallel and interact, or use learnable weights to modulate each sub-layer’s contribution, to ease inter-layer information bottlenecks and enhance feature reuse. This kind of idea is an enhancement of the basic residual structure, and the core goal is still to let information propagate efficiently and stably through very deep networks.

    The significance of understanding residuals is this: any innovation on top of attention or expert structures must ultimately be embedded in this residual framework to be trained effectively. When evaluating a new architecture, you can’t look at a single module in isolation—you also have to look at how it coordinates with residuals and normalization.

    3. Mixture of Experts (MoE): Trading Sparse Activation for Parameter Scaling

    In dense models, every token passes through all the feed-forward parameters, so increasing parameter count necessarily increases computation. Mixture of Experts (MoE) breaks this constraint through sparse activation:

    • Sparse routing: a gating network (router) is trained for each token to select the top-k experts out of N to participate in the computation. Total parameter count grows with the number of experts, but the per-token compute stays roughly constant, achieving “large parameter count, small compute.”
    • Load balancing: without constraints, routing tends to collapse onto a few experts. Common auxiliary losses (such as a load-balancing loss) or a capacity factor are used to encourage tokens to distribute evenly, avoiding some experts being overloaded while others sit idle.
    • Shared experts + routed experts: a common approach keeps a few “shared experts” always active to carry general knowledge, while the rest are “routed experts” handling specialized information, balancing consistency and specialization.

    The so-called “latent-space experts” conceptually refer to first organizing experts or compressing parameters in a low-dimensional latent space, then performing routing and computation, to reduce routing overhead and parameter redundancy. Combined with compression techniques such as quantization and low-rank decomposition, this kind of design is an important direction for controlling MoE deployment costs. It is worth emphasizing that the difficulty of MoE lies not in the concept but in engineering: routing stability, communication overhead under expert parallelism, and memory and batch scheduling often determine real-world performance more than the “number of experts.”

    4. How to Rationally Interpret a Model’s Adoption and Deployment Signals

    Around the ecosystem spread of a new model, several observable indicators are common, but their meanings are easily misread. Building the right interpretive framework matters more than chasing any single number:

    • Weight download counts ≠ real production usage. Downloads and likes on hosting platforms reflect distribution reach and attention, which is not the same as the actual invocation volume of individuals or enterprises.
    • Aggregate platform window metrics ≠ global traffic. Session counts, token share, rankings, and so on shown on third-party aggregator pages are slices of one platform over one time window; fluctuations caused by the window rolling forward cannot be simply interpreted as real changes in usage.
    • Mirror distribution ≠ official framework support. A repository having multiple model shards synchronized by various mirror sites only indicates that distribution channels have spread; only when mainstream inference/training frameworks officially merge the corresponding support does it signal that the engineering ecosystem is maturing. Community support patches still in draft/unmerged state should be treated as directional attempts rather than released capabilities.
    • Community summaries ≠ independent conclusions. Widely circulated claims (such as “the only successful one,” “extremely low cost,” “completed in a very short time”) should be held with reservations if they lack reproducible methodology descriptions and independent evaluators.

    5. Evaluation Methodology: Avoiding Benchmark Misreadings

    Credible evaluation needs to meet several conditions: a fixed evaluation environment (e.g., a clean repository, identical prompts, a traceable number of interventions) to ensure reproducibility; evaluator independence, to avoid self-evaluation and self-verification; and public scoring criteria, so third parties can verify rather than merely accept conclusions. For refusal benchmarks (refusal/alignment evaluations) or comparisons of models that have undergone abliteration, pay particular attention to whether the benchmark construction, metric definitions, and experimental conditions are transparent. Numbers from an opaque methodology, no matter how eye-catching, should not serve as the basis for judging architectural superiority or making deployment decisions.

    Conclusion

    The architectural evolution of large models is essentially about finding a better balance among “expressiveness—computational efficiency—engineering deployability”: linear and gated attention solve long-sequence efficiency, residual connections ensure deep stability, and sparse experts extend the upper bound on parameters. At the same time, rationally interpreting adoption metrics and evaluation conclusions is a necessary skill for judging whether an architectural innovation can truly land. Look at the principles, look at the trade-offs, and look at the methodology—only then can you see through surface numbers and form a reliable judgment about technical trends.