Modern LLM Architecture Evolution and Parameter Scaling: MoE, Long Context, and KV Cache Trade-offs
This article examines how modern large language models have evolved from dense Transformers to sparse Mixture-of-Experts architectures, and how total versus active parameters shape capacity and inference cost. It also covers finer-grained expert routing, long-context expansion versus KV cache compression, converged component choices, practical methods for estimating model scale and inference economics, and likely architecture trends for the next generation.
Modern LLM Architecture Evolution and Parameter Scaling
Nearly a decade after the introduction of self-attention, the structural design of large language models has undergone a profound shift—from “more layers and wider dimensions” to “sparsity and finer granularity.” Total parameter counts of mainstream models have expanded from hundreds of billions (B) to several trillion (T), yet the number of parameters actually activated in a single forward pass has remained stable in the tens of billions. Context windows have grown from 128K to 1M tokens, while the GPU memory footprint of the KV cache has been repeatedly compressed. The number of experts has increased from 256 to 896 or more, even as routing granularity becomes finer. Understanding the engineering logic behind these seemingly contradictory trade-offs is essential for judging the direction of next-generation models and planning inference compute. This article systematically breaks down the architecture and scale trade-offs of modern large models.
1. From Dense to Sparse: MoE Becomes Mainstream
Early large language models generally used a dense Transformer structure: every token activates all parameters during forward propagation. Dense models offer predictable training and inference behavior, but the cost is a strict linear relationship between parameter count and computation—stronger capabilities require proportionally higher compute cost.
Mixture of Experts (MoE) breaks this coupling. The core idea is to replace the feed-forward network (FFN) with multiple parallel “expert” subnetworks, and each token selects only a small number of experts through a gating router. This produces two key concepts:
- Total parameters: the full set of weights stored by the model, which determines the model capacity ceiling and storage/GPU memory requirements.
- Active parameters: the number of parameters actually involved in computation for a single token during forward propagation, which determines the compute cost (FLOPs) of a single inference step.
A typical configuration among current flagship models is a total parameter count between hundreds of billions and several trillion, with per-token active parameters maintained in the 20B–60B range. This means the model can “read widely” without paying full computation for every token. For example, with 1T total parameters and 40B active parameters, the sparse activation ratio is about 4%. Inference cost is roughly comparable to a dense model in the 40B class, while knowledge capacity approaches that of a 1T dense model.
2. The Trend Toward Finer Expert Routing
Another notable evolution of MoE architecture is finer routing granularity. Early MoE models typically used 8 to 64 experts and selected Top-2 per token. Newer models commonly expand to 256 or even 896 experts and introduce more detailed designs:
- Fine-grained expert splitting: Large expert FFNs are split into more small experts, enabling exponential growth in how knowledge can be combined across experts and improving model expressiveness.
- Shared experts: One or more always-active shared experts carry general knowledge, while routed experts focus on differentiated capabilities, alleviating knowledge redundancy.
- Load-balancing optimization: Routing tends to concentrate tokens on a few “popular” experts, leaving other experts undertrained. The industry commonly uses auxiliary-loss-free bias adjustment, sequence-level balancing constraints, and similar methods to keep expert utilization balanced and avoid training collapse.
For engineering teams, the growth in expert count directly affects deployment. Experts can be partitioned across devices through expert parallelism, but routing communication increases accordingly, placing higher demands on inter-node interconnect bandwidth.
3. Longer Context, Smaller KV Cache
Long context has been a major focus of competition over the past two years. Mainstream context windows have expanded from 128K to 256K and even 1M tokens. However, the longer the context, the larger the KV cache footprint for storing key-value pairs per token during inference, directly consuming GPU memory and limiting concurrent throughput. For a 60-layer model with a large hidden dimension, the KV cache for a 1M-token context may reach hundreds of GB, far exceeding the model weights themselves.
The industry response has been continuous KV cache compression. Major technical routes include:
- Grouped-Query Attention (GQA): Multiple query heads share a group of key-value heads, reducing the number of KV heads severalfold and lowering cache usage proportionally. It has become the default configuration for current open-source and commercial models.
- Multi-Query Attention (MQA): All query heads share a single KV head, achieving more aggressive compression but with some impact on model quality.
- Low-rank compression attention (such as latent-variable KV compression): Keys and values are projected into a low-rank latent space for storage and decompressed during inference, compressing the cache by more than an order of magnitude under 1M-level contexts.
- Sliding-window and sparse attention: Each token attends only to a local window or selected key tokens, trading some global information for linear complexity.
This creates a typical trade-off in contemporary models: contexts keep getting longer, while the cache cost per token must keep getting lower. To evaluate the inference economics of a long-context model, it is not enough to look only at window length; the cache compression rate of its attention variant also matters.
4. Converged Choices for Other Key Components
Beyond MoE and attention mechanisms, modern large models have gradually converged on a set of de facto standards for other components:
- Normalization: RMSNorm is widely used instead of LayerNorm, eliminating mean computation and reducing overhead. Pre-Norm is commonly used for normalization placement to ensure deep-training stability.
- Positional encoding: Rotary Position Embedding (RoPE) has become mainstream, supported by extrapolation techniques such as position interpolation, NTK scaling, and base-frequency adjustment for ultra-long contexts.
- Activation functions: SwiGLU and its variants have replaced GELU, providing stronger nonlinear expression in the FFN.
- Tokenizers: Vocabulary sizes have expanded from 32K to 100K–160K or more, improving compression for multilingual and code scenarios and reducing sequence length and computation.
- Training frameworks: Multidimensional combinations of data parallelism, tensor parallelism, pipeline parallelism, and expert parallelism have become standard. Training trillion-parameter models typically requires clusters of thousands of GPUs and fine-grained communication scheduling.
5. How to Evaluate Model Scale and Inference Cost
When faced with marketing language such as “X B/T total parameters and Y B active parameters,” developers can follow these methods to make rational judgments:
- Use active parameters to estimate compute: Inference FLOPs per token are approximately twice the active parameter count for forward computation. This provides a rough estimate of the compute consumption of a single request.
- Use total parameters to estimate memory: Weight memory ≈ total parameters × bytes per parameter (2 bytes for FP16, 1 byte for INT8, and lower for FP8/INT4), plus KV cache and activation intermediates.
- Use attention variants to estimate long-context cost: Confirm the number of GQA groups or the low-rank compression dimension, then estimate peak KV cache at the target context length.
- Use expert parallelism to estimate deployment topology: More experts and finer routing mean more frequent cross-GPU communication and higher requirements for cluster interconnect bandwidth.
For cloud deployment, general infrastructure capabilities such as container platforms, object storage, monitoring and alerting, and logging services can be combined to build elastic inference services: weights are stored in high-throughput storage, inference instances automatically scale with traffic, and metrics such as KV cache hit rate, first-token latency, and throughput are brought into unified monitoring to form a complete cost observability system. Major cloud platforms such as Baidu AI Cloud provide this kind of general infrastructure that can host privately deployed LLM inference workloads.
6. Outlook
Taken together, the next generation of large-model architecture is likely to evolve in three directions. First, sparsity will continue to increase: total parameters will move toward several trillion while active parameters remain restrained, making “large capacity, small computation” the norm. Second, attention mechanisms will continue to evolve toward cache friendliness, and the inference cost of contexts above 1M tokens may drop by another order of magnitude. Third, routing and modular design will become more refined, and models may move from “one model serving all tasks” toward “dynamically composed expert systems.” For infrastructure planners, the key implication is that compute demand will grow more slowly than parameter counts, but pressure on memory capacity and interconnect bandwidth will continue to rise. Reserve capacity should prioritize the latter two.
Understanding the divergence between total and active parameters, the tension between context and cache, and the trade-off between expert scale and routing granularity provides the key to reading contemporary large-model technical reports—and a solid framework for model selection and compute planning.
