Decoder-Only LLM Architecture Evolution: A Deep Technical Breakdown
This article examines how decoder-only large language models have evolved: the Transformer foundation they all share, the component-level changes behind their rapid capability gains (RMSNorm, gated activations, RoPE, GQA), two easily overlooked attention details (attention bias and attention sinks), the depth-versus-width trade-off and MoE, and the low-precision quantization and microscaling techniques such as MXFP4 that make large models practical to deploy. It closes with transferable engineering lessons for model selection, training, and serving.
A Contradiction Worth Explaining
Since self-attention-based decoder-only models became mainstream, their top-level skeleton has barely changed: stacked Transformer blocks, autoregressive next-token prediction, residual connections, and normalization layers are all still in place. That does not mean the technology has stalled. Quite the opposite — what really determines model capability is the fine-grained design inside these components, together with the data mixture and training algorithms. In other words, the “macro structure” of the architecture is converging while the “micro details” are still iterating quickly. Understanding that evolution is key to grasping large-model engineering practice.
The Shared Foundation: The Decoder-Only Transformer
Every generation starts from the Transformer introduced in 2017. The original design contained both an encoder and a decoder, but researchers soon found that for autoregressive language modeling, keeping only the decoder branch offers better scalability and training stability. As a result, nearly all mainstream large language models adopt this paradigm today.
A standard Transformer block usually contains two sublayers:
- Self-attention sublayer: lets each position in the sequence aggregate global information and decide “who to attend to”;
- Feed-forward network (FFN) sublayer: applies an independent non-linear transformation to each position, in charge of “refining features”.
Each sublayer is wrapped in a residual connection and a normalization layer, so gradients propagate stably when blocks are stacked deeply. This structure has been carried over since its introduction and remains the starting point for all the optimizations that followed.
Component-Level Evolution
If you unpack the architecture layer by layer, you will notice that nearly every model generation replaces or improves a key component. That is the secret behind “the architecture stays the same, the capability multiplies”.
1. Normalization: from LayerNorm to RMSNorm
Classic LayerNorm computes both the mean and the variance, then scales and shifts. RMSNorm, proposed later, scales based only on the root mean square and drops the mean-centering step. It is cheaper to compute and more numerically stable, and it has become the mainstream choice. Normalization looks basic, yet it directly affects how fast deep models converge.
2. Activation functions: from ReLU/GELU to gated linear units
The activation function inside the FFN moved from ReLU to GELU, and then evolved into gated structures such as SwiGLU. These introduce a learnable “gate” that modulates the information flow, and typically deliver better results at the same effective parameter count. The trade-off is that the parameter structure inside the FFN changes, so the width ratio has to be rebalanced.
3. Position encoding: from absolute positions to rotary position embeddings
Early models used learned or sinusoidal absolute position encodings. Today, rotary position embeddings (RoPE) rotate the query and key vectors, folding relative position information into the attention computation. They naturally support longer-context extrapolation and are a key building block for long-context models.
4. Attention variants: from MHA to GQA
Standard multi-head attention (MHA) keeps a separate key/value projection for every head, which is expensive in memory. Grouped-query attention (GQA) lets multiple query heads share one group of keys and values, substantially reducing memory-bandwidth pressure during inference; in the extreme case it degenerates further into multi-query attention. For long-context deployment, the cost impact of this change is especially direct.
Hidden Details of Attention: Bias and Attention Sinks
Behind attention computations that look identical, two easily overlooked details matter a great deal:
Attention bias. Adding a learnable bias term before or after the softmax adjusts the relative attention strength across positions and heads, which in turn affects the model’s ability to focus locally and its overall stability.
Attention sinks. Research shows that when sequences get long, models tend to allocate a large share of attention to a handful of tokens at the very beginning of the sequence — usually a separator or the start marker. These positions act like attention “spillways”, where the model can dump irrelevant information. This finding has far-reaching implications for inference engineering: if you aggressively slide the window to save memory and discard the earliest tokens, you actually damage model stability. Those attention-sink positions therefore need to be preserved, or compensated for with a dedicated mechanism.
The Width vs. Depth Trade-Off
Given the same compute budget, should a model be deeper (more layers) or wider (a larger hidden dimension per layer)? This is a classic architectural trade-off:
- Deeper: better for expressing hierarchical abstractions and reasoning chains, but it brings gradient-propagation and parallelism-efficiency problems;
- Wider: better expressiveness per layer, but compute and memory costs rise faster.
One important answer in recent years is the mixture of experts (MoE): the FFN is replaced by multiple parallel “experts”, and each token activates only a few of them. Total parameter count — width in the capacity sense — grows substantially, while the number of parameters activated per step stays manageable, balancing capacity against cost. It also explains a common misconception: a very large total parameter count does not necessarily mean expensive inference.
Making It Deployable: Low-Precision Quantization and Microscaling
No matter how elegant an architecture is, it is worthless if it cannot be deployed efficiently. With parameter counts easily in the tens of billions, memory and bandwidth quickly become the bottleneck, so low-precision quantization is an engineering necessity. The mainstream approach lowers the bit width of the numeric representation step by step:
- FP16/BF16: the baseline precision for training and inference;
- INT8/FP8: approximates the original precision through scaling factors, roughly halving memory;
- FP4: compresses further to 4 bits and is extremely sensitive to quantization error.
To preserve accuracy at such low bit widths, the industry introduced the idea of microscaling, whose representative format is MXFP4, a general quantization specification. The core idea: split a tensor into many small blocks, share one scaling factor within each block, and represent the elements in 4-bit floating point. Quantization error is thus localized inside each block, while the block-level shared scale preserves the dynamic range — compressing the footprint dramatically while keeping precision loss within an acceptable range.
Schematically, the quantization process can be abstracted as follows:
# Pseudocode: block-wise microscaling quantization (illustrative, not a specific implementation)def quantize_block(block, fp4_max=6.0):# 1. Take the block's absolute maximum as the anchor for its dynamic rangescale = block.abs().max() / fp4_max# 2. Normalize the block with the shared scale, then quantize to a 4-bit representationnormalized = block / (scale + 1e-8)quantized = round_to_fp4(normalized)return quantized, scale # Stored: low-bit data + one scale factor per block
It is exactly this combination of “block-shared scaling plus 4-bit storage” that allows huge open-weight models to run inference on a single GPU or even consumer-grade hardware. General cloud capabilities — object storage for hosting model weights, container services for elastically scaling inference instances, inference acceleration, and monitoring with alerting — let developers choose compute specs on demand and run models at a tier that balances cost and performance.
Takeaways for Developers
Looking back along this line of evolution, a few transferable engineering lessons emerge:
- Architecture converges; details win. The macro skeleton is stable now, so the real gains come from careful selection and tuning of normalization, activation, position encoding, and attention variants.
- Capacity and cost must be balanced. MoE and low-precision quantization address the core contradiction of “bigger yet still runnable” from two different angles — the parameter structure and the numeric representation.
- The deployment view shapes the design. Phenomena such as attention sinks are a reminder that inference-time memory management strategies have to be written back into the model design rather than patched in afterwards.
- Leverage general cloud capabilities. Building on general-purpose cloud services such as object storage, container platforms, and monitoring and alerting lets engineering effort return to the model and the algorithm itself.
The “code” of the architecture has never been a single magic structure. It is the cumulative result of countless component replacements, trade-offs, and engineering optimizations. Understand these details, and you understand the underlying logic of how large models are evolving today — which leads to more rational decisions in model selection, training, and deployment.
