AIWiki
Malaysia
Back to all articles
AI Foundationsstate space modelsmambarwkv

State Space Models

4 min readUpdated November 2026
State Space Models
Type
Sequence model architecture family
Also known as
SSM, selective SSM, linear-time sequence models
Key models
S4, Mamba, Mamba-2, RWKV, Jamba, Nemotron-H
Introduced
2021 (S4); mainstream from December 2023 (Mamba)
Core trade-off
Linear-time inference vs exact token retrieval
Related
Transformer architecture, attention mechanism, linear attention
State space models (SSMs) are a family of sequence models that carry a compact, fixed-size recurrent state through a sequence, folding each new token into that state with a structured linear recurrence instead of comparing every token against every other token. The result is inference cost that grows linearly with sequence length rather than quadratically, at the price of weaker exact recall of distant tokens.

History

The line begins with continuous-time state space representations borrowed from control theory and their discretisation for deep learning — the S4 model (2021) first showed that such recurrences could model very long sequences competently, though still trailing attention on language. The breakthrough came in December 2023 with Mamba: Linear-Time Sequence Modeling with Selective State Spaces by Albert Gu and Tri Dao, which made the state update input-dependent (selective) so the model could choose what to remember and what to discard, and paired the algorithm with a hardware-aware parallel implementation.[1] Mamba matched transformer quality on language while decoding at linear cost, and spawned a wave of hybrids.

Mamba-2 (2024) established a formal state space duality showing selective SSMs and a form of masked linear attention are mathematically close relatives — a split that had been blurring ever since. RWKV arrived from the other direction, presenting recurrent efficiency in an attention-shaped, token-parallel training scheme. Research continues: Mamba-3 (ICLR 2026) reports comparable perplexity to Mamba-2 at half the state size using trapezoidal discretisation and multi-input multi-output state updates.[2]

Key Concepts

  • Fixed-size state. Memory does not grow with context length, unlike a transformer's KV cache — the property that makes SSMs attractive for long documents and streaming audio.
  • Linear-time decode. Each step is a constant-cost state update regardless of history length, so throughput and memory scale linearly rather than quadratically with context.
  • Selective memory. Mamba's gating lets the model write or erase state per token, which is what fixed-size recurrences need to behave like attention's database.
  • The recall gap. A fixed-size state cannot store every earlier token exactly, so pure SSMs underperform on retrieval-heavy tasks such as copying names or needles in long contexts. This — not compute — is why the field's verdict is hybrid, not replacement: production models keep a minority of attention layers and replace the rest. NVIDIA's Nemotron-H (2025), which swaps most attention layers for Mamba-2 blocks at 8B, 47B and 56B scales, reports up to roughly 3× faster inference than a comparable transformer at matched or better accuracy.[2][3]

Applications and Impact

SSMs and hybrids matter wherever context is long and latency or memory-bound: real-time speech and voice agents, on-device assistants, streaming sensor data, code repositories, and high-throughput inference serving. They also matter for efficiency economics — a linear-time model serves more tokens per GPU-hour, which is the currency of inference pricing. By 2026 state space models were best understood as a component rather than a rival: hybrid stacks dominate new open-weight releases, and the SSM-versus-linear-attention debate had largely dissolved into one design space.[2]

>Key Takeaways

  • SSMs trade attention's quadratic cost for a linear-time fixed-size state.[1]
  • Mamba (Dec 2023) made the family competitive on language; Mamba-2 linked SSMs to linear attention.[1][2]
  • Their weakness is exact retrieval over long context — hence hybrid models that keep a few attention layers.[3]
  • Hybridisation, not replacement, is the 2026 production consensus.[2]

See Also

🇲🇾Malaysian Context

🇲🇾 Relevance to Malaysia: efficiency is the local lever. Malaysia's edge-AI ambitions — on-device models for Malay-language understanding, AI PCs, embedded vision in manufacturing — fit SSM-style architectures whose fixed state and linear memory fit cheap hardware far better than full-attention transformers. For data-centre-heavy Johor and the National AI Compute Exchange, cheaper per-token serving translates directly into lower cloud prices for Malaysian SMEs. Domestic model efforts such as ILMU and Mesolitica's Malay models can adopt hybrid architectures to serve long Bahasa Melayu conversations without runaway KV-cache memory, and Malaysia's AI talent pipeline under NAITA increasingly treats architecture-level efficiency as a core competency rather than a research curiosity.

References

  1. ↑Gu, A., Dao, T. (2023). Mamba: Linear-Time Sequence Modeling with Selective State Spaces. arXiv:2312.00752. https://arxiv.org/abs/2312.00752
  2. ↑State Space Models in 2026: The Recall Gap, and What Finally Closed It. https://acingai.com/articles/state-space-models-2026
  3. ↑Princeton University. Mamba-3: Improved Sequence Modeling using State Space Principles (ICLR 2026). https://pli.princeton.edu/blog/2026/mamba-3-improved-sequence-modeling-using-state-space-principles