Modern LLM Architecture Breakdown and Parameter Scale Explained
This article breaks down modern large language model architecture through three hardware-driven constraints: compute, memory bandwidth, and interconnect communication. It clarifies the difference between total and activated parameters, explains why attention design is shifting from expanding context windows to compressing the KV cache, examines the communication costs of finer-grained mixture-of-experts routing, and covers numerical precision choices for training stability. A reusable evaluation checklist is included for comparing new models and planning capacity.
1. Why Architecture Deserves Its Own Discussion
Ten years after the Transformer was introduced, architectural changes have already been covered by numerous surveys. What is worth revisiting is not “which new module appeared,” but the fact that seemingly scattered changes across model families converge on the same set of hardware constraints: compute, memory bandwidth, and interconnect communication. Put these three rulers on the table, and the past two years of model evolution reveal three clear lines of tension:
- Total parameters have grown from hundreds of billions to trillions, while activated parameters per token have stayed in the tens of billions.
- Context windows have expanded from 128K to 1M, yet the KV cache has been compressed repeatedly.
- Expert counts have risen from 256 to 896 or more, while routing granularity keeps getting finer.
These three lines are not independent; they are simultaneous solutions under the same constraint. Understanding their relationships is more valuable than memorizing the layer count of any particular model.
2. Two Ways to Measure Parameter Scale: Total vs. Activated
When discussing “how large the parameter count is,” two measures must be distinguished, or the conclusions become completely opposite.
- Total parameters: determine the footprint of weights in storage, loading time, and how the model is sharded across devices.
- Activated parameters: determine the floating-point operations and memory access per token in the forward pass, which directly govern throughput and latency.
Sparsification is the root cause of these two curves separating. A model with a total of T parameters that activates only tens of billions per token has a compute cost on the same order as a dense model of tens of billions of parameters, but its memory footprint and communication pressure are significantly higher. This leads to a practical rule of thumb: dense models optimize compute utilization; sparse models optimize memory access and interconnect topology.
An illustrative scale calculation can be written as:
# For illustration of the two measures only; not the parameters of any specific productdef rough_cost(total_params, activated_params, bytes_per_param=2):weight_bytes = total_params * bytes_per_param # weight footprintflops_per_token = 2 * activated_params # forward pass ~2 FLOPs/param/tokenreturn weight_bytes, flops_per_token
3. Attention: From Expanding the Window to Compressing the Cache
As context grows from 128K toward 1M, intuition suggests the KV cache should grow linearly, but engineering practice does the opposite. The reason is that the bottleneck in attention has never been compute but memory access: during decoding, every generated token requires rereading the entire history cache, so the bandwidth wall arrives first.
The techniques widely used in the industry fall into four categories:
- Multi-head sharing and low-rank projection: let multiple query heads reuse the same set of keys and values, compressing cache size in proportion to the number of heads.
- Sparse and sliding-window attention: keep only a local window plus a few global anchors, reducing complexity from quadratic to near-linear.
- Cache quantization and tiered offloading: store history caches at lower numerical precision, pushing cold data down to host memory or external storage.
- Linear/hybrid attention layers: replace explicit history rereading with state updates, turning long-sequence cost into a constant.
Engineering takeaway: window length is a product metric, while cache size is a deployment metric, and the two must be evaluated separately.
4. Mixture of Experts: Finer Routing, Pricier Communication
Growing experts from 256 to 896 shows that capacity growth comes mainly from “stacking experts” rather than “stacking depth.” But fine-grained routing brings two side effects:
- Load imbalance: a few popular experts become hotspots, leaving some devices idle.
- Communication amplification: tokens must be gathered and scattered across devices, making All-to-All the dominant cost.
Common mitigations include capacity factors and dropping strategies, shared experts that carry general knowledge, and jointly optimizing routing decisions with device mapping. Whether a sparse structure is “worth it” comes down to the increase in effective activated parameters gained per unit of communication.
5. Numerical Formats and Training Stability
Low precision is the standard answer for easing both compute and memory access at once, but different stages differ in precision sensitivity. The usual division of labor: matrix multiplications use low precision for throughput, reductions and normalization keep higher precision to stabilize numerical ranges, and optimizer states use even lower precision to compress memory. Fine-grained scaling (maintaining scale factors per block or per channel) is the key engineering detail for controlling outliers.
6. A Unified Evaluation Checklist
For any new model, the following order of breakdown yields comparable conclusions within half an hour:
- Layer configuration: hidden dimension, number of layers, vocabulary size.
- Attention shape and cache strategy; estimate cache bytes per token.
- Total experts, activated experts per token, and the share of shared experts.
- Numerical format and scaling granularity.
- Memory, bandwidth, and interconnect requirements derived from items 1–4.
The value of this checklist is that it transfers: whatever the new release from any vendor, you can quickly answer “where the cost is, where the bottleneck is, and what to add first when scaling out.” In practice on platforms such as Baidu AI Cloud, combining these metrics with general capabilities like container platforms, logging services, and monitoring and alerting forms a closed loop from architecture evaluation to capacity planning, providing a quantitative basis for reserving resources for next-generation accelerators.
Only after practicing a thousand tunes can you understand sound; only after examining a thousand swords can you recognize a weapon. Comparing architectures is not about quantity, but about whether the comparison lands on the same set of hardware constraints.
