What Comes After Transformers?
The transformer architecture, built on scaled dot-product self-attention, has dominated sequence modeling since Vaswani et al. (2017), yet its O(n²) attention complexity, static computational graphs, and inability to perform true iterative reasoning impose fundamental limits that motivate a new generation of architectures. Post-transformer research spans state-space models, linear attention variants, neural Turing machines redux, diffusion-based reasoners, and hybrid systems that selectively abandon the all-pairs attention bottleneck while preserving or exceeding empirical performance. The counterintuitive fact: several leading candidates — particularly structured state-space models — were derived from classical control theory and signal processing, fields largely ignored by deep learning for decades.
The transformer's power comes from its ability to route information between any two tokens in a single layer, but this universality is also its curse: the quadratic cost of computing all pairwise interactions becomes prohibitive at long contexts, and the architecture has no inductive bias toward the kind of sequential, recursive computation that many reasoning tasks demand. The central question driving post-transformer research is whether we can design sequence models that are simultaneously expressive (matching transformer quality), efficient (sub-quadratic in sequence length), and compositionally structured (capable of multi-step algorithmic reasoning). The emerging answer is that no single architecture wins on all three axes — instead, the frontier consists of hybrid systems that dynamically allocate different computational strategies to different parts of a problem. Understanding what comes after transformers therefore requires understanding why transformers fall short, not just what replaces them.
How It Works
Post-transformer architectures attack three core mathematical bottlenecks. We develop each with precision.
1. The Quadratic Attention Bottleneck
Standard scaled dot-product attention computes:
Explanation: For a sequence of length n, the matrix requires O(n²d) time and O(n²) space, making attention quadratic in sequence length. Here , , with the input and learned projections. The softmax normalizes over the key dimension. For (genomic sequences, hour-long audio), the term makes this computationally intractable.
2. Linear Attention and Kernel Approximation
The key insight (Katharopoulos et al., 2020) is that softmax can be approximated via a feature map such that :
Explanation: By associativity of matrix multiplication, the inner sums and can be precomputed once, reducing total complexity to O(nrd) — linear in n. This reformulation is exact when perfectly factors the softmax kernel, and approximate (but empirically competitive) with random Fourier features or polynomial kernels. The challenge is that removing the softmax normalization destabilizes training; several works (RetNet, RWKV, GLA) propose different stabilization strategies.
3. State-Space Models: The Recurrence Formulation
Structured State-Space Models (S4, Mamba) parameterize sequence-to-sequence maps as continuous-time linear systems, discretized to yield a recurrence. The core SSM is:
Explanation: The hidden state summarizes all past inputs via the state transition matrix , enabling O(1) per-step inference (like an RNN) while the convolution view enables O(n \log n) parallel training. Here are obtained by discretizing continuous-time matrices with step size : , . The critical innovation in S4 (Gu et al., 2021) is constraining to the HiPPO matrix, which provably minimizes the approximation error of polynomial projections of the input history. Mamba (Gu & Dao, 2023) extends this by making , , and input-dependent (selective), breaking the linear time-invariance constraint to enable content-based gating analogous to attention.
4. Expressivity Bounds and the Memorization Gap
A fundamental theoretical result characterizes the separation between SSMs and transformers:
Explanation: Fixed-precision transformers with layers and heads can simulate TC¹ circuits, while bounded-state SSMs are limited to regular languages (TC⁰), establishing a provable expressivity gap on formal reasoning tasks like parity and modular arithmetic. This result (Merrill & Sabharwal, 2023; Grazzi et al., 2024) implies SSMs cannot, in general, solve tasks requiring unbounded counting or explicit state tracking — precisely where transformers with chain-of-thought prompting succeed. Hybrid architectures that interleave attention layers with SSM layers (Jamba, Griffin) achieve TC¹ expressivity while retaining O(n) amortized cost for most tokens.
5. Diffusion and Flow-Based Sequence Models
An orthogonal post-transformer direction treats generation as iterative denoising in a continuous embedding space:
Explanation: Rather than autoregressive left-to-right factorization, diffusion language models (MDLM, PLAID) learn to reverse a noising process over discrete token embeddings, enabling non-autoregressive parallel decoding with iterative refinement. Recent masked diffusion language models (Shi et al., 2024; Sahoo et al., 2024) achieve competitive perplexity with GPT-2 scale transformers while enabling variable-length non-autoregressive generation, though scaling to GPT-4 class remains undemonstrated.
Albert Gu completed his PhD at Stanford under Christopher Ré, where he developed the HiPPO framework for online function approximation and the S4 architecture that demonstrated SSMs could match transformers on long-range dependency benchmarks for the first time. His 2023 Mamba paper introduced selective state spaces with hardware-aware parallel scan algorithms, enabling training throughput competitive with FlashAttention while achieving linear inference cost — the most cited post-transformer architecture paper as of 2024. Gu's background in numerical analysis and control theory led him to derive the HiPPO matrix from Legendre polynomial approximation theory, a connection that surprised the deep learning community.
Ashish Vaswani led the team at Google Brain that published "Attention Is All You Need" (2017), establishing the transformer as the dominant sequence modeling paradigm and directly motivating the question of what might succeed it. His subsequent work at Adept AI on action transformers for computer use demonstrated that transformer limitations in long-horizon planning were fundamental, not merely engineering challenges. Vaswani left Google shortly after the landmark paper — one of the most-cited works in all of computer science — to pursue startup research, and has spoken publicly about his view that the architectural search space beyond attention remains vastly underexplored.
Tri Dao (Stanford PhD, advised by Christopher Ré and Atri Rudra) developed FlashAttention (2022), which showed that the practical bottleneck in transformer training is not FLOPs but memory-bandwidth — a reframing that simultaneously extended transformers' practical reach and clarified why hardware co-design is essential for any successor architecture. His collaboration with Albert Gu on Mamba explicitly designed the selective scan algorithm around A100/H100 memory hierarchy, achieving 5× throughput over attention at sequence length 2K. Dao's insight that IO-awareness is as important as algorithmic complexity has become a foundational principle of post-transformer hardware-software co-design.
Intuition
Imagine you're a researcher trying to understand a 10,000-page document. The transformer approach is like hiring a team of analysts who read every page simultaneously and can instantly compare any sentence to any other — incredibly powerful, but requires a conference room proportional to the square of the document length. State-space models are like hiring a single expert who maintains a running mental summary (the state vector ) and updates it as each new page arrives — she can't recall verbatim details from 5,000 pages ago, but she processes each new page in constant time and uses constant memory. Linear attention is like a compromise: the analyst keeps a compressed "sketch matrix" of everything seen so far, which she updates in O(1) per token and queries in O(1) — but the sketch loses information about fine-grained token ordering that softmax attention preserves. Hybrid architectures are like having the expert maintain her running summary (SSM layers) for most of the document, but periodically stopping to conduct a detailed cross-reference meeting (attention layers) at chapter breaks — you get near-constant memory cost with occasional exact recall. The diffusion approach is entirely different: rather than reading left to right, you start with a blurry, noisy version of the whole document simultaneously and iteratively sharpen your understanding across all positions at once — more like an editor refining a draft than a reader processing a stream.