Anatomy of Modern LLM Architectures and a Practical Look at Parameter Scale

    A structural analysis of modern large language models: why total parameters keep growing while active parameters stay flat, how KV cache compression and expert routing shape design choices, and the key formulas for estimating weight memory, KV cache size, and per-token FLOPs for deployment planning.

    Anatomy of Modern LLM Architectures and a Practical Look at Parameter Scale

    Why Focus on Architecture?

    It has been a decade since the Transformer was introduced, and architecture surveys are hardly scarce. This article isolates “architecture” as its subject for a specific reason: while the architectural changes made by today’s model providers may look scattered and independent, placing them against the coordinate system of hardware reveals that they all point to the same set of underlying constraints — compute, memory bandwidth, and communication.

    In other words, nearly every architectural evolution can be traced back to a response to bottlenecks in these three resource categories. Understanding this through-line lets you see past the churn of version numbers to the real direction of technical roadmaps, and leaves reasonable headroom for engineering decisions such as inference acceleration, memory planning, and cluster sizing.

    3.1 Total Parameters Explode, Active Parameters Stay Flat

    Over the past two years, total model parameter counts have grown from the hundreds of billions to the trillions, yet the parameters actually activated during each forward pass have remained in the tens of billions. The driver behind this is the widespread adoption of Mixture-of-Experts (MoE) architectures: the feed-forward layers are split into many “experts,” and a router dynamically selects only a few of them to participate in computing each token.

    The benefits of this design are clear:

    • Capacity decoupled from compute: knowledge capacity scales with total parameters, while the compute (FLOPs) per token only scales with active parameters;
    • Memory becomes the new cost: all expert weights must reside in GPU memory. At inference time, weight size is roughly total parameters multiplied by bytes per parameter. For example, a 1T-parameter model stored in FP8 requires about 1TB of memory for weights alone — this directly determines the minimum hardware specification for deployment.

    3.2 Longer Contexts, Smaller KV Caches

    Context windows have expanded from 128K to 1M tokens and beyond, but under standard multi-head attention, the KV cache grows linearly with context length — in long-inference scenarios it can even exceed the weights themselves. Consequently, nearly every new model incorporates some form of KV compression. Common approaches include:

    • Grouped Query Attention (GQA): multiple query heads share a set of key-value heads, shrinking the KV cache proportionally to the number of groups;
    • Multi-head Latent Attention (MLA): keys and values are projected into a low-dimensional latent space, the compressed latent vectors are cached, and expanded at inference time;
    • Sliding window + global attention hybrid: local tokens maintain only a small window of KV, while global information is carried by a small number of special layers;
    • Sparse attention: attention is computed only for selected key positions, reducing compute and cache overhead on long sequences.

    3.3 More Experts, Finer Routing

    The number of experts has grown from 256 to 896 and beyond, while routing strategies have become increasingly fine-grained: from a fixed 2–8 experts selected per token, to combinations of shared experts and fine-grained experts, supported by load-balancing losses and auxiliary-loss-free strategies to prevent expert collapse and routing hotspots. More experts brings two engineering implications:

    1. Higher communication overhead: in multi-GPU inference, experts are distributed across devices, so token routing requires cross-device All-to-All communication — the design of the communication pattern directly affects throughput;
    2. Memory fragmentation: expert weights are scattered across devices, placing higher demands on weight loading, hot swapping, and elastic scaling.

    Four Dimensions Where Architectures Diverge

    Looking across current mainstream model architectures, the differences among providers largely converge on four dimensions:

    4.1 Layer Ordering

    The standard Transformer uses a serial “attention → feed-forward” block. Some models have experimented with parallelization (computing attention and feed-forward in parallel within the same layer to shorten the critical path), normalization placement adjustments (Pre-Norm has become mainstream, while others explore sandwich-style or hybrid arrangements), and heterogeneous designs where layers at different depths use different configurations. Layer ordering is, at its core, a trade-off between compute latency and numerical stability.

    4.2 Attention Sparsification

    As noted above, the goal of sparsification is to push the cost of long contexts down from quadratic. When evaluating a sparsification scheme, three metrics matter most: whether the perplexity loss is acceptable, the KV cache compression ratio, and how well the sparse pattern works with existing inference kernels.

    4.3 Expert Routing

    Routing is the soul of MoE. The current trend is: fine-grained experts + more selected experts + a small number of always-on shared experts, combined with load-balancing auxiliary losses. The router is a small component, but it determines both training stability and the communication topology at inference time.

    4.4 Residual Design

    Choices along the residual path — such as residual scaling, normalization strategies, and low-rank projected residuals — directly affect training stability in deep networks. The larger the total parameter count and the deeper the network, the more critical these residual and normalization details become.

    How to Estimate Parameter Scale

    When planning a deployment, three basic formulas are useful for back-of-the-envelope calculations:

    1. # Weight memory
    2. WeightMem ≈ TotalParams × BytesPerParam
    3. # KV cache (GQA example)
    4. KVCache ≈ 2 × Layers × KVHeads × HeadDim × SeqLen × Batch × BytesPerParam
    5. # Per-token forward-pass compute
    6. FLOPs ≈ 2 × ActiveParams

    For example: a model with 700B total parameters, 40B active parameters, and FP8 quantization needs roughly 700GB of memory for weights alone, requiring a multi-GPU cluster at minimum. The KV cache depends on the number of layers, KV heads, and context length — in long-context scenarios, compression techniques are usually required to keep costs within an acceptable range.

    Conclusion and Trend Outlook

    Putting these trade-offs together, several trends emerge:

    1. The MoE route of continuously growing total parameters with restrained active parameters will continue to dominate flagship models;
    2. KV compression and sparse attention will become standard equipment for long contexts, not optional extras;
    3. Numerical formats keep moving down (FP8 and lower precision), making co-design of quantization-aware training and inference kernels increasingly important;
    4. System-level communication optimization (such as expert parallelism and All-to-All scheduling) will become a key competitive factor for inference services.

    As the old saying goes, mastery comes from broad experience. A deep understanding of architecture ultimately comes down to precise accounting of hardware resources — and that is the shared starting point for next-generation model design and accelerator planning.