LLM Architectures Explained: From MoE Designs to Parameter Scale

    A deep dive into the architectures of today's leading large language models. This article breaks down four key structural decision points—layer ordering, attention sparsification, Mixture-of-Experts routing, and numerical precision—explains how total versus activated parameters have diverged, and shows how hardware constraints around compute, memory bandwidth, and interconnect shape every major design choice.

    Why Revisiting Model Architecture Matters

    The Transformer has been around for a decade, and architecture surveys are hardly scarce. This article, however, is not another retelling of that history. Instead, it dissects the architectures of today’s mainstream large language models layer by layer to answer two very concrete questions: What structure are these models actually built on? And how large are their parameters, really?

    Discussing structure in isolation is worthwhile because the changes made by different labs may look scattered, but viewed together, they all point to the same set of hardware constraints: compute, memory bandwidth, and communication overhead. In other words, every structural decision is essentially a search for balance among these three constraint lines.

    Three clear quantitative trends have emerged in recent years:

    1. Total parameters and activated parameters keep diverging. Total model size has grown from hundreds of billions to trillions of parameters, yet the number of parameters actually activated per inference has remained in the tens of billions. This is the direct consequence of sparse Mixture-of-Experts (MoE) architectures going mainstream.
    2. Context length and KV cache are evolving in opposite directions. Context windows have expanded from 128K tokens to 1M tokens, yet KV cache memory usage keeps being squeezed—through multi-head latent compression, sliding windows, and hierarchical caching—so that “long context” and “affordable memory” can coexist.
    3. Expert counts are growing while routing granularity gets finer. The number of experts has grown from 256 to 896, but each expert is smaller, and routing granularity keeps getting finer—trading higher sparsity for more precise capacity allocation.

    Understanding the trade-offs among these three pairs makes it possible to make informed predictions about next-generation models and to leave headroom in inference accelerator design. The rest of this article first lays out a unified analytical framework, then examines each dimension in turn.

    A Unified Framework: Four Structural Decision Points

    Strip away the naming conventions, and the differences among today’s LLMs come down to four areas:

    2.1 Layer Ordering

    The standard Transformer block follows a serial “attention → feed-forward network” order with Pre-Norm normalization. Current layer-ordering changes include:

    • Normalization position and precision: RMSNorm has largely replaced LayerNorm, with normalization consistently placed before each sublayer. Some models add an extra normalization on the residual path to stabilize very deep training.
    • Rearranging attention and FFN: Some models run attention and FFN computations in parallel—both share the same input and their outputs are summed—reducing serial waiting between layers and improving pipeline efficiency.
    • Hybrid attention layers: To control the memory cost of long contexts, many models insert linear attention or sliding-window attention layers between standard full-attention layers, creating a hybrid stack of “full attention + sparse/linear attention.”

    2.2 Attention Sparsification

    Attention is the module with the heaviest memory-bandwidth pressure, since the KV cache grows linearly with context length. The mainstream countermeasures include:

    • Low-rank key-value compression: Keys and Values are projected into a lower-dimensional latent space for caching and expanded at inference time, reducing KV cache size by an order of magnitude.
    • Grouped-Query Attention (GQA): Multiple query heads share a single set of key-value heads, shrinking cache size.
    • Sliding windows + global anchors: Local windows handle nearby tokens while a small number of global tokens carry long-range information, achieving sparsity without significant accuracy loss.
    • Hierarchical / sparse retrieval attention: For ultra-long contexts, relevant token blocks are first coarsely filtered before attention is computed precisely, reducing complexity from O(n²).

    2.3 Mixture-of-Experts and Routing

    MoE is the key to pushing total parameters past the trillion mark. Current design essentials:

    • Fine-grained experts: Many small experts replace a few large ones, offering greater compositional flexibility. A typical configuration uses hundreds of experts per MoE layer, with roughly 8 activated per token.
    • Shared experts: Always-active shared experts carry general knowledge while routed experts focus on differentiated patterns, reducing routing redundancy.
    • Load balancing: Auxiliary losses or lossless dynamic bias mechanisms prevent routing from collapsing onto a few hot experts and keep communication balanced under expert parallelism.
    • Activated-parameter ratio: In mainstream models, activated parameters are typically 5%–10% of total parameters—for example, a model with ~1T total parameters activates on the order of tens of billions.

    2.4 Residual Mixing and Numerical Formats

    • Residual scaling: Expert outputs are scaled by routing weights before being injected into the residual stream, with residual strength controlled in the early stages to stabilize deep-network training.
    • Low-precision numerics: Training commonly uses BF16/FP8 mixed precision, and inference is evolving toward FP8 and below. This directly determines weight size and memory bandwidth requirements—a 1T-parameter model weighs roughly 1TB in FP8, which is precisely why multi-GPU interconnect has become a hard requirement.

    Typical Parameter Scale Distribution

    Drawing on public technical reports, the scale distribution of today’s first-tier models looks roughly like this:

    Architecture Type Total Parameters Activated Parameters Typical Characteristics
    Small dense models 1B–30B Fully activated On-device deployment, low latency
    Large dense models 70B–200B Fully activated General-capability baseline
    Mid-size sparse MoE 100B–500B 10B–50B Balanced cost-effectiveness
    Very large sparse MoE 500B–multi-T 20B–50B Pushing capability ceilings

    The industry consensus is now clear: total parameters determine capability, activated parameters determine efficiency. Inference cost is driven mainly by activated parameters and the KV cache, while training cost is driven by total parameters and data volume—MoE neatly decouples the two.

    Three Hardware Constraints

    Architectural choices ultimately land on hardware:

    1. Compute: Sparsification reduces per-token computation, but ultra-long contexts still demand high compute throughput, and the share of attention operators keeps rising.
    2. Memory: Decoding is a classic memory-bandwidth bottleneck. Weight size (total parameters × numerical bit width) determines total memory requirements, which is why KV cache compression has become the lifeline for long contexts.
    3. Communication: Expert parallelism requires frequent All-to-All communication. The more experts and the finer the routing, the more interconnect bandwidth matters—directly driving the adoption of high-bandwidth interconnect topologies.

    Conclusion

    Dissecting model architectures one by one reveals a clear direction for next-generation models: total parameters marching toward several trillion, activated parameters holding at tens of billions, contexts approaching 1M tokens, KV caches under continuous compression, and expert counts approaching a thousand with ever-finer routing granularity. For inference providers, evaluating a large model should not stop at total parameters—activated parameters, KV cache strategy, and communication patterns matter equally, since together they determine real service cost and latency. For developers, understanding this structural vocabulary is the key to judging whether a model fits their business scenario.