How Modern LLM Architectures Balance Parameters, Context, and Expert Routing
A look at how modern large language models are shaped by three hardware constraints—compute, memory access, and communication. This article explains why total parameters keep growing while activated parameters stay stable, how KV Cache is compressed as context lengths reach 1M, why MoE routing is becoming finer-grained, and what these trends mean for model developers and infrastructure planners.
How Modern LLM Architectures Balance Parameters, Context, and Expert Routing
Why Look at Model Structure on Its Own
The Transformer architecture has been around for nearly a decade, and surveys of it are plentiful. But when you examine the technical reports of recent large language models, a pattern emerges: the structural changes may look scattered—some teams modify attention, others adjust routing, others stack more experts—but when mapped onto the hardware layer, almost all of them point to the same set of underlying constraints:
- Compute: how many FLOPs each forward pass actually consumes;
- Memory access: whether the read bandwidth for weights and the KV Cache can keep up with compute speed;
- Communication: the overhead of data exchange between devices in distributed parallelism.
Understanding these three constraints makes it possible to understand why model structures “look the way they do today,” and to predict where the next generation of models is heading. This matters especially for two audiences: engineers building or fine-tuning their own models, who need to make informed choices, and planners of compute platforms and accelerators, who need to budget headroom for future workload characteristics.
Total Parameters in the Trillions, Activated Parameters in the Tens of Billions: MoE Decoupling Goes Mainstream
Modern flagship models show a striking pattern: total parameters have grown from hundreds of billions to several trillion, but the activated parameters actually involved in computing each token have stayed stable at the tens-of-billions scale.
This is the triumph of the Mixture of Experts (MoE) architecture. The core idea is:
- Split the Transformer’s feed-forward layer (FFN) into N “expert” subnetworks;
- Each token is scored by a Router, which activates only the top-k highest-scoring experts;
- Total parameters ≈ N × parameters per expert, while per-token compute ≈ k × parameters per expert.
A representative configuration illustrates this decoupling:
Total parameters: 1.0TExperts per layer: 256 ~ 896Activated per token: 8 ~ 32 expertsActivated parameters: 30B ~ 60B
The engineering significance is that a model’s “knowledge capacity” is determined by total parameters, while inference “latency and compute cost” is determined by activated parameters. Once decoupled, capacity can keep growing without significantly raising the per-token inference cost.
But the cost shifts elsewhere:
- Memory pressure: even though only a few dozen experts are computed, all 1T parameters must reside in GPU memory, making weight-read bandwidth a bottleneck;
- Communication pressure: experts are typically distributed across devices, so tokens must be “routed” across devices to reach their assigned experts, and All-to-All communication volume rises with the number of experts.
That’s why recent structural optimizations across the industry focus heavily on “reducing routing communication,” “grouping experts locally,” and “load balancing”—a textbook example of hardware constraints driving back into structural design.
Context Length from 128K to 1M: KV Cache Gets Compressed, Not Expanded
Another seemingly contradictory trend: mainstream models now support context lengths from 128K up to the 1M range, yet the storage overhead of the KV Cache keeps being compressed, round after round.
The reason lies in the KV Cache size formula:
KV Cache ≈ layers × context length × KV heads × head dimension × 2 (K and V) × bytes per element
Every 10x increase in context length would, without structural changes, inflate the KV Cache by 10x as well—long-context inference would be directly “locked out” by memory capacity and bandwidth. Common compression approaches include:
- MQA / GQA: converting multi-head attention to multi-query or grouped-query attention, so multiple query heads share a set of KV heads, reducing KV head count to 1/4, 1/8, or even 1/64 of the query head count;
- MLA-style latent compression: projecting K and V into low-rank latent vectors, caching only the low-rank representation at inference time and projecting back up during computation, shrinking the KV Cache several times further;
- Sparse attention / sliding windows: selectively retaining historical tokens and caching only important positions;
- Quantized caches: storing the KV Cache in low-precision formats such as 8-bit or 4-bit.
From a hardware perspective, the conclusion is clear: in the long-context era, memory bandwidth is scarcer than compute. Architecture designers would rather do extra computation (such as low-rank up-projection) to trade for fewer memory reads. When planning accelerators, prioritize HBM capacity and bandwidth over simply stacking FLOPs.
Expert Counts from 256 to 896: Routing Gets Finer-Grained
A third notable trend is the routing mechanism itself. Early MoE models used fewer, larger experts; the recent direction is:
- Steadily increasing total expert counts (from the 256 range toward 800+);
- Making each individual expert smaller (fine-grained experts);
- Activating more experts per token accordingly;
- Widely adopting “shared experts”—a common expert that every token passes through, handling general capabilities, while fine-grained experts cover specialized knowledge.
Fine-grained routing offers a much larger combination space: the number of ways to choose k experts from N explodes as N grows, letting the model assemble more precise representations from finer “knowledge blocks.” Fine-grained designs also help load balancing—smaller experts make it easier to distribute tokens evenly, preventing hot experts from stalling the whole pipeline.
But fine granularity also amplifies the communication problem. Common engineering countermeasures include:
- Expert grouping with intra-group routing constraints: tokens are routed only to experts within a few device groups, limiting All-to-All communication to a local scope;
- Auxiliary losses or lossless balancing strategies: dynamically adjusting routing scores via bias terms so expert loads converge to uniform, without affecting the main gradient path;
- Pipelining and communication overlap: prefetching the next layer’s expert weights while computing the current layer, hiding communication latency.
Putting the Three Threads Together: A Unified Logic of Structural Evolution
Combining the three threads above yields a unified logic for modern LLM structural design:
| Trend | Surface Phenomenon | Underlying Hardware Constraint |
|---|---|---|
| Total params ↑, activated params unchanged | MoE decoupling | Compute cost kept in check, but memory capacity under pressure |
| Context ↑, KV Cache ↓ | Attention compression | Memory bandwidth becomes the long-context bottleneck |
| Expert count ↑, granularity ↓ | Fine-grained routing | Communication overhead must be tamed via grouping and balancing |
In other words, every structural change is essentially a reallocation of overhead among compute, memory access, and communication. None of these changes is a “pure algorithmic win”—they are all compromises with, and exploitations of, hardware reality.
Implications for Engineering Practice
Based on the analysis above, here are concrete suggestions for both audiences:
For model developers:
- When choosing a base model, don’t look only at total parameters—focus on activated parameters and KV Cache configuration, which determine inference cost;
- When fine-tuning MoE models, prefer freezing the router or using a low learning rate to avoid breaking load balancing;
- For long-context scenarios, prioritize models with latent compression or grouped attention structures.
For compute and platform planners:
- Configure inference clusters with “memory bandwidth first”: HBM capacity should at least cover full parameters plus peak KV Cache;
- Interconnect topology for training/inference nodes should match the expert grouping strategy—high bandwidth within groups, relaxed between groups;
- When budgeting headroom for the next generation of models, assume total parameters keep doubling, KV Cache keeps shrinking, and communication patterns keep getting more complex—all three at once.
When deploying large model inference and training in the cloud, you can build a complete pipeline using general-purpose cloud capabilities: object storage for model weights and training data, container platforms to orchestrate inference services with elastic scaling for traffic fluctuations, and logging and monitoring systems to track metrics like inference latency and memory usage. Many cloud providers offer product categories covering storage, compute, networking, and monitoring that can serve as reference options for building this infrastructure.
Conclusion
A decade after the Transformer’s introduction, LLM architecture hasn’t been overturned—instead, it has been finely polished under the triangular constraints of “compute–memory–communication”: MoE decouples capacity from cost, attention compression buys long context, and fine-grained routing pushes toward the limits of expressiveness. Understanding the hardware logic behind these trade-offs is more valuable than memorizing any single model’s configuration numbers—because the numbers will change, but the constraints won’t.
