Large Language Model Architectures and Parameter Scale Explained: Dense, MoE, and KV Cache Trade-offs
This article breaks down the three dimensions that actually shape large language model performance: architecture paradigm, parameter scale (total vs. activated), and context/KV cache strategy. It compares dense feed-forward and sparse Mixture-of-Experts designs, explains why total parameters can reach the trillions while activated parameters stay in the tens of billions, and shows how context windows expand to 1M while KV cache is aggressively compressed. You will also find a practical evaluation checklist and common misconceptions to avoid when selecting and deploying an LLM.
1. Introduction: Why Architecture and Parameter Scale Must Be Read Together
Judging a model by total parameter count alone, or by benchmark scores alone, is misleading. What really determines inference cost, GPU memory usage, and response latency is a combination of three dimensions: the network architecture paradigm, parameter scale (especially the relationship between total and activated parameters), and the context and caching strategy. The source material highlights three typical trends: total parameters growing from hundreds of billions to several trillions while activated parameters stay in the tens of billions; context windows expanding from 128K to 1M while KV cache is repeatedly compressed; and the number of experts rising from 256 to 896 while routing becomes finer-grained. The sections below follow these three threads.
2. Mainstream Architecture Paradigms: From Dense FFN to Sparse MoE
2.1 Dense Feed-Forward Architecture (Dense FFN)
The most classic implementation stacks attention layers and feed-forward network layers alternately, with every layer performing full computation over all parameters. Its strengths are a simple training and inference path, operator-friendly design, and mature quantization and parallelism strategies. Its weakness is that parameter growth is roughly linearly coupled with computation, making scaling expensive.
2.2 Sparse Mixture-of-Experts (Sparse MoE)
The mainstream approach for large-parameter models today replaces the feed-forward layer with multiple parallel expert subnetworks, and a routing network selects a few experts to participate in computation for each token. Its core value is decoupling parameter capacity from computation: total parameters can scale to the trillions, while each token still activates only tens of billions. It is important to stress that sparsity is not free: load imbalance from routing, communication overhead under expert parallelism, and the need to keep all expert weights resident in memory are all real costs.
Illustrative pseudocode (expressing the computation path only, not any specific implementation):
# Each token is routed independently; Top-K experts participatelogits = router(x) # [num_experts]topk = logits.topk(k) # k is far smaller than num_expertsweights = softmax(topk.values)y = sum(weights[i] * experts[topk.indices[i]](x) for i in range(k))
2.3 Combining Fine-Grained Experts with Shared Experts
Growing the expert count from hundreds to nearly a thousand means each expert is “narrower” and more specialized, and routing granularity is finer. A common industry practice is to make some experts always-active shared experts that carry general knowledge, while the rest are routable experts that carry differentiated capabilities. This design improves parameter utilization under the same activation budget, but it also places higher demands on the routing load-balancing strategy.
3. Parameter Scale: A Two-Layer Ledger of Total and Activated Parameters
When assessing scale, you should record at least four numbers: total parameters, activated parameters per token, number of layers, and the configuration of attention heads and hidden dimensions. The empirical reasoning is:
- Total parameters determine the upper bound of “knowledge capacity” and the cost of keeping weights resident in memory;
- Activated parameters determine the “computation per token,” which is strongly tied to latency and throughput;
- The more lopsided the ratio between the two, the more clearly the model follows a sparse route, and the more attention you must pay to the engineering complexity of expert parallelism.
So the combination of “hundreds of billions to trillions of total parameters plus tens of billions of activated parameters” is essentially about placing capacity in memory and keeping computation within a controllable range—trading engineering effort for results.
4. The Trade-off Between Context Expansion and KV Cache Compression
Expanding context from 128K to 1M may look like a victory of positional encoding and extrapolation training, but the real bottleneck is the cache. During autoregressive decoding, the key-value cache of historical tokens grows linearly with length, and under long context it quickly surpasses the weights themselves to become the main memory consumer. This produces the seemingly contradictory phenomenon of “larger window, yet more compressed cache.” Common techniques include:
- Multi-head key-value sharing, reducing the number of cached heads;
- Cache quantization, storing historical keys and values at lower bit widths;
- Sparse or chunked attention, keeping only key segments;
- Cache eviction and recomputation, trading compute for memory.
The engineering conclusion is that long-context capability must be evaluated together with the caching strategy; otherwise a paper window cannot translate into usable throughput.
5. Engineering Practice: How to Evaluate and Choose
It is advisable to validate with a consistent set of criteria rather than looking only at advertised parameters:
Evaluation checklist1. Record total parameters / activated parameters / number of layers / number of experts2. Fix input and output lengths; measure first-token latency and output tokens per second3. Gradually lengthen the context; observe the memory growth curve and the throughput inflection point4. Verify load balancing: whether the expert usage distribution is skewed over time5. Re-test accuracy and latency after quantization; confirm cache compression has not hurt long-text quality
On the deployment side, you can combine general cloud capabilities: use a container platform to host inference services and elastic scaling, use object storage to hold model weights and datasets, use logging and monitoring/alerting to track latency, memory, and error rates, and use a message queue to smooth out request spikes. For scenarios involving AI coding tools, long context and cache hit rate should be treated as core metrics.
6. Common Misconceptions
- Treating total parameters as the sole indicator of capability, ignoring activated parameters and data quality;
- Assuming sparse architectures are necessarily faster, ignoring expert-parallel communication and the cost of resident memory;
- Looking only at the maximum context number without testing actual throughput on long text;
- Ignoring routing load skew, which overloads some experts and causes overall latency jitter.
7. Conclusion
The architectural evolution of modern large language models can be summarized as “capacity moving up, computation pressed down, cache doing subtraction, and routing becoming finer.” Understanding these four main threads is what lets you make verifiable judgments during selection, deployment, and tuning, instead of being led by a single number.
