Modern LLM Architecture Evolution: MoE, KV Cache Compression, and Parameter Scale
This article reviews how mainstream large language model architectures have evolved and what drives those changes. It covers the separation of total and active parameters in Mixture-of-Experts models, the shift from MHA to MLA for KV cache compression, the engineering behind longer context windows, low-precision number formats, and the hardware and infrastructure implications for compute planning.
Modern LLM Architecture Evolution: MoE, KV Cache Compression, and Parameter Scale Analysis
Introduction: Why Architecture Deserves Its Own Discussion
Since the self-attention mechanism became the core of sequence modeling, large language model (LLM) architectures have accumulated a large body of engineering practice. On the surface, the changes that model developers publish look scattered. Some add more experts, some compress the key-value cache, some move normalization layers, and some introduce new positional encodings. Viewed through the lens of hardware constraints, however, these changes point to the same underlying tension: compute, memory access, and communication.
Understanding a model’s architecture is less about memorizing its layer count and dimensions than about understanding the trade-offs its designers made when facing this tension. This article does not focus on any specific vendor’s product. Instead, it takes a general technical view and summarizes the shared architectural patterns, parameter scale characteristics, and evolutionary trends of current mainstream models.
1. Separating Total and Active Parameters: MoE Becomes Mainstream
The most prominent structural feature of today’s large models is the decoupling of total parameter count from the number of parameters activated during a single inference pass.
1.1 The Basic Logic of Mixture-of-Experts
The Mixture-of-Experts (MoE) architecture replaces the feed-forward network (FFN) with multiple parallel “expert” subnetworks. Each token is routed to only a small subset of these experts. This greatly increases model capacity without significantly increasing the compute required per token.
The overall industry trends are:
- Total parameters: growing from hundreds of billions to trillions;
- Active parameters: stable for a long time at tens of billions, which keeps the compute per token under control;
- Number of experts: growing from one or two hundred in early designs to several hundred, and in some cases close to a thousand;
- Routing granularity: becoming finer. Early designs selected two experts per token. Newer designs select from hundreds of experts, activating anywhere from a handful to more than ten, and often add shared experts to keep general knowledge expressed consistently.
1.2 The Hardware Implications of Fine-Grained Routing
Finer routing has two direct consequences. First, load balancing across experts becomes harder. Designers need mechanisms such as auxiliary-loss-free bias adjustment and sequence-level balancing constraints to prevent a few experts from being overloaded while most sit idle. Second, in distributed deployments, the communication pattern of Expert Parallelism becomes more complex. Tokens must be dispatched to experts on different devices and then gathered back, which places heavy demands on cluster interconnect bandwidth and topology.
This is why All-to-All communication optimization has become a core problem for MoE training and inference frameworks. When planning compute infrastructure, teams cannot look only at the peak compute of accelerators. They also need to assess whether intra-node and inter-node interconnects match the model’s expert distribution strategy.
2. The Evolution of Attention: A Compression Race Around the KV Cache
2.1 From MHA to MLA: A Clear Path of Compression
Early models used multi-head attention (MHA), which stores a full key (K) and value (V) vector for every token in every layer. As context length grew from 4K to 128K and even 1M tokens, the memory footprint of the KV cache became the primary bottleneck for long-context inference. With dozens of layers and thousands of hidden dimensions per layer, a context of one million tokens can easily push the KV cache past hundreds of gigabytes.
The industry’s compression path has roughly passed through several stages:
- Multi-query attention (MQA): All query heads share a single set of K/V. This is the most aggressive compression, but it causes noticeable quality loss.
- Grouped-query attention (GQA): Query heads are divided into groups that share K/V. It is a compromise between quality and overhead and is widely used.
- Latent attention (MLA-style approaches): K/V are projected into low-rank latent vectors, and only the latent representation is cached during inference. This can substantially reduce cache size while staying close to MHA quality.
An interesting pattern emerges: context windows keep growing, while the cache per token keeps being compressed. This suggests that the competition for long context is less about whether a model can support it and more about the cost of supporting it.
2.2 Sparse and Linear Attention
Another route is to reduce the range over which attention is computed:
- Sliding window attention: Each token attends only to nearby tokens, with a small number of global layers maintaining long-range dependencies.
- Native sparse attention: A learnable mechanism selects relevant token blocks, reducing the complexity of long sequences from quadratic to a lower order.
- Linear attention and state space hybrid architectures: These process long sequences with a constant-size state, and some models use them in place of attention in certain layers.
The shared goal of these approaches is to change the inference cost of long contexts from growing quadratically with length to growing close to linearly.
3. Context Length: The Systems Engineering Behind 128K to 1M
Extending the context window is not simply a matter of enlarging the range of positional encodings. It is a systems engineering effort that involves:
- Extrapolation and interpolation of positional encodings: Rotary positional encoding (RoPE) supports lengths beyond the training range through techniques such as frequency scaling and dynamic interpolation.
- Long-context training data mixture: Models need a sufficient proportion of long documents and long-dependency tasks during pre-training or post-training. Without them, the window is only nominally supported.
- Cache management during inference: Techniques such as paged KV cache management, prefix cache reuse, and hierarchical offloading determine throughput and latency for long contexts under real workloads.
For users, evaluating long-context ability requires separating the nominal window from the effective window, meaning the distance over which a model can still retrieve information and reason accurately. The industry often measures this with needle-in-a-haystack tests and long-document comprehension benchmarks.
4. Numerical Formats: From FP16 to FP8 and Beyond
4.1 Pushing Training Precision Lower
Mixed-precision training is now standard, but precision keeps going lower. The move from FP16 or BF16 to FP8 has already happened, and some exploratory work has pushed toward FP4. The main difficulty in low-precision training is gradient instability caused by limited dynamic range. Common remedies include:
- Fine-grained scaling factor management for activations, applied per block or per channel;
- Keeping high-precision copies of critical components, such as master weights and optimizer states;
- Using higher-precision accumulators during matrix multiplication and accumulation.
4.2 Trade-Offs in Inference Quantization
On the inference side, quantizing weights to 8 bits or even 4 bits is now routine. Quantization matters especially for MoE models. Because total parameters are very large while active parameters are small, MoE inference is a typical memory-bound workload, where loading weights often becomes the bottleneck before computation does. Lower-bit weights directly reduce memory traffic, so quantization gains are particularly significant for MoE.
5. Other Structural Trends Worth Watching
5.1 Normalization and Residual Connection Details
- Normalization placement: Pre-Norm has become the dominant choice. Some models add extra normalization at the attention or expert outputs to stabilize deep training.
- Normalization type: RMSNorm is widely adopted because it skips the mean computation and is more memory-friendly.
- Depth and width: Mainstream configurations range from several dozen to over a hundred layers, with hidden dimensions from a few thousand to tens of thousands. Both deep-and-narrow and shallow-and-wide designs have their supporters.
5.2 Vocabulary and Embeddings
Vocabulary sizes have grown from tens of thousands to hundreds of thousands of tokens or more. Larger vocabularies cover multiple languages and code better and shorten sequences. The cost is that embedding and output projection layers take up a larger share of total parameters, which is especially noticeable in small models.
5.3 Unified Multimodal Modeling
More models attach encoders for vision, audio, and other modalities to a shared backbone, using projection layers to align them into a unified representation space. Typically the language backbone stays unchanged, and new modalities are added through adapters so that existing language capabilities are not degraded.
6. Implications for Hardware and Infrastructure
Based on these trends, several principles can guide compute planning:
- Evaluate compute and memory separately: For MoE models, total parameters determine the memory capacity required, and active parameters determine the compute required. The two must be estimated independently.
- Interconnect bandwidth matters more: Fine-grained expert routing makes communication a much larger share of total cost, so interconnect capability should receive higher priority during cluster selection.
- Focus inference optimization on memory access: KV cache compression, weight quantization, and continuous batching are the three main levers for controlling inference cost.
- Elasticity and engineering capability: In real deployments, building elastic inference services on general cloud infrastructure, such as container platforms, object storage, and monitoring and alerting, has become standard practice. For example, storing model weights in high-performance object storage and loading them on demand, combined with container orchestration that scales with traffic, can significantly reduce the resource fluctuation costs that come with long contexts and sparse activation.
Conclusion
An old Chinese saying goes: only after hearing a thousand songs can one truly understand sound, and only after seeing a thousand swords can one recognize a good blade. The evolution of LLM architectures looks complicated, but three main threads drive it: compute, memory access, and communication. Total parameters are climbing toward trillions while active parameters stay restrained. Context windows are reaching one million tokens while caches are repeatedly compressed. Expert counts are approaching a thousand while routing grows finer. By keeping these three tensions in view, engineers can quickly judge what a new architecture solves, what it costs, and how much headroom to leave when selecting models and planning infrastructure.
