The Evolution of Deep Model Architectures After Self-Attention

    Since self-attention became the mainstream backbone of large models in 2017, its quadratic compute complexity and linearly growing KV cache have made long-context and long-chain reasoning expensive. This article explores the three major architectural directions that emerged in response—linear attention, sparse attention, and KV compression—and explains why hybrid architectures combining them have become the consensus. It also offers practical guidance for choosing among these approaches in production.

    The Evolution of Deep Model Architectures After Self-Attention

    Since the self-attention mechanism was introduced in the landmark 2017 paper, it has quickly become the mainstream backbone of large models. However, the computational complexity of standard attention grows quadratically with sequence length, and the KV cache expands linearly with context size, keeping costs high for long documents and long reasoning chains. As a result, most significant architectural improvements after 2017 have centered on one core question: how to reduce the compute and memory overhead of attention while preserving as much global modeling capability as possible. Industry exploration has largely converged on three main directions, along with a growing trend toward hybrid architectures that combine them.

    1. Linear Attention: Replacing Global Matching with Recurrence

    The first direction is linearization. The core idea is to change how queries and keys are matched in attention, transforming the “pairwise computation between every token and all historical tokens” into a recurrent state-update form. This reduces computational complexity from quadratic to linear, and at inference time the cache changes from “storing the full KV history” to “storing a fixed-size state.”

    Recent progress in this direction falls into two main areas:

    • Gated incremental state updates: Introducing gating mechanisms into linear recurrent structures allows the model to learn “what to keep and what to forget,” mitigating the rapid long-range memory decay that plagued early linear attention. A typical engineering pattern is proportional mixing—for example, pairing every 3 linear layers with 1 full attention layer, using a small amount of global attention to restore precise retrieval capability while linear layers keep the rest under control. This “linear-first, global-fallback” ratio has become a common engineering paradigm.
    • Layer-level mixing with global attention: Many next-generation architectures stack “N linear layers + 1 standard attention layer.” The full attention layers typically account for only 1/4 of the stack or even less, yet they deliver clear gains on tasks requiring precise addressing, such as long-document retrieval and code references—making this a highly cost-effective compromise.

    2. Sparse Attention: Computing Only the “Important” Attention

    The second direction keeps the standard attention computation but makes the attention matrix sparse, meaning each query only computes against a small selected set of keys.

    • Static/blockwise sparsity: Attention scope is limited by fixed windows, strides, or block patterns. This is simple to implement and hardware-friendly, but the patterns are content-agnostic and may miss critical dependencies.
    • Dynamic sparsity (token-level top-k): The most important tokens are dynamically selected for each query. Selection is more precise, but it requires extra scoring and indexing steps, and irregular memory access places high demands on inference kernels.
    • Compression + sparsity combinations: Historical KV entries are first compressed at the block level into “summaries,” which are used for coarse filtering; fine-grained attention is then applied only to the matched blocks. This effectively reduces the cost of deciding “what to select,” a key step toward making dynamic sparsity practical for long contexts.

    The advantage of the sparse route is that it preserves the expressive power of standard attention. Engineering quality mainly depends on selector accuracy and kernel optimization.

    3. KV Compression and Approximation: Keeping the Structure, Shrinking the State

    The third direction leaves the attention formula untouched and instead compresses its inputs and cache: applying low-rank projection to KV, sharing KV across layers, quantization, or summarization to significantly reduce memory footprint and memory bandwidth. Multi-head latent compression designs are a representative example—KV is compressed into a smaller latent space, sharply reducing inference cache, and combining this with sparse selection can stack further gains.

    4. Hybrid Architectures: The Current Mainstream Answer

    Looking at recent evolution, one clear pattern emerges: almost no new architecture wins with a single mechanism—hybrid is the consensus. Common recipes include:

    1. Linear + global: Linear layers carry most of the workload to dilute costs, with periodic full attention layers inserted to guarantee retrieval precision;
    2. Linear + sparse: Linear layers handle routine context, while sparse attention handles long-range precise addressing, paired with index sharing to reduce selector overhead;
    3. Generational evolution from full to sparse: Within the same model family, architectures start with full attention and gradually migrate to blockwise or dynamic sparsity as context length targets increase—showing that sparsification is largely driven by the demands of long documents.

    Illustrative layer configurations could look like this:

    1. # Linear-first with global fallback
    2. layers = [Linear, Linear, Linear, FullAttention] * N
    3. # Linear with sparse selection
    4. layers = [Linear, Linear, Linear, SparseAttention(topk=K)] * N

    5. Practical Selection Guidance

    • Look at the task: For long-document Q&A and repository-level code understanding, prioritize keeping some global or sparse attention; for short-text, high-throughput scenarios, a higher proportion of linear layers is fine.
    • Look at inference cost: Linear structures save memory while sparse structures save compute; each places different demands on hardware kernel maturity, so evaluate inference framework support before deployment.
    • Look at training stability: Gating and compression modules introduce new hyperparameters. Validate long-range retrieval benchmarks at small scale before scaling up.

    Overall, architectural improvements since 2017 are essentially a “rebalancing of cost versus expressiveness”: linearization trades for lower complexity, sparsification trades for selectivity, and compression trades for memory savings—while hybrid architectures are the engineering convergence point of all three. For teams looking to bring long-context capabilities into production, building a reproducible evaluation pipeline—leveraging infrastructure such as container platforms, object storage, and monitoring and alerting available from general-purpose cloud providers—matters more than chasing any specific architecture.