Explainer
State-space models and Mamba: alternatives to the transformer
State-space models (SSMs) are a family of sequence models offered as an alternative to the transformer's attention; the authors of Mamba, a 2023 design, report that it scales linearly with sequence length.[1] Mamba lets the model choose what to remember or forget at each token,[2] and labs such as AI21 and NVIDIA have built hybrid models that mix Mamba and transformer layers.[3][4]
This page is part of the Frontier AI course. Read how transformers work and how AI inference works first. Next is how AI agents work.
In 2023 the Mamba authors noted that foundation models, including large language models, were almost universally transformers built around attention.[5] State-space models are one research alternative. They matter because their cost grows more slowly with the length of the text, which affects how cheaply a model can handle long documents and long chains of reasoning.[1][6]
Why look beyond attention?
Transformers are computationally inefficient on very long texts.[5] Many cheaper designs have been tried, but by 2023 none had matched attention on language, according to the Mamba authors.[5] Earlier, the S4 authors had noted that recurrent networks, convolutional networks and transformers all struggled to scale to sequences of 10,000 steps or more.[7]
The Mamba paper lists linear attention, gated convolutions, recurrent models and structured SSMs as subquadratic alternatives developed to address transformers’ inefficiency on long sequences, and says they had not matched attention on language.[5] It attributes this to an inability to perform content-based reasoning.[5]
S4: making state spaces practical
A state-space model reads a sequence one step at a time while keeping a compact running summary, its “state”, much as a person keeps track of a story’s plot. The S4 model, published in 2022, found a way to compute this efficiently and did very well on tests built around long sequences.[8]
S4 (ICLR 2022) starts from the continuous state space model x’(t) = Ax(t) + Bu(t), y(t) = Cx(t) + Du(t) and introduces a parameterization that can be computed much more efficiently than earlier approaches while keeping their theoretical strengths.[8] It reported state-of-the-art results on every Long Range Arena task, including the 16,000-step Path-X task.[8]
Mamba: selective state spaces
Mamba’s key change is letting the model decide, based on the current word, what to keep in its running summary and what to forget.[2] Its authors reported that it handles text in time proportional to its length and that a 3-billion-parameter Mamba matched transformers twice its size.[1]
Mamba makes the SSM parameters functions of the input, so it can selectively propagate or forget information along the sequence, and compensates for losing efficient convolutions with a hardware-aware parallel algorithm in recurrent mode; the network has no attention or MLP blocks.[2] The authors report linear scaling in sequence length, five times the inference throughput of transformers, and a Mamba-3B that outperformed same-size transformers and matched ones twice its size.[1] These results come from the arXiv preprint. Mamba-2 (ICML 2024) then showed formal connections between SSMs and variants of attention, which it calls state space duality, and reported a core layer 2 to 8 times faster than Mamba’s.[9]
Hybrids: Mamba plus attention
Labs including AI21 and NVIDIA have built larger models that mix the two. AI21 Labs reports that Jamba interleaves transformer and Mamba layers with mixture-of-experts layers, fits in one 80GB GPU in its released configuration, and performs strongly at contexts of up to 256,000 tokens.[3] NVIDIA reports that Nemotron-H replaces most self-attention layers with Mamba layers, which need constant computation and memory per generated token, and runs up to three times faster at inference than similar-size transformers with similar or better accuracy.[4] NVIDIA ties the design to inference-time scaling for reasoning, which makes cheap inference more important.[6]
What is known and what is open
Known: peer-reviewed work shows SSMs can model long sequences efficiently, and the Mamba-2 authors report that SSMs match or beat transformers at small to medium scale.[8][9] Open: whether pure SSMs can match transformers at frontier scale. The large models described here are hybrids that keep some attention, and their performance figures are the developers’ own.[3][4]
Read next
Next in the crash course
What are computer-use agents? AI that clicks and types on a screen
How computer-use AI agents work: the screenshot-and-action loop, the OSWorld and WebArena benchmarks, how scores have changed, and the risks.
Questions readers ask
What is a state-space model in AI?
A sequence model built on the classical state space equations, x'(t) = Ax(t) + Bu(t), y(t) = Cx(t) + Du(t), which keep a running internal state as they read a sequence. S4 made this approach much more efficient to compute.[8]
What is Mamba?
A 2023 architecture that makes the state-space parameters depend on the input, so the model can selectively keep or forget information token by token. It uses no attention blocks.[2]
Sources
· 9 claims from 5 publishers
Each numbered claim is a statement we checked against the sources listed with it. Tap a number in the text to see its sources in place.
- [1]
The Mamba authors report linear scaling in sequence length, five times higher inference throughput than transformers, and that their Mamba-3B model outperformed transformers of the same size and matched transformers twice its size on language modelling. reportedas of 2026-11-22
- Mamba: Linear-Time Sequence Modeling with Selective State Spaces (arXiv:2312.00752) · Carnegie Mellon University and Princeton University (preprint on arXiv) · Secondary source · 2023-12-01 · Abstract (retrieved 2026-11-22)
- Mamba: Linear-Time Sequence Modeling with Selective State Spaces (arXiv:2312.00752) · Carnegie Mellon University and Princeton University (preprint on arXiv) · Secondary source · 2023-12-01 · Abstract (retrieved 2026-11-22)
- [2]
Mamba makes the state space model's parameters functions of the input, letting it selectively propagate or forget information depending on the current token, and uses a hardware-aware parallel algorithm in recurrent mode; the architecture has no attention or MLP blocks. reportedas of 2026-11-22
- Mamba: Linear-Time Sequence Modeling with Selective State Spaces (arXiv:2312.00752) · Carnegie Mellon University and Princeton University (preprint on arXiv) · Secondary source · 2023-12-01 · Abstract (retrieved 2026-11-22)
- Mamba: Linear-Time Sequence Modeling with Selective State Spaces (arXiv:2312.00752) · Carnegie Mellon University and Princeton University (preprint on arXiv) · Secondary source · 2023-12-01 · Abstract (retrieved 2026-11-22)
- Mamba: Linear-Time Sequence Modeling with Selective State Spaces (arXiv:2312.00752) · Carnegie Mellon University and Princeton University (preprint on arXiv) · Secondary source · 2023-12-01 · Abstract (retrieved 2026-11-22)
- [3]
AI21 Labs reports that Jamba interleaves transformer and Mamba layers with mixture-of-experts layers, fits in a single 80GB GPU in its released configuration, and shows strong results at context lengths of up to 256,000 tokens. reportedas of 2026-11-22
- Jamba: A Hybrid Transformer-Mamba Language Model (arXiv:2403.19887) · AI21 Labs (technical report on arXiv) · Secondary source · 2024-03-28 · Abstract (retrieved 2026-11-22)
- Jamba: A Hybrid Transformer-Mamba Language Model (arXiv:2403.19887) · AI21 Labs (technical report on arXiv) · Secondary source · 2024-03-28 · Abstract (retrieved 2026-11-22)
- Jamba: A Hybrid Transformer-Mamba Language Model (arXiv:2403.19887) · AI21 Labs (technical report on arXiv) · Secondary source · 2024-03-28 · Abstract (retrieved 2026-11-22)
- Jamba: A Hybrid Transformer-Mamba Language Model (arXiv:2403.19887) · AI21 Labs (technical report on arXiv) · Secondary source · 2024-03-28 · Abstract (retrieved 2026-11-22)
- [4]
NVIDIA reports that its Nemotron-H hybrid models replace most self-attention layers with Mamba layers, which use constant computation and memory per generated token, and are up to three times faster at inference than similarly sized transformers with similar or better accuracy. reportedas of 2026-11-22
- Nemotron-H: A Family of Accurate and Efficient Hybrid Mamba-Transformer Models (arXiv:2504.03624) · NVIDIA (technical report on arXiv) · Secondary source · 2025-04-04 · Abstract (retrieved 2026-11-22)
- Nemotron-H: A Family of Accurate and Efficient Hybrid Mamba-Transformer Models (arXiv:2504.03624) · NVIDIA (technical report on arXiv) · Secondary source · 2025-04-04 · Abstract (retrieved 2026-11-22)
- [5]
The Mamba paper (2023 preprint) says foundation models are almost universally based on the transformer and its attention module, and that subquadratic alternatives such as linear attention, gated convolution, recurrent models and structured state space models, developed to address transformers' computational inefficiency on long sequences, had not performed as well as attention on language; it identified their inability to do content-based reasoning as a key weakness. reportedas of 2026-11-22
- Mamba: Linear-Time Sequence Modeling with Selective State Spaces (arXiv:2312.00752) · Carnegie Mellon University and Princeton University (preprint on arXiv) · Secondary source · 2023-12-01 · Abstract (retrieved 2026-11-22)
- Mamba: Linear-Time Sequence Modeling with Selective State Spaces (arXiv:2312.00752) · Carnegie Mellon University and Princeton University (preprint on arXiv) · Secondary source · 2023-12-01 · Abstract (retrieved 2026-11-22)
- Mamba: Linear-Time Sequence Modeling with Selective State Spaces (arXiv:2312.00752) · Carnegie Mellon University and Princeton University (preprint on arXiv) · Secondary source · 2023-12-01 · Abstract (retrieved 2026-11-22)
- Mamba: Linear-Time Sequence Modeling with Selective State Spaces (arXiv:2312.00752) · Carnegie Mellon University and Princeton University (preprint on arXiv) · Secondary source · 2023-12-01 · Abstract (retrieved 2026-11-22)
- [6]
NVIDIA's Nemotron-H report links the interest in efficient architectures to inference-time scaling for reasoning, saying it is increasingly important to build models that are efficient to run. reportedas of 2026-11-22
- Nemotron-H: A Family of Accurate and Efficient Hybrid Mamba-Transformer Models (arXiv:2504.03624) · NVIDIA (technical report on arXiv) · Secondary source · 2025-04-04 · Abstract (retrieved 2026-11-22)
- [7]
The S4 paper notes that RNNs, CNNs and transformers struggle to scale to very long sequences of 10,000 or more steps. reportedas of 2026-11-22
- Efficiently Modeling Long Sequences with Structured State Spaces (arXiv:2111.00396) · Stanford University (arXiv; published at ICLR 2022) · Secondary source · 2021-10-31 · Abstract (retrieved 2026-11-22)
- [8]
The S4 paper (ICLR 2022) built on the classical state space model, x'(t) = Ax(t) + Bu(t), y(t) = Cx(t) + Du(t), and introduced a parameterization that can be computed much more efficiently than prior approaches, reporting state-of-the-art results on every Long Range Arena task including the 16,000-step Path-X task. reportedas of 2026-11-22
- Efficiently Modeling Long Sequences with Structured State Spaces (arXiv:2111.00396) · Stanford University (arXiv; published at ICLR 2022) · Secondary source · 2021-10-31 · Abstract (retrieved 2026-11-22)
- Efficiently Modeling Long Sequences with Structured State Spaces (arXiv:2111.00396) · Stanford University (arXiv; published at ICLR 2022) · Secondary source · 2021-10-31 · Abstract (retrieved 2026-11-22)
- [9]
The Mamba-2 paper (ICML 2024) showed theoretical connections between state space models and variants of attention, a framework it calls state space duality, and reported a core layer 2 to 8 times faster than Mamba's while staying competitive with transformers on language modelling; it also notes that SSMs such as Mamba had been shown to match or outperform transformers at small to medium scale. reportedas of 2026-11-22
- Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality (arXiv:2405.21060) · Princeton University and Carnegie Mellon University (arXiv; published at ICML 2024) · Secondary source · 2024-05-31 · Abstract (retrieved 2026-11-22)
- Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality (arXiv:2405.21060) · Princeton University and Carnegie Mellon University (arXiv; published at ICML 2024) · Secondary source · 2024-05-31 · Abstract (retrieved 2026-11-22)
- Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality (arXiv:2405.21060) · Princeton University and Carnegie Mellon University (arXiv; published at ICML 2024) · Secondary source · 2024-05-31 · Abstract (retrieved 2026-11-22)
Revision history (1)
- Page created.
Created Nov 22, 2026. Last reviewed by an editor on Nov 22, 2026. Next scheduled review: Aug 9, 2027.
Cite this page
"State-space models and Mamba: alternatives to the transformer." ContentLora, updated Nov 22, 2026. https://contentlora.com/explain/state-space-models-explained
Spotted an error? Suggest a correction or emailcorrections@contentlora.com.