After Attention: How LLM Architectures Are Splitting and Evolving
Since the "attention is all you need" paradigm took hold in 2017, deep model architectures have not stood still. They have diverged along two main tracks: making the feed-forward network (FFN) sparse and expert-based, and making attention itself linear, sparse, or compressed. This article maps both tracks, explains why fine-grained MoE has become the consensus on the FFN side, walks through the four key families of attention improvements, and closes with a practical selection guide and common pitfalls. The core takeaway: nearly every recent improvement answers one question—how to preserve a long-range information path without falling back to quadratic complexity.
Since the “attention is all you need” paradigm was established in 2017, deep model architectures have not stood still. They have continued to diverge along two main tracks: the sparsification and expertization of the feed-forward network (FFN), and the linearization, sparsification, and compression of attention itself. Understanding the drivers and trade-offs behind these two tracks is more valuable than memorizing any specific model variant.
The Big Picture: FFNs Are Converging, Attention Is Diverging
One clear trend of the past two years is that the FFN portion has largely converged on fine-grained mixture-of-experts (MoE): a large number of routed experts paired with a small number of shared experts, where activated parameters account for only a tiny fraction of total parameters (commonly on the order of a few percent). The essence of this approach is decoupling parameter capacity from the compute budget—total parameters determine the knowledge ceiling, while activated parameters determine the compute cost of a single forward pass.
The attention layers, by contrast, have visibly split into several routes, which can be abstracted into the combinations shown below:
| Route | Typical structural combination | Complexity profile |
|---|---|---|
| Linear + global mixing | Multi-layer linear attention + a few global attention layers | Near-linear, fixed local window |
| Mostly linear + sparse global | Many linear layers + a few full-attention or block-sparse layers | Near-linear, long range via sparsity |
| Mostly sparse | Full attention + block-level sparsity / token-level top-k | Sub-quadratic, depends on scoring quality |
| Compression + sparsity | Compress key-values first, then select sparsely | Sub-quadratic, memory-friendly |
| Linear + sparse hybrid | A few linear layers : multiple sparse attention layers | Balances throughput and accuracy |
This table is the core of the whole discussion: almost every “larger improvement” can be filed under one question—how to preserve a long-range information path without degenerating into quadratic complexity.
The FFN Side: Why Fine-Grained Experts Won
Fine-grained MoE prevailed for three reasons.
First, stronger combinatorial capacity. Slicing experts finer and increasing their number expands the routing combination space, letting the model approximate a larger dense network by stacking many small experts while still activating only a few per token.
Second, more controllable load balancing. With smaller expert granularity, the probability of any single expert being over-subscribed drops, and combined with capacity factors and auxiliary losses, training stability is clearly better than with coarse-grained designs.
Third, shared experts carry “general knowledge.” A small number of shared experts are always active and handle high-frequency patterns such as syntax and common sense, while routed experts handle the long tail and domain-specific traits. This division of labor reduces the damage routing noise can do to general capability.
The engineering trade-off to watch: increasing the expert count brings routing communication and memory fragmentation pressure. In practice, this is offset with expert parallelism, grouped routing, and turning routing decisions into a cacheable static mapping (reusing routing results at inference time) to amortize the cost.
Four Key Improvements on the Attention Side
1. Linear Attention and Gating
Linear attention replaces the softmax kernel with an associative inner-product form, so attention can be written as a state recurrence. This reduces complexity to linear in sequence length and naturally fits an inference cache of fixed-size state. A further improvement adds a gate to the state update, letting the model learn “when to write and when to forget,” which markedly mitigates the information washout that linear attention suffers on long text. In engineering terms, it is often written as pseudocode like this:
# Gated linear attention state recurrence (illustrative)for t in range(seq_len):g = sigmoid(gate_proj(x[t])) # forget/write gatek = k_proj(x[t]) * g # gated keyv = v_proj(x[t])state = decay * state + outer(k, v) # fixed-size state updatey[t] = q_proj(x[t]) @ state
The key point: the state size is fixed, so memory and latency do not grow linearly with context; the cost is that exact retrieval is weaker than full attention.
2. Keeping a Few Global Attention Layers
Purely linear designs lose accuracy on tasks that require exact copying or long-distance coreference, so the mainstream approach keeps a small number of global layers, with a common ratio of “several linear layers : 1 global layer.” This trades a small amount of quadratic cost for a lossless long-range path—the best value-for-money compromise.
3. Dynamic Sparsity: Token-Level and Block-Level
Sparse routes fall into two categories: block-level sparsity (split the sequence into blocks and compute only some block pairs) and token-level top-k (each query selects only the most relevant few keys). Token-level is finer-grained but needs a reliable scoring source; common practice is to add a lightweight scoring head or reuse a low-dimensional projection for similarity estimation. The risk of sparse routes is that “a wrong score means information is permanently lost,” so they usually need to be interleaved with full-attention or linear layers as a fallback.
4. Compressed Sparsity and Shared Indexing
A further step is to first compress key-values into a shorter representation, then select sparsely over the compressed sequence, balancing memory and long-range coverage. Another approach lets multiple attention layers share the same index/selection result (index sharing), spreading the scoring cost across layers. These structures can be summarized as “compression handles coverage, sparsity handles precision.”
Underrated Supporting Changes: Normalization, Position, and Residuals
Structural changes are often accompanied by three “small change, big payoff” adjustments:
- Moving normalization forward and removing bias: placing normalization on the input side of sublayers, together with residual scaling, markedly improves stability when stacking many layers.
- Position encoding extrapolation: shifting from absolute to relative/rotary encodings, combined with interpolation or segmented strategies to extend context.
- Output gating: adding per-channel gating at attention and FFN outputs to suppress the accumulation of low-rank noise.
These changes do not alter complexity themselves, but they determine whether a hybrid structure can actually train to convergence.
Selection Guide: A Practical Decision Table
- Context mostly in the tens of thousands, throughput first: mostly linear + a few global layers.
- Exact long-range retrieval needed (codebases, long-document QA): compressed sparsity or token-level sparsity + a global fallback.
- Memory-constrained, high concurrency: fixed-state linear designs, with batched state.
- Limited training resources: change normalization and position extrapolation first, then consider swapping the attention kernel.
Common Pitfalls
One is equating “linear” with “lossless”—a fixed state is necessarily lossy. The second is stacking sparsity blindly while ignoring scoring quality. The third is looking only at total parameters and not activated parameters, which distorts cost estimates. The fourth is validating long-context structures on small-scale benchmarks, where conclusions often do not transfer.
Overall, the architectural evolution since the self-attention paradigm was established is essentially a three-way trade-off among complexity, accuracy, and memory. To adopt these ideas in your own workloads, start by building a reproducible evaluation baseline on general-purpose capabilities (such as container platforms for running training, object storage for holding corpora, and logging plus monitoring/alerting for tracking training metrics), then validate the structural changes above one by one.
