You know Transformers cold: softmax attention, the KV cache, quadratic training cost. This page exists to get you fluent in the S4 → Mamba → Mamba-2 family fast, by mapping every idea onto something you already have a slot for. The short version: an SSM is what you get when you replace attention's unbounded, ever-growing memory of every past token with a fixed-size state that gets overwritten as it goes — and the 2024 state space duality result proves this isn't a vague analogy, it's a precise mathematical equivalence at one corner of the design space. Everything downstream — the efficiency wins, the recall losses, why the field ended up building hybrids instead of picking a side — falls out of that one structural choice.
| pole | state | recall | cost |
|---|---|---|---|
| Softmax attention | unbounded — every past K,V kept exactly | perfect, by construction | quadratic in sequence length |
| Linear attention / hybrids | fixed-size matrix state, plus a little real attention | partial — recovers what the attention layers cover | linear, with a small quadratic slice |
| Pure SSM (S4, Mamba) | fixed-size vector state per layer, constant in context length | bounded — provably, not just empirically | linear in sequence length |
Part 0 makes that claim concrete with a worked KV-cache number. Part 2 is the part a Transformer expert will likely find most useful: the exact mapping between an SSM's recurrence and a masked linear-attention layer. The rest works outward from there — lineage, complexity, where each architecture actually wins, and where the field has landed as of mid-2026, which is hybrids, not a winner.
Every claim, number, and citation on this page traces back to a single research brief compiled from the primary papers (arXiv IDs given throughout). Where the literature is unsettled or a number comes from a vendor blog post rather than a peer-reviewed benchmark, that is flagged explicitly — most fully in Part 7.
Causal softmax attention computes, for each query, a weighted combination over every key and value seen so far, with weights set by a row-wise softmax. That normalisation is the entire story: because the softmax couples each query to the full set of past keys, the model must retain every token's K and V exactly in order to compute future outputs. There is no finite summary you can carry forward instead — hence the KV cache, and hence its size growing linearly with sequence length forever.
An SSM (or any linear-attention variant) makes the opposite bet. It compresses everything seen so far into a fixed-size state — a vector (or small matrix) that gets updated, not appended to, at every step. This is cheap and constant, but it necessarily loses information once the sequence exceeds the state's capacity. There is no way around this: it is the direct cost of the memory being fixed size.
The standard formula for a Transformer's KV-cache footprint is \(2 \cdot n_{\text{layers}} \cdot n_{\text{kv heads}} \cdot d_{\text{head}} \cdot \text{seq\_len} \cdot \text{batch} \cdot \text{bytes\_per\_param}\). Plug in a Llama-3-70B-class model — 80 layers, grouped-query attention (GQA) with 8 KV heads, \(d_{\text{head}}=128\), BF16 — and the per-token cost is \(2\cdot80\cdot8\cdot128\cdot2 = 327{,}680\) bytes, about 0.31 MB per token. A single-request 128K context then costs roughly 40–43 GB; the same model at 1M tokens costs roughly 327 GB. Without GQA — plain multi-head attention with 64 KV heads — the per-token cost would be about 2.5 MB and a 128K context would need roughly 320 GB. That ~8× reduction from GQA is what makes 70B-class long-context deployment tractable at all. An 8B model (32 layers, 8 KV heads) needs about 16 GB at 128K.
A Mamba layer's recurrent state has shape \(d_{\text{inner}} \times d_{\text{state}}\), where \(d_{\text{inner}} = \text{expansion}\cdot d_{\text{model}}\) (expansion 2) and \(d_{\text{state}} = 16\) for Mamba-1. This is constant per layer, independent of sequence length: the entire "memory of the past" for a Mamba-2.8B model is a few MB, regardless of whether the context is 2K or 1M tokens. That is the whole inference-efficiency story in one number — a few MB, flat, against 40+ GB and climbing.
It is worth being honest about the modern comparison rather than the straw man. FlashAttention does not change attention's \(O(n^2)\) compute; it changes the memory by never materialising the full \(n\times n\) score matrix (tiling plus recomputation), making attention's memory footprint \(O(n)\) too. So the fair statement is: SSM \(O(n)\) memory vs. FlashAttention's \(O(n)\) memory, but attention still pays \(O(n^2)\) compute and still grows a KV cache at inference that an SSM simply does not have.
The 2024 "state space duality" result (Mamba-2; Dao & Gu; arXiv:2405.21060) is the mathematical spine that turns "attention vs. SSM" from a rivalry into a spectrum. It proves that SSMs and a specific class of causal linear attention are two views of the same structured-matrix object — full derivation in Part 2. That means softmax attention (unbounded state) and a pure SSM (fixed state) are two poles of one design space, with linear attention and hybrid architectures occupying the territory in between. Reading the rest of the field through that lens — rather than as "old RNNs vs. new Transformers" — is the single most useful reframe this page can offer a Transformer-fluent reader.
The lineage from a memory-compression theorem to production hybrid models runs about six years. Each step below either made the previous idea cheaper to compute or fixed a capability gap the previous step exposed.
HiPPO (Gu, Dao, Ermon, Rudra, Ré, 2020; arXiv:2008.07669, NeurIPS 2020) frames memory as online function approximation: keep the coefficients of the optimal polynomial projection of the signal seen so far, weighted by a measure that says how much each past timestep matters. The HiPPO-LegS (scaled Legendre) measure weights all history uniformly and gives timescale robustness, \(O(1)\) updates, and bounded gradients; it set a then-SOTA 98.3% on permuted-MNIST. Downstream, the HiPPO-LegS matrix becomes the initialisation that lets later SSMs actually capture long-range dependencies instead of behaving like a generic, forgetful linear RNN.
LSSL (Gu, Johnson, Goel, Saab, Dao, Rudra, Ré, 2021; arXiv:2110.13985, NeurIPS 2021) introduced the three views of a linear SSM — recurrent, convolutional, continuous-time — as one trainable layer, but was impractically expensive because it materialised powers of the state matrix (\(\approx O(N^2L)\) work), which directly motivated S4.
S4 (Gu, Goel, Ré, 2021/2022; arXiv:2111.00396, ICLR 2022) made the SSM convolution kernel cheap: it parameterises \(A\) in Diagonal-Plus-Low-Rank form, evaluates the kernel's truncated generating function on roots of unity (a Cauchy-kernel multiply, Woodbury handling the low-rank correction), and applies an inverse FFT — \(\tilde O(N+L)\) instead of \(\approx O(N^2L)\). S4 was the first model to beat chance on Long Range Arena's Path-X (length 16,384) and averaged 80.48% on LRA against under 60% for every Transformer variant at the time.
DSS / S4D (Gupta, Gu, Berant, 2022, arXiv:2203.14343; Gu, Gupta, Goel, Ré, 2022, arXiv:2206.11893 — both NeurIPS 2022) showed the low-rank term can be dropped entirely: a purely diagonal complex \(A\) nearly matches S4 (DSS: 81.88 LRA avg; S4D: ~85%), and with diagonal \(A\) the kernel is just a Vandermonde product computable in a couple of lines.
H3 (Dao, Fu, Saab, Thomas, Rudra, Ré, 2022; arXiv:2212.14052, ICLR 2023) diagnosed why SSMs underperformed on language: they couldn't remember tokens across the whole sequence or compare the current token to earlier ones — the two things attention does natively. H3 stacks a shift SSM (state literally stores the previous token) with a diagonal SSM plus gating, replacing almost all attention in a GPT-style model; scaled to 2.7B on the Pile it beat Transformers on a majority of SuperGLUE tasks and generated up to 2.4× faster.
Mamba (Gu & Dao, 2023; arXiv:2312.00752) is the pivot: make \(B\), \(C\), and the step size \(\Delta\) functions of the input (the resulting layer, S6, is "selective S4"). This gives content-based reasoning — attention's default, not an SSM's — and directly targets the recall gap H3 identified. The cost: selectivity kills the fixed convolution kernel, so training instead uses a hardware-aware parallel scan (SRAM-resident, FlashAttention-style kernel fusion). Reported: ~5× higher inference throughput than Transformers, linear scaling to million-length sequences, Mamba-3B matching Transformers twice its size, and induction-head generalisation to sequences of length \(2^{20}\approx1\)M.
Mamba-2 / SSD (Dao & Gu, 2024; arXiv:2405.21060, ICML 2024) — "Transformers are SSMs" — proves SSMs and a class of attention variants are connected through structured semiseparable-matrix decompositions (the full mechanics are Part 2's subject). Practically, this "state space duality" lets Mamba-2's core layer run as a chunkwise, matmul-heavy algorithm — tensor-core/TPU-friendly — making it 2–8× faster than Mamba-1's selective scan while staying competitive with Transformers, with a larger state (\(d_{\text{state}}\) 64–256 vs. Mamba-1's 16).
Mamba-3 (Lahoti, Li, Chen, Wang, Bick, Kolter, Dao, Gu, 2026; arXiv:2603.15569) advances the SSD line with exponential-trapezoidal discretisation, complex-valued state transitions, and a multi-input-multi-output (MIMO) formulation. Note this is a very recent 2026 preprint — cite it as such.
A Transformer-fluent reader should situate the SSM line alongside a parallel family that reaches similar territory from the attention side rather than the recurrence side.
| work | venue / year | the one idea |
|---|---|---|
| Linear Transformers ("Transformers are RNNs") | Katharopoulos, Vyas, Pappas, Fleuret — ICML 2020 | kernel feature map \(\varphi\) turns attention into \(\varphi(Q)(\varphi(K)^\top V)\): an RNN with matrix-valued state, \(O(n)\) inference. Conceptual parent of the SSM-attention duality. |
| Performer | Choromanski et al., 2020 | random-feature (FAVOR+) approximation of the softmax kernel. |
| RWKV | Peng et al. — EMNLP 2023 | attention-free RNN with time-mixing / channel-mixing; RWKV-7 "Goose" shipped late 2024, G1 variant early 2026. |
| RetNet | Sun et al., 2023 | "retention": a fixed per-head exponential decay, with parallel, recurrent, and chunkwise computation forms. |
| GLA (Gated Linear Attention) | Yang, Wang, Shen, Panda, Kim — ICML 2024, arXiv:2312.06635 | data-dependent diagonal gating on linear attention; ships with FlashLinearAttention, faster than FlashAttention-2 even at 1K length. |
| DeltaNet / Gated DeltaNet | Yang, Wang, Zhang, Shen, Kim — NeurIPS 2024; Yang, Kautz, Hatamizadeh, arXiv:2412.06464 | delta-rule update (subtract the old value before writing the new one) to sharpen memory; Gated DeltaNet adds Mamba-2-style decay. |
| xLSTM | Beck et al., 2024 | revives the LSTM with exponential gating and matrix-valued memory. |
| Based | Arora et al. — ICML 2024, arXiv:2402.18668 | Taylor-feature linear attention plus sliding-window attention, letting you dial the state size and traverse the recall/throughput Pareto frontier; 24× the generation throughput of FlashAttention-2 at 1.3B while recovering much of attention's recall. |
This is the section worth slowing down for. The underlying object of an SSM is a continuous linear time-invariant system,
with hidden state \(x\in\mathbb{R}^N\), input \(u\), output \(y\). To run this on discrete tokens it must be discretised with a step size \(\Delta\). Zero-order hold (ZOH) gives \(\bar A=\exp(\Delta A)\), \(\bar B=(\Delta A)^{-1}(\exp(\Delta A)-I)\Delta B\); the bilinear (Tustin) transform gives the rational approximation \(\bar A=(I-\Delta A/2)^{-1}(I+\Delta A/2)\). Semantically, \(\Delta\) is the resolution at which the continuous system is sampled: a large \(\Delta\) weights the current input heavily (a focus/reset), a small \(\Delta\) persists old state and mostly ignores the current input. In Mamba, \(\Delta\) is input-dependent — exactly the selective "how much do I care about this token" gate.
Causal linear attention computes \(S_t=S_{t-1}+k_tv_t^\top\), \(y_t=q_tS_t\) — a matrix-valued state accumulating outer products. Add a scalar decay \(\gamma\) (\(S_t=\gamma S_{t-1}+k_tv_t^\top\)) and you have RetNet-style retention. This is exactly a scalar-structured SSM with \(A_t=\gamma I\), \(B_t=k_t\), \(C_t=q_t\). The \(L\times L\) mixing matrix is 1-semiseparable: every submatrix strictly below the diagonal has rank 1, and its entries are cumulative products of the decays. Setting \(\gamma_t = 1\) recovers vanilla causal linear attention (Katharopoulos et al.).
Softmax attention breaks this. The row-wise softmax nonlinearity means the \((i,j)\) weight depends on all keys in that row, so the transformation cannot be written as a fixed-size linear recurrence — there is no finite state \(S_t\) you can carry forward. That is the precise sense in which softmax attention "needs" an unbounded state: it is a structural fact about the nonlinearity, not an implementation detail.
Practically, this duality (SSD; Mamba-2, arXiv:2405.21060) lets Mamba-2's layer be computed with a chunkwise algorithm that is matmul-heavy — split the sequence into chunks, compute intra-chunk contributions as ordinary matrix multiplies, and pass state between chunks with a scan. That's the concrete engineering payoff of the theorem: a tensor-core/TPU-friendly kernel, not just a nice diagram.
Complexity is genuinely better for SSMs, but FlashAttention and GQA narrow the practical gap enough that the comparison needs care, or an expert reader will (correctly) discount it.
| axis | Transformer (softmax attention) | S4 (non-selective SSM) | Mamba / Mamba-2 (selective SSM) |
|---|---|---|---|
| Training compute | \(O(n^2 d)\) | \(O(n\log n)\) via FFT conv (parallel) | \(O(n)\) via parallel associative scan |
| Training memory | \(O(n^2)\) naive; \(O(n)\) with FlashAttention (IO-aware; compute stays \(O(n^2)\)) | \(O(n+N)\) | \(O(n)\) |
| Inference per token | \(O(nd)\), grows with context (attends to all past K,V) | \(O(Nd)\) constant | \(O(Nd)\) constant |
| Inference state / memory | KV cache grows linearly with sequence length | Constant (state size \(N\) per channel) | Constant (\(d_{\text{model}}\cdot d_{\text{state}}\cdot\text{expansion}\) per layer) |
| Parallel over sequence in training | Yes | Yes (FFT) | Yes (associative / prefix scan) |
Restating Part 0's number with the full formula in view: \(2\cdot n_{\text{layers}}\cdot n_{\text{kv heads}}\cdot d_{\text{head}}\cdot \text{seq\_len}\cdot\text{batch}\cdot\text{bytes\_per\_param}\). For a Llama-3-70B-class model (80 layers, GQA with 8 KV heads, \(d_{\text{head}}=128\), BF16): per-token cost \(2\cdot80\cdot8\cdot128\cdot2=327{,}680\) bytes ≈ 0.31 MB/token, so a single-request 128K context costs ≈ 40–43 GB (1M tokens ≈ 327 GB). Without GQA — MHA with 64 KV heads — per-token cost is ≈ 2.5 MB and a 128K context needs ≈ 320 GB: the ~8× GQA reduction is what makes 70B long-context deployment tractable at all. An 8B model (32 layers, 8 KV heads) needs ≈ 16 GB at 128K.
FlashAttention does not change attention's \(O(n^2)\) compute; it changes the memory by never materialising the \(n\times n\) score matrix (tiling plus recomputation), making attention memory \(O(n)\). So the fair modern comparison is: SSM \(O(n)\) memory vs. FlashAttention \(O(n)\) memory, but attention still pays \(O(n^2)\) compute and still grows a KV cache at inference. MQA (1 KV head) and GQA (a few KV heads) reduce the KV cache by the head-sharing factor — 8× for Llama-3 — which is why a naive "70B attention needs 320 GB" claim is a straw man: the honest number is ~40 GB, still large, still growing with context, but not catastrophic.
A Mamba layer's recurrent state has shape \(d_{\text{inner}}\times d_{\text{state}}\), where \(d_{\text{inner}}=\text{expansion}\cdot d_{\text{model}}\) (expansion 2) and \(d_{\text{state}}=16\) (Mamba-1). This is a constant per layer, independent of sequence length — the entire memory of the past for a Mamba-2.8B model is a few MB regardless of whether the context is 2K or 1M tokens.
Once \(\Delta\), \(B\), and \(C\) become input-dependent, the FFT-convolution path is gone — there is no longer a single fixed kernel to convolve with. Mamba instead computes the selective recurrence with a Blelloch-style work-efficient parallel prefix scan: \(O(n)\) work, \(O(\log n)\) depth, using an associative combine operator over \((\bar A,\bar Bu)\) pairs, run in SRAM with kernel fusion in the spirit of FlashAttention (writing only outputs to HBM). This is exactly what recovers training parallelism after selectivity kills the convolution — worth checking against the SSD chunkwise algorithm of Part 2, which is Mamba-2's answer to the same problem via a different route.
Repeat After Me (Jelassi, Brandfonbrener, Kakade, Malach, 2024; arXiv:2402.01032, ICML) theoretically proves a two-layer Transformer can copy strings of length exponential in its size, while any "generalized SSM" with a fixed-size latent state is fundamentally limited by that fixed size. Empirically, pretrained Transformer LLMs dramatically outperform SSMs at copying and retrieving information from context.
Based (Arora et al., 2024; arXiv:2402.18668) and Zoology (Arora et al., 2023; arXiv:2312.04927) establish the MQAR (Multi-Query Associative Recall) benchmark and show a clean state-size ↔ recall Pareto tradeoff: efficient models with a fixed recurrent state (H3, Mamba, RWKV) struggle at recall precisely because the state is fixed, while full softmax attention achieves near-perfect MQAR at any configuration. Recall on real-world language data tracks this synthetic tradeoff.
The Illusion of State in State-Space Models (Merrill, Petty, Sabharwal, 2024; arXiv:2404.08819, ICML) shows that despite their RNN-like appearance, S4/Mamba-style SSMs cannot express computation outside \(\mathsf{TC}^0\) — the same circuit class that already bounds Transformers. So SSMs cannot solve inherently sequential state-tracking problems (permutation composition / S₅ word problems), and in a single forward pass "cannot accurately track chess moves with certain notation, evaluate code, or track entities in a long narrative." SSMs are not the stateful escape hatch they look like — they are not more expressive for state tracking than Transformers, only differently constrained.
The Expressive Capacity of State Space Models (Sarrof, Veitsman, Hahn, 2024; arXiv:2405.17394, NeurIPS) finds SSMs and Transformers have overlapping but distinct strengths: on star-free state tracking, SSMs "implement straightforward and exact solutions to problems that transformers struggle to represent exactly," and can model bounded hierarchical structure with optimal memory without simulating a stack — but the paper identifies a design choice in current SSMs that limits their expressive power, and neither family reaches the \(\mathsf{NC}^1\)-complete "hard state tracking" simple RNNs can express. Chain-of-thought / intermediate-token generation is the known lever to lift both families' limits, trading serial compute steps for missing circuit depth.
On Long Range Arena, S4 averaged ~80–86% and was the first to crack Path-X (later versions reach 96.4%); S5, Mega, and gated-linear-RNN variants (HGRN2, 87.66) sit in the same band. Plain Mamba does not do well on LRA in independent runs — one replication reports Mamba ~66.6% average, failing Path-X at 67.3%, and Griffin similarly at ~62.5%. So LRA's synthetic long-range skill does not transfer cleanly from S4 to Mamba — a genuinely surprising result given that both are "SSMs," and one that's easy to bury.
On modern needle-in-a-haystack / RULER-style evaluations, NVIDIA's controlled study found pure Mamba/Mamba-2 lag Transformers on long-context reasoning and on tasks needing copying or in-context learning (5-shot MMLU, phonebook lookup), while the hybrid matched or beat the Transformer across 23 long-context tasks — see the anchor study below.
Mamba's own paper reports its models sit on or above the Transformer++ (Llama-architecture) perplexity-vs-compute curve at matched compute up to ~1.3–3B parameters. The most rigorous controlled comparison is NVIDIA's:
At 8B parameters on identical data up to 3.5T tokens, pure Mamba/Mamba-2 match or exceed Transformers on many commonsense tasks (WinoGrande, PIQA, HellaSwag, ARC-Easy, ARC-Challenge) but fall short on copying, in-context learning, and long context. The 8B Mamba-2-Hybrid exceeds the 8B Transformer on all 12 standard tasks (+2.65 pts average) and is projected up to 8× faster at token generation, with +3.5 pts specifically on 5-shot MMLU. The study also notes pure Mamba-1 with a large state ran ~3× slower than Mamba-2.
The consistent finding across labs: interleaving a small fraction of attention layers into an SSM backbone beats both pure architectures in every controlled comparison at ≥8B scale.
First production-scale hybrid Transformer-Mamba-MoE. Ratio 1:7 attention:Mamba, MoE every other layer (16 experts, top-2), 52B total / 12B active, 256K context (trainable to 1M) — structurally 4 blocks of 8 layers, i.e. 56 Mamba + 8 attention layers. Headline efficiency claim: at 256K context, Jamba's attention KV cache is 4 GB vs. 32 GB for Mixtral and 128 GB for Llama-2-70B — a direct consequence of trading 7 of every 8 attention layers for Mamba. It delivers 3× the throughput of Mixtral-8x7B at long context and fits 256K context on a single 80GB GPU with 8-bit weights. Jamba-1.5 (arXiv:2408.12570) scaled to 94B active / 398B total across 72 layers with an effective 256K RULER context and ~10× KV-cache reduction, introducing ExpertsInt8 quantization to fit Jamba-1.5-Large on 8×80GB GPUs at 256K.
Samba (Microsoft, Ren et al., 2024; arXiv:2406.07522, ICLR 2025) — layer-wise Mamba + sliding-window attention; Samba-3.8B trained on 3.2T tokens, extrapolates to 256K context with perfect passkey recall, and improves next-token prediction up to 1M context — 3.73× higher throughput than a GQA Transformer at 128K-prompt processing, 3.64× speedup generating 64K tokens with unlimited streaming.
Zamba / Zamba2 (Zyphra, Glorioso et al., 2024; arXiv:2405.16712, arXiv:2411.15242) — Mamba backbone with a single globally-shared attention block (Zamba2: two alternating shared blocks with LoRA adapters) to minimise parameters; 7B, trained on ~1T tokens. Its efficiency claim is qualitative — "faster at inference, less memory for long-sequence generation" — rather than a single headline multiplier.
Griffin / Hawk / RecurrentGemma (DeepMind, De et al., 2024; arXiv:2402.19427; RecurrentGemma arXiv:2404.07839). Hawk is a pure gated-linear-recurrence RNN (RG-LRU); Griffin mixes RG-LRU with local (sliding-window) attention. Hawk-3B beat the reported Mamba-3B on downstream tasks with half the training tokens; Griffin matched Llama-2 with ~6× fewer training tokens and extrapolates far beyond its training length. RecurrentGemma (2B/9B) is the productised, fixed-state version. The paper is candid that Hawk/Griffin still underperform Transformers on copying / exact retrieval.
Verbatim: "Out of 56 total layers, the hybrid model has 4 (7.1%) self-attention layers, 24 (42.9%) Mamba-2 layers, and 28 (50%) MLP layers," with attention layers evenly distributed. A 130M-scale sweep showed validation loss is minimised at a small nonzero attention fraction, and that attention layers specifically supply the copying/ICL capability the SSM lacks.
NVIDIA Nemotron-H (arXiv:2504.03624, 8B and 56B/47B hybrids) — "up to 3× faster at inference" than Qwen-2.5/Llama-3.1 at matched accuracy, with Nemotron-H-56B-Base outperforming Llama-3.1-70B on 16 of 17 tasks; a MiniPuzzle prune/distill produced the 47B. Nemotron Nano 2 (arXiv:2508.14444, 9B/12B hybrid reasoning model) builds on the same "replace most attention with Mamba-2" recipe. The Nemotron 3 family (Dec 2025; arXiv:2512.20856 / arXiv:2512.20848; Ultra arXiv:2606.15007) scales the hybrid Mamba-Transformer MoE to Super/Ultra sizes with up to ~6× throughput over comparable Transformer MoEs and 1M context — these are 2026 preprints, cite them as such.
IBM Granite 4.0 (Oct 2025) interleaves Mamba-2 and Transformer at a ~9:1 ratio, removes positional encodings, trains on samples up to 512K tokens, and IBM reports >70% memory reduction for long-context and multi-session inference. IBM Bamba-9B (built with Dao/Gu) reports ~2× throughput over comparable Transformers and outperforms Olmo-7B trained on identical data.
Pure SSMs still ship, but in niches: Mistral Codestral Mamba (7.3B pure Mamba-2 for code, 256K context, Apache 2.0, reportedly beating CodeLlama-34B on code) and Falcon Mamba 7B (TII, Zuo et al., arXiv:2410.05355; trained on 5.8T tokens, the "first competitive attention-free 7B," surpassing Mistral-7B/Llama-3.1-8B/Falcon-2-11B and on par with Gemma-7B on the Open LLM Leaderboard, LLM-Leaderboard-v1 avg ≈ 64.1). No frontier lab ships a pure SSM as its flagship; the frontier trend is hybrid.
Falcon Mamba and NVIDIA both frame it as "the general sequence-to-sequence mapping capabilities of SSMs and the fast retrieval properties of attention layers," and NVIDIA's ablations — attention layers specifically recover copying/ICL/phonebook performance — are the best direct evidence. It aligns with retrieval-head and attention-sink analyses in the Transformer literature showing a small number of attention heads do most in-context retrieval, consistent with why only ~7% attention suffices. But this remains an intuition supported by ablation, not a proven mechanistic decomposition — worth holding lightly.
A Transformer layer alternates multi-head attention and a separate FFN, each with its own residual and norm. A Mamba block is homogeneous: an input projection expanding by 2×, a short causal Conv1d (mixing adjacent tokens before the SSM), the selective SSM, a gating branch (SiLU), and an output projection — MLP-style gating and sequence mixing fused into one block, stacked N times with no attention/FFN alternation. Mamba-2 simplifies further (parallel parameter projections, an added normalisation before the output projection, larger SSM heads) to keep the layer matmul-dominant. Typical hyperparameters: expansion factor 2, \(d_{\text{state}}\) 16 (Mamba-1) or 64–256 (Mamba-2).
Mamba-1 ships selective_scan_cuda — a fused CUDA kernel doing discretisation and
scan in SRAM, writing only outputs to HBM (FlashAttention-style IO-awareness). Mamba-2's
SSD chunkwise-parallel algorithm splits the sequence into chunks, computing
intra-chunk contributions as matmuls and inter-chunk state passing as a scan — why Mamba-2 is
more tensor-core/TPU-friendly (GEMM-dominated) and 2–8× faster. The community
FlashLinearAttention library (Yang & Zhang) provides Triton kernels for
GLA/DeltaNet/etc.
Distills a pretrained Transformer (Phi-1.5) into a Mamba-2-based "Phi-Mamba" in three stages — match the mixing matrix, then per-layer hidden states, then end-to-end logits — using only 3B tokens (<1% of from-scratch training). Phi-Mamba (62.6 avg on the reported suite) beats all prior open non-Transformer models at its size.
Mamba in the Llama (Wang et al., 2024) reuses attention projection weights to initialise SSM parameters and distills with ~20B tokens, keeping a quarter of the original attention layers for a strong hybrid. This "quadratic-to-subquadratic" distillation is now a standard route for producing SSMs/hybrids from Llama/Qwen/Ministral backbones — cheaper than training from scratch, and a good sign that the two architecture families are not as far apart, mechanistically, as they look.
No KV cache means SSM memory per request is constant in context length, so you can hold much larger batches and get higher throughput on long-context / streaming workloads — the core serving win, and it makes memory-bound decode less punishing.
No cheap prefix reuse. Transformers cache prompt K,V so a shared system prompt is computed once and reused across requests; an SSM's compressed recurrent state is not obviously composable/reusable the same way, so prompt-caching and some speculative-decoding tricks that assume a KV cache don't transfer directly (though the recurrent state can be snapshotted/checkpointed, which some serving stacks exploit as "state caching").
Quantisation / precision. SSM recurrent states are precision-sensitive — Hunyuan-TurboS and others keep Mamba states in FP32 at the kernel level for long-context generation quality, and Jamba's ExpertsInt8 quantises experts while being careful around state precision.
Restated plainly: frame the field as a spectrum, not a rivalry. Softmax attention (unbounded state, perfect recall, quadratic) sits at one pole, pure SSM (fixed state, lossy recall, linear) at the other, with linear attention and hybrids occupying the space between — and the SSD result (arXiv:2405.21060) is the mathematical spine that makes this a spectrum rather than a dichotomy, not just a rhetorical convenience.
That conclusion rests on real evidence, not vibes: the NVIDIA 8B study (arXiv:2406.07887) is the cleanest controlled comparison and directly supports "hybrid wins, ~7% attention is enough," and it pairs with Jamba's 1:7 and Granite's 9:1 to show the attention ratio is a settled design region across independent labs, not a single lucky guess.
Two concrete results would move the needle. If a pure-SSM model demonstrated Transformer-level 5-shot MMLU and passed RULER at ≥256K context without any attention layers, the "you need attention for recall" conclusion would weaken materially. If a controlled ≥70B comparison — none exists yet; rigorous baselines top out at ~8B in the NVIDIA study and ~34B in Falcon-H1 — showed the optimal attention fraction rising with scale, the "~7% attention" rule of thumb would need revision upward.
Mamba's "5× throughput" and "matches Transformers twice its size" held at small scale, but the NVIDIA 8B study exposed pure Mamba's clear deficits on recall/ICL/long-context at scale — the community narrative shifted from "Mamba replaces Transformers" (late 2023) to "hybrids are the practical answer" (2024–2026). "SSMs are long-range champions" also does not transfer from S4 to Mamba: S4 excels on LRA while plain Mamba scores ~66% and fails Path-X (see Part 4.3).
SSM cost is still \(O(\text{seq}\cdot d\cdot N)\): the state \(N\) and the per-step \(d\) work are real costs, and Mamba-1's large-state variants were ~3× slower than Mamba-2 in the NVIDIA study.
The \(\mathsf{TC}^0\) ceiling (Merrill et al.) applies without chain-of-thought; intermediate-token generation can lift it, and it applies to Transformers too — so it is a shared limitation, not a Transformer advantage over SSMs.
E.g. "Codestral Mamba beats CodeLlama-34B" and specific throughput multipliers from lab blog posts — treat these as vendor claims pending independent replication. The KV-cache GB figures in this page are computed from the standard formula and scale with precision: FP8 halves and INT4 quarters every number quoted here.
As of mid-2026, no controlled ≥70B architecture comparison exists; rigorous head-to-heads top out at ~8B (NVIDIA) and ~34B (Falcon-H1), so any claim about hybrid behaviour at frontier scale is extrapolation, not measurement. Mamba-3 (arXiv:2603.15569) and the Nemotron 3 family (arXiv:2512.20856 / arXiv:2606.15007) are 2026 preprints postdating most peer review — cite them as such.
Two easy-to-conflate details: S4 is Gu, Goel, Ré (no Gupta); S4D is Gu, Gupta, Goel, Ré (Gupta before Goel).
| # | work | arXiv |
|---|---|---|
| 1 | Gu, Dao — Mamba: Linear-Time Sequence Modeling with Selective State Spaces | 2312.00752 |
| 2 | Dao, Gu — Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality (Mamba-2 / SSD) | 2405.21060 |
| 3 | Lahoti, Li, Chen, Wang, Bick, Kolter, Dao, Gu — Mamba-3: Improved Sequence Modeling using State Space Principles | 2603.15569 |
| 4 | Gu, Dao, Ermon, Rudra, Ré — HiPPO: Recurrent Memory with Optimal Polynomial Projections | 2008.07669 |
| 5 | Gu, Johnson, Goel, Saab, Dao, Rudra, Ré — Combining Recurrent, Convolutional, and Continuous-time Models with Linear State Space Layers (LSSL) | 2110.13985 |
| 6 | Gu, Goel, Ré — Efficiently Modeling Long Sequences with Structured State Spaces (S4) | 2111.00396 |
| 7 | Gupta, Gu, Berant — Diagonal State Spaces are as Effective as Structured State Spaces (DSS) | 2203.14343 |
| 8 | Gu, Gupta, Goel, Ré — On the Parameterization and Initialization of Diagonal State Space Models (S4D) | 2206.11893 |
| 9 | Dao, Fu, Saab, Thomas, Rudra, Ré — Hungry Hungry Hippos: Towards Language Modeling with State Space Models (H3) | 2212.14052 |
| 10 | Choromanski et al. — Rethinking Attention with Performers | 2009.14794 |
| 11 | Yang, Wang, Shen, Panda, Kim — Gated Linear Attention Transformers with Hardware-Efficient Training (GLA) | 2312.06635 |
| 12 | Yang, Kautz, Hatamizadeh — Gated Delta Networks: Improving Mamba2 with Delta Rule | 2412.06464 |
| 13 | Arora et al. — Simple Linear Attention Language Models Balance the Recall-Throughput Tradeoff (Based) | 2402.18668 |
| 14 | Jelassi, Brandfonbrener, Kakade, Malach — Repeat After Me: Transformers are Better than State Space Models at Copying | 2402.01032 |
| 15 | Arora et al. — Zoology: Measuring and Improving Recall in Efficient Language Models (MQAR) | 2312.04927 |
| 16 | Merrill, Petty, Sabharwal — The Illusion of State in State-Space Models | 2404.08819 |
| 17 | Sarrof, Veitsman, Hahn — The Expressive Capacity of State Space Models: A Formal Language Perspective | 2405.17394 |
| 18 | Lieber et al. (AI21) — Jamba: A Hybrid Transformer-Mamba Language Model | 2403.19887 |
| 19 | AI21 — Jamba-1.5: Hybrid Transformer-Mamba Models at Scale | 2408.12570 |
| 20 | Ren et al. (Microsoft) — Samba: Simple Hybrid State Space Models for Efficient Unlimited Context Language Modeling | 2406.07522 |
| 21 | Glorioso et al. (Zyphra) — Zamba: A Compact 7B SSM Hybrid Model | 2405.16712 |
| 22 | Zyphra — Zamba2 Technical Report | 2411.15242 |
| 23 | De et al. (DeepMind) — Griffin: Mixing Gated Linear Recurrences with Local Attention for Efficient Language Models (Hawk/Griffin) | 2402.19427 |
| 24 | DeepMind — RecurrentGemma: Moving Past Transformers for Efficient Open Language Models | 2404.07839 |
| 25 | Waleffe et al. (NVIDIA) — An Empirical Study of Mamba-based Language Models | 2406.07887 |
| 26 | NVIDIA — Nemotron-H: A Family of Accurate and Efficient Hybrid Mamba-Transformer Models | 2504.03624 |
| 27 | NVIDIA — NVIDIA Nemotron Nano 2: An Accurate and Efficient Hybrid Mamba-Transformer Reasoning Model | 2508.14444 |
| 28 | NVIDIA — Nemotron 3 (family report) | 2512.20856 |
| 29 | NVIDIA — Nemotron 3 (companion report) | 2512.20848 |
| 30 | NVIDIA — Nemotron 3 Ultra | 2606.15007 |
| 31 | Zuo et al. (TII) — Falcon Mamba: The First Competitive Attention-free 7B Language Model | 2410.05355 |
Written August 2026, from a single sourced research brief — corrections welcome — l@muehrke.de