LLM Architecture Design and Parameter-Scaling Trade-offs: Compute, Memory, and Communication Constraints

    This article examines why modern large language model architectures are converging: total parameters scale to trillions while active parameters stay at tens of billions, context windows reach 1M tokens while KV caches are aggressively compressed, and MoE expert counts grow from 256 to 896 with finer-grained routing. It analyzes layer configuration, attention variants, mixture-of-experts design, and numerical formats (FP8/FP4) through a unified framework of three hardware constraints—compute, memory bandwidth, and communication—helping readers anticipate next-generation model designs and plan infrastructure accordingly.

    1. Why Architecture Deserves Its Own Discussion

    More than a decade has passed since the Transformer was proposed, and there is no shortage of surveys covering its architectural evolution. What is worth noting, however, is that the architectural changes in the latest generation of large language models may look scattered—some deepen the layers, some widen the experts, some compress the KV cache—but when plotted on the same coordinate system, they almost all point to the same set of hardware constraints: compute, memory access, and communication.

    In other words, architectural evolution is not purely academic exploration. It is an engineering answer to the question of “how to spend a fixed compute budget most effectively,” given chip process technology, memory bandwidth, and interconnect topology. Understanding the causal chain behind these trade-offs is more valuable than memorizing any single model’s configuration: it allows us to anticipate the direction of next-generation models and leave headroom for accelerator design and inference cluster planning.

    Here are the key observations that run through this article:

    • Total parameters have grown from hundreds of billions to trillions, while active parameters have long remained in the tens-of-billions range. This is a direct consequence of sparsity, especially mixture-of-experts (MoE) architectures.
    • Context windows have expanded from 128K to 1M tokens, yet the KV cache is being repeatedly compressed. The bottleneck of long context is memory, not compute, so every attention variant is doing the same thing: reducing per-token KV storage.
    • Expert counts have grown from 256 to 896, with increasingly fine-grained routing. Experts are becoming smaller and more numerous so that per-expert memory access stays manageable as total parameters grow.

    The following sections proceed in this order: scale and layer configuration → attention → mixture-of-experts → numerical formats → hardware constraints.

    2. Model Scale: The Widening Gap Between Total and Active Parameters

    2.1 The Baseline of Scale

    Current mainstream model configurations can be summarized into several tiers:

    Tier Total Params Active Params Typical Layers Typical Hidden Dim
    Flagship MoE 400B ~ 2T+ 30B ~ 80B 60 ~ 90+ 4K ~ 8K+
    Lightweight MoE 100B ~ 300B 10B ~ 30B 40 ~ 60 2K ~ 4K
    Dense small/mid models 7B ~ 70B Equal to total 28 ~ 80 2K ~ 8K

    A clear trend has emerged: after dense scaling laws hit diminishing returns, the industry consensus has shifted toward “sparse scaling.” Total parameters determine the upper bound of a model’s knowledge capacity, while active parameters determine the compute cost per token. Once the two are decoupled, the training side can keep adding data and capacity without a proportional increase in inference cost.

    2.2 Rebalancing Depth and Width

    Several notable tendencies have appeared in layer configuration:

    1. Layers are generally getting deeper. More than 60 layers has become the flagship standard, with some models approaching 90. Deeper networks bring stronger abstraction capabilities but also lengthen pipeline parallelism, raising the bar for optimizing pipeline bubbles during training.
    2. Individual layers get wider, but attention head counts change little. Hidden dimension growth mainly serves the capacity expansion of the FFN/MoE portion rather than attention—because attention compute and memory grow quadratically (or at least linearly) with sequence length, blindly widening it is not cost-effective.
    3. Vocabulary sizes are stabilizing. Most models converge in the 100K–250K token range. The benefit of further vocabulary expansion is no longer significant, while the parameter share and memory pressure of the embedding and output layers keep rising.

    2.3 Why Active Parameters Stay in the Tens of Billions

    Active parameters remaining in the 30B–80B range is no coincidence—it is the result of three overlapping constraints:

    • Single-GPU memory: Active parameters determine weight memory footprint. Exceeding single-GPU or single-node memory forces complex sharding and offloading, and inference latency deteriorates sharply.
    • Batching efficiency: Excessively large active parameters increase per-token compute time, batch size cannot scale up, and GPU utilization drops.
    • Decode latency: Autoregressive decoding is a classic memory-bound scenario. Every generated token requires a full read of the active weights, so active parameter count directly determines the floor of decoding speed.

    Therefore, “large total parameters, small active parameters” is the only path that simultaneously satisfies “high capability” and “deployability.”

    3. Attention: The Tug-of-War Between Long Context and KV Cache

    3.1 The Context Length Race

    Context windows have expanded from 32K and 128K all the way to 1M tokens. But what supports this race is not larger memory—it is more memory-efficient attention structures:

    • Grouped-Query Attention (GQA) has become standard. Multiple query heads share a single set of KV heads, directly compressing the KV cache to a fraction of its original size with almost no accuracy loss. It is the most cost-effective change available.
    • Some models adopt a hybrid layering of sliding-window + global attention. Local layers attend only to a fixed window, while global layers are sparsely distributed. Total KV drops from O(N) to O(w·N/L + N_g), where w is the window size and N_g is the number of global layers.
    • KV quantization and low-rank compression are moving from papers to production: storing the KV cache in FP8 or even lower precision, or compressing the KV dimension via low-rank projection, can reduce KV memory at 1M context to less than one-tenth of a traditional MHA setup.

    3.2 A Simple Estimate

    Take a model with 90 layers, 96 KV heads, and head_dim 128. Storing the KV cache for 1M tokens in FP16:

    1. KV memory = 2 (K and V) × layers × KV heads × head_dim × seq length × bytes per element
    2. = 2 × 90 × 96 × 128 × 1e6 × 2 B ≈ 4.4 TB

    This far exceeds the memory capacity of any single machine. With GQA (8 KV head groups) plus FP8 quantization, it drops to roughly 180 GB, which becomes manageable with multi-GPU tensor parallelism. These numbers explain why “context expansion” and “KV compression” must advance in lockstep.

    3.3 Asymmetric Impact on Training and Inference

    It is worth noting that attention changes affect training and inference asymmetrically:

    • The training side cares about compute utilization on long sequences. IO-aware implementations like FlashAttention have already pushed the attention operator into the compute-bound regime.
    • The inference side cares about the KV cache’s memory footprint and bandwidth consumption. The prefill phase is compute-bound, while the decode phase is memory-bound; the two require different scheduling strategies.

    4. Mixture of Experts: Expert Count, Granularity, and Routing

    4.1 The Expansion Path of Expert Scale

    Early MoE models had 8–64 experts, each being a complete FFN. In the past two years this number has climbed to 256, 512, and even 896, accompanied by several structural changes:

    1. Experts are getting smaller. The intermediate dimension of a single expert has shrunk from “comparable to a dense FFN” to a fraction of it, keeping per-layer total parameters under control as expert counts grow.
    2. Shared experts + routed experts have become a common combination. Shared experts handle general knowledge for all tokens, while routed experts are activated only by some tokens. This division of labor reduces the randomness overhead of routing.
    3. Fine-grained routing. Each token typically activates only 6–10 experts—about 1% of the total—striking a balance between capacity and compute.

    4.2 The Communication Problem Introduced by Routing

    The biggest engineering challenge of MoE is not modeling but communication. Under expert parallelism, tokens must be dispatched across devices to the experts they are routed to, then combined back after computation. The cost of these two all-to-all communications grows with expert count and device count, and is often the primary bottleneck of training throughput.

    As a result, choosing the number of experts is effectively solving a constrained optimization problem:

    1. minimize per-token compute (determined by active parameters)
    2. subject to:
    3. - per-expert size ≤ a memory-bandwidth-friendly ceiling
    4. - expert count × per-expert size = target total parameters
    5. - expert count ≤ parallelism supported by the communication topology

    The growth from 256 to 896 experts means individual experts shrink further and routing becomes finer, which demands deeper overlap between all-to-all communication and computation. It also explains why every major lab invests heavily in inference framework engineering.

    4.3 Load Balancing and Training Stability

    As expert counts increase, so does the risk of routing collapse. Common countermeasures include:

    • Auxiliary load-balancing losses, or auxiliary-loss-free dynamic bias adjustment;
    • Dual capacity-factor limits at both the expert and device level to prevent individual devices from overloading;
    • Smaller routing perturbations early in training, gradually annealed later.

    5. Numerical Formats: From BF16 to FP8 and Mixed Precision

    Numerical formats are among the most aggressively evolving dimensions of the past two years:

    • Training widely adopts mixed precision: weights and certain sensitive computations stay in BF16/FP32, while the bulk of matrix multiplications use FP8, with per-tensor or per-block scaling to maintain numerical stability.
    • Inference is even more aggressive: weights are commonly quantized to FP8, and in some scenarios further compressed to 4–6 bits. A model with 30B active parameters has roughly 30 GB of FP8 weights, deployable on one or two GPUs—this is the key to the economics of MoE inference.
    • KV cache quantization, linked to the long-context demands discussed earlier, has become a standard capability.

    For hardware, numerical format directly determines “how many FLOPs each byte of bandwidth can buy.” The adoption of FP8 essentially shifts bandwidth pressure onto on-chip compute density, which is why the new generation of accelerators universally strengthens low-precision compute (FP8 and even FP4).

    6. Convergence: Design Consensus Under Three Constraints

    Aggregating the dimensions above yields a mapping from “architectural change → hardware constraint”:

    Architectural Change Compute Memory Access Communication
    Fine-grained MoE experts ↓ active compute ↓ per-expert weights ↑ all-to-all
    GQA / KV compression — ↓↓ KV memory & bandwidth —
    Long context + sparse attention ↓ attention FLOPs ↓ KV storage —
    FP8 training & inference ↑ compute density demand ↓ weight traffic ↓ communication volume
    Deeper layers ↑ pipeline depth — ↑ pipeline communication

    As the table shows, none of these changes is an isolated aesthetic choice; all are responses to the same set of constraints. This also points to the likely direction of next-generation models:

    1. Moderate growth in active parameters, paired with even lower precision (FP4-level inference quantization), continuing to improve capability within the bandwidth budget;
    2. Further structured compression of the KV cache, making million-token context a default configuration;
    3. Continued refinement of expert granularity and deeper fusion of communication and computation, with inference frameworks and model architectures co-designed;
    4. A possible rebalancing of the attention-to-FFN ratio—as KV compression matures and the cost structure of attention layers changes, intra-layer proportions will be re-optimized.

    7. Conclusion

    The most important conclusion from surveying the architectures of today’s mainstream LLMs is this: beneath the diversity of structures lies the consistency of constraints. The widening gap between total and active parameters, the synchronized evolution of context length and KV cache, and the delicate balance between expert count and routing granularity are all engineering optima under the compute–memory–communication triangle. For teams working on model development and infrastructure planning, mastering this constraint-analysis framework is far more useful than chasing any specific configuration—it lets you predict, before the next generation of models is released, what they will most likely look like and how much headroom your compute planning should reserve.