C.W.K.
Stream
Lesson 03 of 05 · published

Mamba-2 and State Space Duality

~15 min · mamba-2, ssd, structured-matrices

Level 0Observer
0 XP0/50 lessons0/14 achievements
0/100 XP to next level100 XP to go0% complete

The unification

Mamba-2 (Dao & Gu, May 2024, arXiv:2405.21060) is the paper that proved a beautiful theoretical result: every SSM equals a structured semiseparable matrix multiplication. The framework that captures this — State Space Duality, SSD — shows that SSMs and linear attention are mathematically the same family of operations, viewed differently. They differ in the constraints they place on the underlying matrix structure, not in their fundamental nature.

This isn't just elegance. The SSD framework gave practitioners a unified recipe for designing efficient sequence models: pick a structured matrix family, get the SSM/linear-attention dual for free. It also explained why all the post-Transformer architectures — RetNet, Mamba, Hawk/Griffin, GLA — were converging on similar performance characteristics. They were all moving on the same mathematical surface, just from different starting points.

The architectural simplification

Mamba-2 also restricted A from full diagonal to a single scalar per head times the identity. That sounds like a loss of expressiveness, and it is, but it makes the entire computation matmul-friendly — the kind of operation NVIDIA's tensor cores are built to accelerate. The result: 2–8× training speedup over Mamba-1, and the ability to grow the per-head state size from N=16 to N=64–256 without proportional cost. Bigger states, more state capacity, less lossy compression.

Hybrid validation at scale

NVIDIA's internal study at 8B scale found that Mamba-2-Hybrid (with a small fraction of attention layers) beats pure Transformer on all 12 standard benchmarks, with an average gain of about +2.65 points. That is the strongest empirical signal anyone has produced for hybrid architectures: not "competitive", not "close", actually better on every task at large scale.

The SSD framework is what made hybrids easy to design. Once you know SSM layers and attention layers are the same family of operations, mixing them isn't an architectural compromise — it's choosing different points on the structured-matrix axis at different depths. That conceptual lubrication is part of why 2024–2026 saw the explosion of hybrid models.

External links

Exercise

Read part 1 of Albert Gu's Mamba-2 blog series (linked above). The key claim to internalize is the equivalence between an SSM operation and a structured matrix multiply. You don't need to follow every derivation — focus on the picture of how the SSM matrix gets factored. Once that picture clicks, the rest of the SSD framework is mostly bookkeeping.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.