LLM Architecture Evolution: The Engineering Trade-offs That Define Modern Large Models

    This article breaks down how large language model (LLM) architectures have evolved, focusing on the engineering trade-offs rather than any single product. It explains why the decoder-only design became the common baseline, then walks through the key component-level decisions that separate modern open-weight models from their predecessors: removing Dropout, switching from LayerNorm to RMSNorm and Pre-Norm, adopting rotary position embeddings (RoPE), moving to gated activations like SwiGLU, refining attention with GQA and attention sinks, using Mixture-of-Experts (MoE) to trade sparse activation for capacity, balancing width against depth, and applying low-bit quantization. It closes with practical guidance for performance evaluation and model selection under real memory, latency, and deployment constraints.

    Introduction: Why Re-examine the Architecture

    Every few months, a new “open-weight” model appears and pulls attention back to the architecture itself. Many engineers’ first reaction is that these new models look nothing revolutionary compared to the previous generation. That intuition is largely correct — the leading models released today are highly convergent at the skeleton level, almost all built on the decoder-only structure that traces back to the classic 2017 Transformer paper.

    But the real evolution hides in the details: which components get removed, which get replaced, and which get finely tuned.

    This article is not about any specific product. Instead, it abstracts this evolutionary thread into a general engineering framework: where modern LLMs make trade-offs, why they make them, and what each decision means for model selection, deployment, and performance evaluation.

    1. The Common Ground: Why decoder-only Became the Baseline

    Put the mainstream LLM architectures of recent years side by side, and their differences shrink. An early classic small model with only a few billion parameters and a new open-weight model with tens of billions of parameters can share almost the same structural outline. Three factors drive this convergence:

    • Frequent movement of talent: Researchers move constantly between top labs, and with them spread architectural experience and engineering habits, forming a de facto “common recipe.”
    • Transformer’s dominance: No approach has yet reliably outperformed the Transformer on general language modeling tasks. Most new variants make only local substitutions around attention, normalization, or positional encoding.
    • Gains come from data and training: Large performance jumps increasingly come from fine-tuning data quality, data mixtures, and training algorithms (better learning-rate schedules, more pretraining tokens) rather than skeleton-level architectural revolutions.

    This leads to an important practical conclusion: most teams gain not from “inventing a new architecture” but from correctly choosing and optimizing components within mature architectures. Every item broken down below is essentially a decision about “keep or remove this component, and which variant to use.”

    2. From Foundation to Modern: Four Main Lines of Architectural Evolution

    1. Removing Dropout

    Early decoder-only models (following the original Transformer design) used Dropout on both the attention score matrix and the residual path: during training, a fraction of activations are randomly zeroed with some probability to suppress overfitting.

    The prevailing practice in modern LLMs is to almost stop using Dropout altogether. The reason lies in a fundamental difference in usage context:

    • Dropout was born in an era of “small models, trained repeatedly for hundreds of epochs, highly prone to overfitting.”
    • LLMs, by contrast, are typically pretrained on massive corpora for roughly one epoch (one-epoch or very few epochs), which makes overfitting hard to begin with. Randomly zeroing activations here instead weakens stable gradient propagation and slows convergence — a poor trade-off.

    An illustrative comparison (pseudocode):

    1. # Early model: insert Dropout on the attention path
    2. attention_scores = Q @ K.transpose(-1, -2) / sqrt(d_k)
    3. attention_scores = dropout(attention_scores, p=0.1) # Modern models usually remove this step
    4. # Modern model: inference and training paths match, no random zeroing
    5. context = softmax(attention_scores) @ V

    2. Normalization: From LayerNorm to RMSNorm

    The position and form of the normalization layer have also evolved. Early models commonly used LayerNorm, often placed after the sub-layer (Post-Norm). Modern models more often adopt:

    • RMSNorm in place of LayerNorm: it scales only by the root mean square, without subtracting the mean and without a bias term. It is cheaper to compute and more stable and efficient in deep, large-scale training.
    • Pre-Norm (pre-normalization): placing normalization before the sub-layer keeps the residual main path cleaner, makes gradients easier to propagate, and is more stable when training deeper networks.

    These two substitutions are typical “low-risk, high-reward” choices, with almost no reason to revert.

    3. Positional Encoding: From Absolute Positions to Rotary Embeddings

    Transformer’s self-attention is insensitive to order, so positional information must be injected explicitly. The evolution runs:

    • Learnable/sinusoidal absolute positional encodings: simple, but with weak extrapolation ability. Performance degrades sharply once the sequence exceeds the training length.
    • Rotary Position Embedding (RoPE): encodes relative position by rotating the query and key vectors. It offers good length extrapolation and compatibility, and has become the default choice for modern open-source LLMs.

    4. Activation Functions: From ReLU to Gated Structures

    The activation function in the feed-forward network (FFN) has shifted from the widely used early ReLU / GeLU toward gated linear units (such as SwiGLU). The gated structure modulates activations element-wise through an additional path, often achieving better results at a similar parameter count. The cost is that the FFN intermediate dimension must be adjusted accordingly to keep the parameter count balanced.

    3. Refining the Attention Mechanism

    From MHA to GQA

    Standard multi-head attention (MHA) keeps a separate set of keys (K) and values (V) for every head. At inference time, the KV Cache grows linearly with the number of layers, heads, and sequence length, becoming a memory bottleneck for long-context inference. The main engineering optimizations are:

    • Multi-Query Attention (MQA): all query heads share a single set of K/V. It uses the least memory but limits expressiveness.
    • Grouped-Query Attention (GQA): a middle ground that splits query heads into groups and shares K/V within each group, balancing quality against inference cost. Modern LLMs widely adopt GQA.

    Attention Bias and “Attention Pools”

    In long-context and streaming inference, the beginning and end of the sequence often carry unusually important information:

    • The few tokens at the very start of the sequence continuously absorb large amounts of attention weight, acting as a “global default gathering point.” This phenomenon is known as an attention sink. When sliding-window attention pushes the earliest tokens out of the window, model performance can collapse noticeably.
    • A common countermeasure is to reserve several learnable “virtual gathering” tokens at the very front (attention bias/pooling slots), giving attention a stable landing point and improving stability for long-context and streaming generation.

    Illustratively, a “sentinel” position is explicitly added to the attention scores:

    1. # Keep a fixed sink slot outside the sliding window to stabilize the attention distribution
    2. scores = Q @ K.T / sqrt(d_k)
    3. scores_with_sink = concat([sink_bias, scores], dim=-1) # front sentinel
    4. probs = softmax(scores_with_sink)
    5. context = probs[..., 1:] @ V # the sink slot does not participate in the final value aggregation

    4. Mixture of Experts (MoE): Trading Sparse Activation for Capacity

    The key difference in the next generation of large-parameter models often lies not in the skeleton but in whether they adopt Mixture of Experts (MoE).

    The core idea: split the FFN into multiple “expert” sub-networks, and use a gating network (router) to select only a few experts for each token. As a result, the model holds a huge total parameter count (carrying more knowledge capacity), but each token activates only a small subset (activated parameters far below total parameters), keeping inference compute manageable.

    1. # MoE gating routing (illustrative)
    2. logits = router(x) # compute scores for each expert
    3. topk_idx = topk(logits, k=2).indices # each token activates only 2 experts
    4. out = sum(expert_i(x) for i in topk_idx)

    This design explains a common phenomenon: a model nominally containing tens of billions of parameters but activating only a few billion becomes feasible on a single GPU or even a local device — because what truly determines peak compute and memory is the activated parameters, not the total (together with the quantization discussed below).

    5. The Trade-off Between Width and Depth

    Comparing models of different scales reveals that teams do not make the same “deep vs. wide” choice:

    • Going deeper (more layers): each layer’s representation is more abstract, but serial inference is slower and gradient propagation is harder.
    • Going wider (larger hidden dimension, more experts/heads): higher parallelism, easier to scale capacity under an MoE framework, but higher per-layer compute and memory cost.

    In the MoE era, a typical strategy is to stack total capacity with “wider + more experts,” and control per-token cost with “sparse activation.” Small-parameter models, by contrast, lean toward more compact structures to lower the deployment barrier. There is no universal answer to this trade-off; it must be set against the target hardware (single-GPU memory, bandwidth) and the business’s latency requirements.

    6. Low-Bit Quantization: Running Large Models on a Single GPU and Locally

    Even when activated parameters are already small, running large models in consumer-grade or single-GPU environments still hinges on weight precision. The prevailing industry practice is low-bit floating-point quantization: compress weights originally in 16-bit floating point to a lower bit width (typically around 4 bits), attaching a scaling factor (scale) and zero point per “block” to form a micro-scaled floating-point format.

    Its engineering value lies in:

    • Multi-fold reduction in memory footprint: 4-bit weights are, in theory, roughly a quarter of the size of 16-bit weights.
    • Relieved bandwidth pressure: autoregressive decoding is a memory-bound task, so smaller weights mean higher effective throughput.
    • Lower deployment barrier: it makes running large-parameter models on “a single machine with a single GPU” or even “a high-performance local device” possible.

    Note that quantization is not lossless: block size, how the scaling factors are stored, and the differing sensitivity of activations versus weights all affect the precision loss. For precision-sensitive workloads, thorough quality regression should be run before and after quantization.

    7. Performance Evaluation and Model Selection Advice

    When evaluating models, do not look only at a single parameter count or a single score. Build a multi-dimensional view instead:

    • Knowledge and reasoning ability: benchmark performance across knowledge, math, code, and other dimensions, focusing on the cost-effectiveness inflection points across scale tiers.
    • Activated parameters and memory: distinguish “total parameters” from “activated parameters,” and estimate memory and compute requirements accordingly.
    • Context and extrapolation: pay attention to long-context stability (where designs like attention sinks become especially critical).
    • Deployment cost: evaluate actual memory footprint after low-bit quantization, together with target hardware and concurrency requirements.

    A pragmatic selection path is: first narrow down candidates that “can actually run” under memory and latency constraints, then run small-scale evaluation with your own business data under the same constraints, and finally balance precision against cost. For real-world enterprise deployment, this usually also requires general infrastructure such as object storage (to hold model weights), a container platform (to spin up inference services elastically), and logging services with monitoring and alerting (to observe throughput, latency, and memory) to ensure stable operation.

    Conclusion

    From early decoder-only models to modern open-weight LLMs, the skeleton itself has changed only modestly. What truly separates the leaders is a series of seemingly small engineering trade-offs: removing no-longer-useful Dropout, stabilizing deep training with RMSNorm and Pre-Norm, strengthening extrapolation with RoPE, compressing the KV Cache with GQA, trading sparse activation for capacity with MoE, stabilizing long context with attention sinks, and finally squeezing everything onto a single GPU with low-bit quantization. Understanding this main thread is more valuable than memorizing the parameter table of any single model — because it lets you quickly judge, when the next “new model” appears, exactly which component this round of evolution’s key is hiding in.