Large Language Model Architecture Breakdown and Hardware Constraints Analysis
This article breaks down the network architecture of mainstream large language models and examines each design choice against hardware constraints. It introduces a five-layer analysis framework covering scale and layer configuration, attention structure, feed-forward and mixture-of-experts design, numerical formats, and hardware mapping, then uses three constraints—compute, memory bandwidth, and communication—as a unified frame. Readers will learn why total parameters keep growing while activated parameters stay flat, why context windows expand while KV Cache is compressed, and why expert counts rise as routing becomes finer, along with practical guidance for capacity planning.
1. Why Architecture Deserves Its Own Discussion
The Transformer architecture has been public for ten years, and its structural evolution has already been covered by authoritative surveys, so that history is not repeated here. Instead, this article takes current mainstream large language models as its subject, breaks down their network architectures one by one, and puts every change back into a hardware context.
The reason for this perspective is that changes across model families look scattered on the surface—some modify attention, some modify the feed-forward layer, some modify numerical formats—but at the hardware level they all point to the same set of constraints: compute, memory bandwidth, and communication. Using these three constraints as a unified coordinate system makes it possible to place seemingly unrelated design choices on the same chart for comparison.
A few long-standing tensions are worth keeping in mind first:
- Total parameters have grown from hundreds of B to several T, while the parameters actually activated per token have stayed in the tens of B range;
- Context windows have expanded from 128K to 1M, yet KV Cache has been compressed repeatedly;
- Expert counts have increased from 256 to 896, while routing granularity has become finer.
These three “reverse movements” are not accidental. They are the result of trade-offs between growing model capability and hardware cost. Mapping out their relationships helps indicate where the next generation of models is heading and leaves headroom for accelerator and cluster planning.
Convention: in this article, B and T denote billion and trillion parameters respectively; lengths are uniformly measured in tokens, without a plural suffix.
2. Analysis Framework: Five Layers and Three Constraints
To make the discussion in the following series comparable, a fixed breakdown order is established first. Every model is expanded along the same five layers:
- Scale and layer configuration: total parameters, activated parameters, number of layers, hidden dimension, vocabulary size;
- Attention structure: number of heads, head dimension, positional encoding scheme, KV Cache strategy;
- Feed-forward and mixture of experts: total experts, experts activated per token, shared experts, routing granularity;
- Numerical format: precision used for training and inference respectively, quantization granularity;
- Hardware mapping: which of compute, memory access, or communication the choices above ultimately land on.
The three corresponding constraints can be roughly written as the relationships below (illustrative, not measured formulas):
Compute per token ≈ activated parameters × constant factorKV Cache footprint ≈ layers × KV heads × head dimension × sequence length × bytes per valueCross-device traffic ≈ routing spread × activated experts × hidden dimension × bytes per value
These three expressions explain why “total parameters rise while activated parameters do not,” “context grows while cache shrinks,” and “more experts with finer routing” can hold at the same time: they are respectively compressing compute, compressing memory access, and compressing communication.
3. Attention: From Full KV to Compression and Sparsity
Attention is the main source of long-context cost. The approaches widely accepted in the industry fall into four categories:
- Reducing the number of KV heads (multi-query / grouped-query style), trading shared key-value heads for lower cache capacity;
- Low-rank or latent-vector compression of KV, pushing the cached representation of each token down to a lower dimension;
- Sparse and sliding-window attention, keeping only a local window plus a small number of global tokens;
- Linear or hybrid attention layers, replacing part of the softmax attention with state updates.
What is common in engineering is hybrid stacking: most layers use compressed full attention to guarantee a global information path, while a few layers use linear or sliding-window layers to lower total cost. Evaluating such designs cannot rely only on the nominal context length; it must look at the actual cache bytes and effective recall at a given length.
4. Mixture of Experts: Benefits and Costs of Sparsification
Sparse feed-forward layers are the main means of pushing total parameters to the T level today. There are four key design points:
- Routing granularity: finer experts with more experts activated per token usually favor specialization better than “fewer and coarser” experts;
- Shared experts: keeping a small number of always-active experts to carry general capability and reduce the routing burden;
- Load balancing: auxiliary-loss or lossless balancing strategies to avoid a few experts overheating and causing skew in communication and memory;
- Communication pattern: under expert parallelism, tokens must be rearranged across devices, and traffic rises with routing spread.
There is one easily overlooked conclusion here: the benefit of increasing the expert count can only be realized when communication and balancing are done well enough. Otherwise the added total parameters are merely memory occupancy, not effective capacity.
5. Numerical Formats: Precision as a Global Budget
Numerical formats affect memory, bandwidth, and throughput at the same time. A common practice is to train in lower precision with higher-precision accumulation and normalization, then apply per-layer sensitivity-based grouped quantization during inference. It is worth stressing that quantization granularity (per tensor, per channel, per group) often has a larger impact on accuracy loss than bit width itself, and that the benefit of quantizing KV Cache is most significant in long-context scenarios.
6. Common Patterns and Planning Recommendations
Looking at the structures across twelve series and twenty-five sections together, four patterns can be distilled:
- Decoupling capacity from activation: total parameters keep growing, while activated parameters per token are deliberately controlled, so inference cost stays manageable;
- Memory access first: long-context competition is essentially bandwidth competition, and cache compression takes priority over stacking compute;
- Communication becomes the new bottleneck: fine-grained expert routing shifts pressure from compute to interconnect;
- Structural convergence: designs from different sources converge strongly on compression, sparsity, and fine-grained routing.
For infrastructure planners, the recommendation is to reserve headroom separately according to “activated parameters determine compute, cache determines memory and bandwidth, routing spread determines interconnect,” rather than estimating everything uniformly from total parameters. For model developers, evaluating any new structure should return to these three constraints for a quantitative check before deciding whether to adopt it.
