Understanding Modern LLM Architectures and Parameter Scale
This article breaks down how modern large language models are structured and sized, and why both factors matter for model selection. It covers the dense decoder-only baseline, sparse Mixture-of-Experts (MoE) designs, the distinction between total and activated parameters, attention and context-length strategies, and a practical breakdown of parameter scale tiers. Readers will also find deployment guidance on memory budgeting, quantization, parallelism, routing, and observability.
1. Why Architecture and Parameter Scale Come First
Before asking whether a model is “good,” engineers need to answer two more fundamental questions: how does it organize computation, and where does its parameter count sit in terms of magnitude? Architecture determines the shape of the computation graph, how GPU memory is consumed, how parallelism can be applied, and what inference latency looks like. Parameter scale drives training cost, the deployment threshold after quantization, and the throughput ceiling. Together, they form the coordinate system for model selection.
One point deserves emphasis: total parameter count is not the same as the compute actually activated per inference. Recent mainstream designs widely adopt a sparse approach that decouples “knowledge capacity” from “compute per token,” so looking at total parameters alone leads to wrong conclusions. The sections below first establish a general conceptual framework, then walk through it from the perspective of successive generations.
2. The General Architecture Baseline: From Dense Feed-Forward to Mixture-of-Experts
2.1 The Dense Baseline
The classic decoder-only architecture stacks a number of identical layers. Each layer contains two sub-blocks: a self-attention sub-block and a feed-forward sub-block, each with pre-normalization and a residual connection. Let the hidden dimension be d; the feed-forward intermediate dimension is typically 3–4 times d. The parameter count of a single layer is approximately:
Attn ≈ 4 * d^2 # Q/K/V/O projectionsFFN ≈ 2 * d * d_ff # up-projection and down-projectionLayer ≈ 4*d^2 + 2*d*d_ffTotal ≈ L * Layer + V * d # L layers, V vocabulary size
This formula is the starting point for estimating memory: at inference time, weight memory is roughly the parameter count multiplied by bytes per parameter (2 bytes for FP16, 1 byte for INT8), plus the KV cache.
2.2 Sparse Mixture-of-Experts (MoE)
The core idea of sparsification is to replace the feed-forward sub-block with N parallel “expert” feed-forward networks, then use a gating network to select the Top-K experts that participate in computation for each token. This introduces two key metrics:
- Total parameters: determine knowledge capacity and how much weight memory is occupied;
- Activated parameters: determine the floating-point operations and latency per token.
A common ratio in practice is total parameters being 3–10 times activated parameters. For example, a design with 600 billion total parameters and 40 billion activated parameters has compute requirements for training and inference close to a 40-billion-parameter dense model, but requires weight storage and multi-GPU sharding sized for 600 billion. In addition, load-balancing loss, expert-parallel communication, and the capacity factor are the three main challenges in putting MoE into production.
3. Evolving Strategies for Attention and Context
Another main thread of architectural evolution is reducing the quadratic complexity of attention and the pressure of the KV cache. Common approaches in the industry include:
- Grouped-query and multi-query variants of multi-head attention: let multiple query heads share a group of key/value heads, shrinking the KV cache by several times and significantly improving long-context throughput.
- Low-rank key/value compression: project keys and values into a low-dimensional latent space and cache the compressed representation, trading a small amount of extra compute for a large reduction in cache size.
- Sparse and sliding-window hybrids: local windows handle nearby dependencies, while a small number of global tokens aggregate long-range information.
- Position-encoding extrapolation: use frequency scaling, interpolation, or segmented strategies for rotary position embeddings to extend the training length to longer inference lengths.
Context length must be distinguished from “effective attention.” A nominal claim of very long context support does not mean retrieval and reasoning quality do not degrade on extremely long inputs; evaluation should rely on tasks such as multi-hop retrieval and long-document summarization.
4. Parameter Scale Tiers and What They Mean for Selection
By common industry convention, current mainstream models can be divided into four tiers, each suited to different scenarios:
- Small tier (roughly 1–10 billion): can run on a single GPU or even consumer devices, suitable for classification, extraction, intent recognition, and on-device completion.
- Mid tier (10–100 billion dense): deployable on a single machine with multiple GPUs, the mainstay range for general dialogue and business orchestration.
- Large sparse tier (100 billion–1 trillion total, tens of billions activated): requires multi-machine, multi-GPU setups with expert parallelism, suitable for complex reasoning and knowledge-intensive tasks.
- Extra-long-context variants: parameters unchanged, but cache and memory bandwidth become the bottleneck, requiring quantization and cache reuse.
For selection, it is recommended to estimate capacity using three factors — activated parameters, context length, and quantization bit width — rather than looking at total parameters alone.
5. A View of Successive Generations
From an engineering perspective, each generation of models typically advances along four axes: first, higher sparsity, with total parameters growing while activated parameters stay controlled; second, optimization of attention and cache structures to lower long-context costs; third, post-training optimization, including preference alignment, reinforcement learning with verifiable rewards, and reasoning-chain distillation; and fourth, product tiering, where a single generation spawns flagship, balanced, and lightweight versions aimed respectively at complex reasoning, general production, and high-concurrency low-latency scenarios.
A practical way to judge things is to put any new version into the same table: total parameters, activated parameters, number of layers, hidden dimension, attention variant, context length, and post-training method. Items you cannot fill in usually mean the vendor has not disclosed them; in that case, rely on hands-on measurement and avoid capacity planning based on speculation.
6. Practical Deployment Recommendations
- Memory budget: weights + KV cache + activation and fragmentation headroom; 20%–30% reserve is recommended.
- Quantization strategy: INT8/INT4 weight quantization can significantly lower the threshold, but note that sparse activated-parameter models are more sensitive to quantization error, so task-level regression testing is needed.
- Parallelism combination: use tensor parallelism for dense layers, expert parallelism for expert layers, and add sequence parallelism for long-context scenarios.
- Elasticity and cost: route requests to models of different sizes by input length tier, and combine batching with cache hits to noticeably reduce per-call cost.
- Observability: on container platforms and logging, monitoring, and alerting services, collect time-to-first-token, per-token latency, cache hit rate, and expert load skew as a basis for tuning.
7. Conclusion
Understanding modern large language models is not about memorizing the parameter numbers of a particular version, but about grasping the reasoning chain: architecture determines the shape of cost, activated parameters determine compute, and context strategy determines memory. Building evaluation and deployment pipelines on top of the general capabilities of cloud platforms such as Baidu AI Cloud (container platforms, object storage, logging services, monitoring and alerting), and using unified metrics to compare models across generations and sizes, is the sustainable engineering approach.
