Large Language Model Architecture and Parameter Scale Explained
This article breaks down the structure of modern large language models across twelve mainstream model families, focusing on parameter scale, attention mechanisms, mixture-of-experts routing, numerical formats, and hardware constraints. It explains why total parameters keep growing while activated parameters stay flat, how long-context designs compress the KV cache, and what these trade-offs mean for compute, memory bandwidth, and interconnect planning. Developers will find practical guidance on sizing models by bottleneck and estimating cost from activated parameters.
1. Why Architecture Deserves Its Own Discussion
Ten years after the Transformer was introduced, the structure has gone through several rounds of revision, and those revisions have been summarized many times. What is worth revisiting is not the way a particular module is written, but the shared set of hardware constraints behind every vendor’s changes: compute, memory bandwidth, and interconnect communication.
Laying today’s mainstream large language models side by side reveals three trends happening almost in sync:
- Total parameters have climbed from hundreds of B (billion) to several T (trillion), while the number of parameters activated in a single forward pass has stayed in the tens of B range;
- Context windows have expanded from 128K to 1M tokens, yet the KV Cache has been compressed again and again;
- The number of experts has grown from 256 to nearly a thousand, while routing granularity keeps getting finer.
These three trends look unrelated, but all of them trade “model capacity” against “cost per token.” Sorting out the trade-offs between them is what makes it possible to anticipate the next generation of models and leave headroom for accelerator and cluster planning. This article uses twelve mainstream model families as samples and breaks them down in a consistent order: scale and layer configuration → attention → mixture of experts → numerical format → hardware constraints.
2. Parameter Scale: Total Growth, Activation Convergence
Modern large models generally follow a sparse activation path that decouples “knowledge capacity” from “compute”:
- Total parameters set the knowledge ceiling and mainly consume GPU memory and storage;
- Activated parameters determine the number of multiply-accumulate operations per token and therefore drive compute demand;
- KV Cache determines memory access pressure under long context and is the real bottleneck during inference.
An illustrative breakdown of scale tiers (common industry ranges, not specific product figures):
Dense models: total ≈ activated, roughly 7B ~ 70BSparse models: total 200B ~ 1T+, activated roughly 20B ~ 60BLong context: native window 128K ~ 1M tokens
This leads to an important conclusion: growth in total parameters mainly consumes memory capacity, while growth in activated parameters consumes compute. That is why the usual scaling path is “add experts, add layers” rather than making every layer wider.
3. Three Directions for Reworking Attention
The core tension in long context is that attention complexity grows with the square of sequence length, while the KV Cache grows linearly with length. Mainstream approaches fall into three categories.
1) Compress the representation dimension of the KV. A low-rank projection squeezes key/value into a smaller latent space, which sharply reduces cache size while preserving approximate multi-head expressiveness.
2) Sparse and block attention. Global attention is split into “a local window plus a few global tokens,” bringing complexity down from quadratic to nearly linear.
3) Linear or hybrid attention layers. Some layers replace softmax attention with state-space or linear recurrence, keeping only a few layers for global interaction.
What is common in engineering is hybrid stacking, for example inserting one global attention layer every three to four layers:
# Structure sketch: hybrid attention layer stackingfor layer_idx in range(num_layers):if layer_idx % 4 == 0:attn = GlobalAttention(n_heads=heads, dim=d_model)else:attn = LocalWindowAttention(window=4096, dim=d_model)blocks.append(TransformerBlock(attn, ffn=MoE(num_experts=E, top_k=k)))
4. Mixture of Experts: Finer Routing, Cheaper Compute
The key to sparsification is not “more experts” but finer routing granularity. The current common practice is fine-grained expert splitting paired with shared experts that carry general capability:
- Each expert is narrower, so a single token activates more experts while total compute stays controlled;
- Shared experts are always active, which stabilizes training;
- A load-balancing loss together with a capacity factor constrains the routing distribution and avoids hot-spot experts.
One point deserves emphasis: expert parallelism pushes communication from “inside the card” to “between cards,” and All-to-All traffic rises with the number of experts and the parallel degree. This is often the real ceiling on training efficiency.
5. Numerical Formats and Hardware Constraints
Low precision is the main lever for reducing memory footprint and raising throughput at the same time. A common combination is low-precision floating point on the compute path, higher precision or block-wise quantization for weights and optimizer states, and low-bit storage for the KV Cache. On granularity, per-tensor scaling is gradually being replaced by per-block or per-channel scaling to balance stability and compression ratio.
The resulting hardware requirements are clear:
| Dimension | Source of pressure | Planning focus |
|---|---|---|
| Compute | Activated parameters and sequence length | Watch multiply-accumulate volume per token |
| Memory capacity | Total parameters + optimizer states | Sparsification cuts cost significantly |
| Memory bandwidth | Repeated KV Cache reads | Compression and low-bit caching pay off most |
| Interconnect | Expert parallelism All-to-All | High-speed fabric and topology design |
6. Practical Advice for Developers
- Choose by bottleneck: for long-context inference, look first at bandwidth and cache compression; for training, look first at interconnect and compute.
- Estimate cost from activated parameters: total parameters tell you capacity, activated parameters tell you unit cost, and the two should not be mixed.
- Benchmark against real distributions: routing hot spots and long-tail inputs are usually the true test of performance and stability.
- Build observability first: use monitoring and alerting, logging services, and container platforms to establish end-to-end metrics before tuning.
The direction of architectural evolution is fairly clear: capacity keeps expanding, cost per token keeps falling, and every innovation ultimately has to be paid for out of the same three accounts: compute, memory access, and communication.
