In one line: Made SSM parameters (B, C, delta) input-dependent, breaking LTI so the model selectively remembers or forgets per token, and paired it with a fused parallel-scan GPU kernel; in the paper's scaling runs (the Pile, 125M to 1.3B) the first attention-free model to match Transformer++ perplexity, with linear-time training and 5x generation throughput, seeding today's hybrid attention-SSM production models.
How far to trust it: Believe the mechanism: letting the input set Delta, B and C is what lets a recurrent model select, the synthetic gaps are huge, and this page's toy reproduces the selective-copying one. Read "Transformer quality" narrowly: models stop at 2.8B, every number is one run, the 5x throughput is against the unoptimised Hugging Face Transformer, and a later same-data 8B study found pure Mamba level on common zero-shot tasks but 18 points behind on 5-shot MMLU, which is why production models became hybrids. The evidence, point by point.
The idea in one sentence: let the state space model's step size Δ and its input and output maps B and C depend on the current token, so a fixed-size recurrent state can choose what to keep and what to skip; that kills the fast convolution, so a fused, hardware-aware scan computes the recurrence in GPU SRAM instead, and the result trains in linear time, generates without a KV cache, and matches Transformers on language up to 3B parameters.
You need: a linear recurrence with a fixed state and how S4 turns it into a convolution; both are taught on Beyond attention, which also owns Mamba-2 and the hybrids. The KV cache it is compared with is sized on Long context.
New terms
Transformers pay quadratic compute in sequence length to train and keep a KV cache that grows with every generated token (§1). Subquadratic alternatives (linear attention, gated convolutions such as H3 and Hyena, RWKV, RetNet, structured state space models like S4) scale better but had never matched attention on dense, discrete data like language (§2).
The paper's diagnosis is a framing: sequence modelling is compressing context into a state (§3.1). Attention is effective and slow for the same reason, it does not compress at all; a recurrent model is fast because its state is fixed, and only as good as what it kept. Every efficient SSM before Mamba was linear time-invariant (LTI): the same dynamics at every step, which lets it run as one global convolution and stops it deciding, token by token, what to store.
The same contrast in general, at a 2026 hybrid's shapes, is Fig. 1 of Beyond attention; this stage keeps to the paper's own pair, Pythia-2.8B against Mamba-2.8B.
Counters from the released configs (derived in recompute.py): Pythia-2.8B caches 2 × 32 layers × 2,560 numbers per token, 320 KiB in bf16; Mamba-2.8B keeps a 5,120 × 16 state and a 5,120 × 3 convolution buffer in each of 64 blocks, 11.9 MiB at any length. They cross at 38 tokens; at 2,048 the cache is 54 times the state.
Synthetic tasks make the limit concrete (Figure 2). Plain Copying has constant spacing, so a convolution kernel of the right length solves it. Selective Copying scatters the tokens to remember among noise, and Induction Heads asks for the token that followed an earlier occurrence of the current one ("Harry Potter ... Harry → Potter"), a test the paper calls predictive of in-context learning (§4.1.2). Both need content-aware filtering; with varying spacing no static kernel lines inputs up with outputs.
A structured SSM (S4) maps each channel of the input through an N-dimensional latent state, defined in continuous time and then discretised with a step size Δ (Eqs. 1 to 3):
That is the S4 family the paper starts from, taught on Beyond attention. What matters here: being LTI is what let it run as one global convolution, and its state is D × N per sequence (A diagonal), which over a batch costs O(BLDN) to materialise, the bottleneck §3.3 attacks.
The usual rule is the zero-order hold, A = exp(ΔA), B = (ΔA)−1(exp(ΔA) − I) · ΔB (Eq. 4). Because (Δ, A, B, C) are the same at every step, the output is one convolution, y = x ∗ K, K = (CB, CAB, …) (Eq. 3): S4 trains in parallel by FFT and generates recurrently in constant time per step. A is diagonal, so each matrix is N numbers per channel; with D channels the state is D × N per sequence, and materialising it over a batch costs O(BLDN), the bottleneck §3.3 attacks. The convolution is what let LTI SSMs expand the state by N ≈ 10 to 100 over a classic RNN for free (§3.3.1).
The baselines all live in this family and are all LTI (§2): linear attention is a degenerate linear SSM, H3 wraps S4 in two gates, Hyena swaps in an MLP-parameterised convolution, RetNet uses state size 1, RWKV a ratio of two SSMs.
Make Δ, B and C functions of the current token (§3.2): Bt = LinearN(xt), Ct = LinearN(xt) and Δt = softplus(Parameter + BroadcastD(Linear1(xt))). The parameters gain a length dimension, so the model becomes time-varying and the convolution is gone; the paper calls the result S6 (S4 plus selection, computed with a scan; Remark 3.1). A stays a plain parameter, because Δ already makes A = exp(ΔA) input-dependent, and the authors expect a selective A to perform about the same (§3.5.2).
| Tensor | Algorithm 1: S4, time-invariant | Algorithm 2: S6, selective |
|---|---|---|
| A | (D, N) parameter | (D, N) parameter |
| B, C | (D, N) parameters | (B, L, N) = LinearN(x) |
| Δ | (D) = τΔ(Parameter) | (B, L, D) = τΔ(Parameter + sΔ(x)) |
| A, B | (D, N) | (B, L, D, N) |
| compute | recurrence or convolution | recurrence (scan) only |
The paper reads each piece mechanically (§3.5.2): large Δ resets the state and focuses on xt, Δ near 0 keeps the state and skips the token; selective B controls what enters the state, selective C what leaves it. Hence variable spacing (fillers such as "um" can be ignored), filtering context (performance should improve with more context, not degrade) and boundary resetting (packed documents need not bleed into each other).
The paper's Table 1: the Mamba block with an S4 layer gets 56.4%, with Hyena 28.4%, with the selective S6 layer 99.8%; S4 with no gating at all gets 18.3%, and S6 with no gating still 97.0%. The selection, not the block, does the work: gating in an architecture does not interact along the sequence and cannot change the spacing between tokens (§4.1.1, Appendix A). This page's toy, same block both ways (2 layers, D = 32, N = 16), measured on 1,000 fresh sequences: selective of copied tokens, LTI . Watch both in the stage beside this section.
The stage runs one sequence (48 positions, 6 data tokens among grey noise, then 6 markers) through two trained toy models live, forward pass checked against PyTorch. Drawn from layer 1 at each position: Δt per channel (64 purple bars, one per column of the state), Bt (green, left) and Ct (gold, right) along the state axis, and the state h itself, 64 channels × 16, as cells on a glass plate (blue positive, orange negative). In the time-invariant model B and C differ per channel, so the bars show the outlined channel's.
Beyond attention (§4, Fig. 4) measures the same selection inside a trained tiny GPT, as the decay each token gets; this stage shows the paper's own synthetic task.
The most important connection, the paper says, is that classical RNN gating is a special case of selection (§3.5.1). Theorem 1: with N = 1, A = −1, B = 1, sΔ = Linear(x) and τΔ = softplus, the selective recurrence is exactly the gated RNN
This is why Δ is projected from the input to one dimension and broadcast: if a token should be ignored, all channels should ignore it.
The proof (Appendix C) is two lines of zero-order hold: exp(−softplus(z)) = 1/(1 + ez) = 1 − σ(z), and B = 1 − A. In the experiments Δ's bias is initialised to τΔ−1(Uniform[0.001, 0.1]), and the projection is widened from 1 to a small rank R (§3.6); the released code uses R = ⌈D/16⌉, 160 for Mamba-2.8B.
Try it: slide z down and the gate closes (Δ → 0, A → 1: keep the state, skip the token); slide it up and the token replaces the state. Solid lines are the theorem's zero-order hold; the dashed line is B as the released code computes it (selective_scan_ref): the first-order B = ΔB, equal to the gate for small Δ and larger beyond (at z = 2, 2.13 against 0.88). So the shipped models are not exactly the theorem's gated RNN; this page's toys follow the code.
Time-varying parameters kill the convolution, and the plain recurrence is sequential and would materialise A, B and the state, each (B, L, D, N), N times the size of input and output (§3.3.2). But the recurrence costs O(BLDN) FLOPs against the convolution's O(BLD log L) with a lower constant, and outside matrix multiplication GPUs are limited by memory bandwidth, so the cost to cut is memory traffic. Three classical techniques do it: kernel fusion and recomputation (the stage beside this, run at Figure 8's setting) and a parallel scan (further down).
Try it: HBM traffic of one scan, counted in elements from the steps of Appendix D (batch 1): naive writes A, B and h to HBM and reads them back; fused reads Δ, A, B, C, x once and writes y. The ratio grows with N, not L. Counted, not measured: at the paper's benchmark setting (D = 1,024, N = 16) it is about 33, against a measured 20 to 40 (§4.5).
The recurrence is linear, and pairs (a, b) meaning h ↦ ah + b compose associatively, so a work-efficient (Blelloch) scan gets every ht in O(log L) parallel steps. The card runs eight positions with real numbers, one channel and one state entry, both ways.
Earlier SSM architectures interleaved an H3 block with an MLP block; Mamba merges them into one block repeated homogeneously, like the gated attention unit (§3.4, Figure 3): expand D by E = 2 with two input projections; on the main branch a short causal convolution, SiLU and the selective SSM; on the other SiLU as a multiplicative gate; project back down. Against H3 it replaces the first gate with an activation; against the gated MLP (SwiGLU) it adds the SSM. Stack with RMSNorm and residuals: no attention, no separate MLP (an optional LayerNorm, after RetNet, can sit before the output projection).
Two further choices (§3.6): states are real, not complex, by default (complex helps on continuous signals such as audio, the one experiment that switches it), and A is initialised S4D-Real, An = −(n + 1), with the expectation that many initialisations work at scale.
Redrawn from Figure 3; parameters from the released code's shapes (mamba_simple.py) at D = 2,560. Projections are 3ED2 = 6D2; the SSM's own parameters add 4.7%, so two blocks are 1.05 × 12D2, one attention plus MLP pair: Mamba-2.8B has 64 blocks where a 2.8B Transformer has 32 layers.
Synthetics (§4.1). Selective Copying at length 4,096 with 16 tokens: S6 gets 99.7 to 99.8% inside H3 or Mamba blocks, every LTI layer 18.3% to 57.0% (Table 1). Induction Heads, 2-layer models trained at 256: Mamba is perfect up to 220 = 1,048,576, 4,096 times the training length (the text rounds to 4,000), while no other model goes beyond twice; attention was tested only to 16,384 for memory (Table 2, numbers in Table 11).
In the paper (Table 11, trained at 256) only Mamba: MHA-RoPE falls to 31% at 4 times the length and 5.5% at 64 times, Mamba stays perfect to 4,096 times. This page's toys (trained at 64, dashed) reproduce the ordering but not the "indefinitely": the selective model holds 98% at 4 times, where attention is at 13%, and then fades towards chance (1 in 15) by 64 times. Retraining it for 20,000 steps instead of 1,500 did not help. The paper's model is twice as wide and was trained on sequences 4 times as long, for 200K steps. Run them at any length in Run a toy Mamba.
Language (§4.2). Under the Chinchilla protocol from about 125M to 1.3B on the Pile (Figure 4, sizes in Table 12), Mamba is the first attention-free model to match "Transformer++" (GPT-3 shapes plus rotary embeddings, SwiGLU, RMSNorm, no biases, higher learning rates), with the gap favouring Mamba at 8K context. Trained to 300B tokens with Pythia's data and tokenizer, every Mamba is best in its size class on every column of Table 3 (45 of 45 cells, one tie); Mamba-2.8B beats Pythia-2.8B on all six tasks (average 63.3 against 59.1) and Pythia-6.9B on the average (61.7). "Matches baselines at twice the model size" holds for three of five sizes, not at 130M or 370M (recount).
Average zero-shot accuracy against parameters, from Table 3 (log scale). Mamba, Pythia and RWKV share the Pile, the GPT-NeoX tokenizer and 300B tokens; the other baselines (GPT-Neo, OPT, Hybrid H3) differ in data or tokenizer. The paper's averages recompute exactly from its six columns.
DNA (§4.3). On one human genome (HG38, about 4.5 billion base pairs) Mamba matches Transformer++ and HyenaDNA with about 3 to 4 times fewer parameters at the largest size, about 40M (Figure 5, a figure with no table); at fixed size (about 1.4M) its perplexity keeps improving out to 1M-token context while HyenaDNA's gets worse. On five great apes sharing 99% of their DNA, a 7M Mamba fine-tuned at 1M context reaches 81.3% against HyenaDNA's 54.9% (chance 20%; Table 13).
Audio (§4.4): Mamba blocks in place of SaShiMi's S4 + MLP improve long-context piano modelling and SC09 speech generation (FID 0.94 for a 6.1M Mamba against 1.42 for the 23M DiffWave + SaShiMi).
Swapping SaShiMi's S4 + MLP blocks for Mamba blocks: on YouTubeMix piano both improve with context and Mamba more, up to near-minute sequences at fixed compute (the one experiment with complex states). On SC09 spoken digits a 6.1M Mamba beats the larger GAN and diffusion models, FID 0.94 against 1.42 for the 23M DiffWave + SaShiMi, and a 24.3M one gets 0.67 (Table 4); Mamba blocks beat S4 + MLP in the outer U-Net stages, and in the center Mamba beats S4 + MLP, which beats attention (Table 5).
Speed and memory (§4.5, Figure 8). With N = 16 the fused scan beats FlashAttention-2 beyond length 2K and a PyTorch scan by 20 to 40 times; generation throughput is 4 to 5 times a same-size Transformer's because, with no KV cache, Mamba runs far larger batches (even an untrained Mamba-6.9B out-generates a Transformer five times smaller). Training memory at 125M is "comparable" to the best Transformer: in Table 15 Mamba needs 4% to 12% more.
Try it: why no KV cache means bigger batches: per-sequence memory of Pythia-2.8B (KV cache) and Mamba-2.8B (state) in bf16 from their configs, and how many sequences fit beside the 5.6 GB of weights. Illustrative: it ignores activations and allocator overhead; the paper's test uses prompt 2,048 plus 128 tokens (Appendix E.5).
Ablations at about 350M (§4.6). LTI layers barely differ from each other (within 0.3 perplexity) and real equals complex for text; S6 gives a large gain in either block (Mamba 10.56 → 8.69, H3 10.34 → 8.95; Table 6). Δ is the most important selective parameter (10.93 → 9.81 alone) and the three together beat any one (Table 7); real initialisations beat complex S4D-Lin when selective (Table 8); a rank-1 Δ projection gives most of its gain (Table 9).
From Table 10: with constant B, C, 9.88 → 9.81 (0.07); with selective B, C, 9.73 → 8.71 (1.02) for 367.1M → 371.5M parameters (+1.2%). A bigger state only helps if the model can choose what to write into it and read out of it, the paper's core motivation (§3.1, §3.3).
What holds up. The mechanism and the synthetic evidence. The selective-copying gap (99.8% against 56.4% in the same block) dwarfs any plausible noise, the ablations agree (selective Δ, B, C each help; a larger state helps only when selective), and this page's toy reproduces the gap independently (it does not reproduce the indefinite induction-heads extrapolation: its selective model fades after about 8 times the training length). The language comparison is fairer than most: Mamba, Pythia and RWKV share data, tokenizer and token count, and with binomial errors from the evaluation set sizes the 2.8B gains on HellaSwag (+6.8, about 10 standard errors), LAMBADA (+4.5, 4.9) and ARC-Easy (+5.6, 4.1) are solid, WinoGrande (+3.8, 2.0) and ARC-Challenge (+3.4, 1.7) marginal, PIQA (+1.2, 0.8) noise (recount; conservative, since both models answer the same questions). Checkpoints and evaluation commands are public, an independent 8B study confirmed parity on these tasks, and the authors state their own limit: nothing above 3B, and scaling "may involve further engineering challenges" (§5).
What to discount:
Verdict: believe that selection is the missing ingredient that makes recurrent state-space models competitive, and that they generate far more cheaply; the synthetic and ablation evidence is strong and reproduces. Treat "Transformer quality" as true for perplexity and common zero-shot tasks at up to 3B parameters, from single runs; it does not extend to recall-heavy use, which is exactly where later work found the gap and why the field settled on hybrids.
Mamba ended the era in which subquadratic meant worse: a recurrent model with input-dependent dynamics matched Transformer perplexity and common benchmarks while training in linear time and generating with constant state. The compression framing stuck (attention is the no-compression extreme, a classic RNN the full-compression one, selectivity the knob between), and with FlashAttention, by the same author, it cemented the pattern that architecture design and GPU memory-hierarchy design are one discipline.
The authors followed up twice; both are taught on Beyond attention and summarised here. Mamba-2 (Dao and Gu, 2024) introduced state space duality: selective SSMs and masked attention are both structured semiseparable matrices; a scalar A per head turns the scan into matrix multiplications, simpler and 2 to 8 times faster, with much larger states (released default N = 128) and a clean bridge to attention theory. Mamba-3 (Lahoti et al., 2026) went "inference-first" (a more expressive discretisation, complex-valued state for state tracking, multi-input multi-output) and reports Mamba-2's perplexity at half the state size.
In production the winner is the hybrid: a few full-attention layers for exact recall, SSM or linear-attention layers for cheap length (each drawn from its config in Then and now; the design space is on Beyond attention). Pure SSMs stay rarer because exact long-range retrieval still favours some attention, but the selective recurrence is now standard infrastructure for long context, edge inference and non-text sequences (DNA, audio, time series, vision backbones).
AI21's Jamba (1 attention layer in 8, plus MoE); NVIDIA's Nemotron-H (Mamba-2 plus attention, up to 3× faster than similar Transformers at similar accuracy), the architecture its Nemotron Nano 2 reasoning models build on, and Nemotron 3 Nano; IBM's Granite 4.0-H; TII's Falcon-H1 (attention and Mamba-2 side by side in every layer). Frontier labs ship the same idea with linear or sliding-window hybrid layers to cut long-context prefill and KV-cache cost (for example MiniMax's lightning attention).
Five small models trained offline on the paper's two synthetic tasks (§4.1) and run here in plain JavaScript: the Mamba block exactly as the released code builds it, with the selective layer (S6) or with Δ, B, C frozen into constants (S4, time-invariant), plus a small Transformer for comparison. Everything below is computed live from their weights.
Every model: 2 layers, D = 32, E = 2 (64 inner channels), N = 16, convolution width 4, Δ rank ⌈32/16⌉ = 2, S4D-Real initialisation of A, Δ bias from Uniform[0.001, 0.1], RMSNorm, tied embeddings, discretisation as the code (A = exp(ΔA), B = ΔB). The Transformer: 2 layers, 4 heads with RoPE, SwiGLU MLP of width 64, RMSNorm, no biases (the paper's MHA-RoPE baseline in miniature). Trained with AdamW (0.9, 0.95), constant learning rate 1e-3 after 200 warmup steps (the paper uses constant rates for these tasks), batch 32, fresh random sequences every step, at most 8,000 steps, stopping early once 500 held-out sequences were all right three checks running. "Held out" is 1,000 sequences from a separate seed; none of them occurred in the training stream (checked by hashing every training sequence). Weights shipped at 6 bits per matrix entry.
Click a position to cycle its token (noise, then the 8 colours); the six markers at the end ask for the data tokens in order. The task generator always places exactly 6 data tokens; with more or fewer you are testing outside the training distribution, which is a fair experiment to try.
Try: put two data tokens next to each other, or one at position 1 and one at 48: the selective model does not care about spacing. Then look at the Δ strips (averaged over channels): in the selective model they move with position and at the markers rather than spiking on the coloured tokens (the textbook picture is not what this toy learned; see the Selection stage on The paper tab); in the time-invariant one they are flat by construction.
Each sequence is random tokens with one trigger token (▲) placed once and followed by the answer; the trigger appears again as the last token and the model must output the answer. All three models were trained only at length 64.
Try: start at 64 (all three are right), then 256, 1,024 and 16,384. The Mamba models run in recurrent mode, one token at a time with a fixed state, so their cost grows linearly and their memory not at all; the attention model is quadratic and is only run up to 4,096 here (the paper stopped at 16,384 for memory). Long lengths take a few seconds.
Measured offline in PyTorch on the shipped (quantised) weights, from 26 to 220 = 1,048,576 tokens (200 sequences per length up to 4,096, then 64, then 16 from 217; attention to 213, which already took 12 minutes on a shared CPU), against the paper's Table 11 (trained at 256). The x axis is the test length divided by the training length, so the two line up.
Straight from the training logs (every 250 steps; accuracy on 500 held-out sequences, loss of the current batch), not smoothed.
Every table that carries the argument (Tables 1 and 3 open, the rest in closed blocks), transcribed from the arXiv HTML (v2) with the printed precision, plus the checks this page ran on them. Numbering follows the PDF; arXiv's HTML renders Tables 1, 2, 4, 5 and 7 to 10 as figures with other numbers, so each link goes to the HTML anchor. Version 1 and version 2 print the same numbers in every table (compared word by word).
Rows are architectures (no gate, H3, Mamba), columns the inner sequence layer; length 4,096, 16 tokens to memorise, 2 layers, D = 64, 400K steps (Table 1, Appendix E.1). The bottom row is this page's toy, same block both ways, length 48 with 6 tokens.
Defaults reproduce the direction independently: the toy's selective and LTI layers land at and , the paper's at 99.8% and 56.4%.
Test accuracy (%) by test length; models trained at 28 = 256 (bold column). ✓ is perfect generalisation, × out of memory (Table 11). The toy rows were trained at 64, so their columns are shifted to line up the same multiples of the training length.
Click a column heading to sort. Bold as printed (read from the HTML markup). Pile perplexity only for the models trained on the Pile with the NeoX tokenizer. HellaSwag and ARC-Challenge are length-normalised accuracy; LAMBADA, PIQA, ARC-Easy and WinoGrande plain accuracy (Appendix E.2.3). Averages recompute from the six accuracy columns for every row.
Standard error of a difference of two accuracies, √(p₁(1 − p₁)/n + p₂(1 − p₂)/n), with n the size of the split lm-evaluation-harness scores (LAMBADA test, HellaSwag validation, PIQA validation, ARC test, WinoGrande validation). It treats the two models as independent samples; they answer the same questions, so the true (paired) error is smaller and these z values are conservative. It says nothing about training-run noise, which one run per model cannot measure.
Table 10 (state size) is the chart behind the third predict question on The paper tab: constant B, C gain 0.07 from N = 1 to 16, selective 1.02, for +1.2% parameters (Table 10). All single runs; the smallest gaps here (8.97 against 8.97, 8.71 against 8.71, 8.83 against 8.84) are ties, not rankings.
Accuracy (%) after fine-tuning at each length with a model pretrained at that length; chance is 20% (Table 13). The last row is this page's subtraction: the sign changes three times, and the 220 column is a single run.
NLL, FID and AM lower is better; IS and mIS higher (Tables 4 and 5). Best per column outlined, excluding the train and test data rows. Table 5 ablates 6M-parameter U-Nets by the block used in the outer stages and in the center.
One A100 80GB, length 2,048, against a Transformer with FlashAttention-2 and torch.compile kernel fusion (Table 15). The caption says "comparable"; the last column is this page's ratio.
From each checkpoint's config.json (mamba-130m and its siblings) and the shapes in mamba_simple.py: per block in_proj D × 4D, conv 2D × 4 + 2D, x_proj 2D × (R + 32), dt_proj R × 2D + 2D, A_log 2D × 16, skip 2D, out_proj 2D × D, norm D, with R = ⌈D/16⌉; plus one tied embedding of the vocabulary 50,277 padded to 50,280. Every name reproduces independently. The scaling-law runs use the GPT-3 shapes of Table 12, below, with Mamba at twice the layers.
What happened to the architecture after the paper, one released model at a time, each drawn from its own config.json: which layers mix tokens with attention and which with a state space layer, and what that costs in memory at inference. Attention layers pay a KV cache that grows with every token; SSM layers pay a fixed state.
The same models drawn as 3D layer patterns, with a cache rising on each attention layer, are Fig. 5 of Beyond attention, which owns the hybrids.
One square per layer, in order. KV cache per token = 2 × attention layers × KV heads × head size × 2 bytes; state per sequence = SSM layers × (inner width × state size + convolution buffer) × 2 bytes; both bf16, from each model's config.json (sources in each step). Jamba and Granite also replace most MLPs with mixtures of experts, Nemotron 3 Nano too; that changes compute, not the cache.
Try it: cache plus state per sequence for every model above at the chosen context (log scale). Over the whole range the pure SSMs are cheapest and flat; the 2.7B Transformer's cache already passes Mamba's whole state at 38 tokens. At 128K tokens the hybrids need between about a third (Mamba-2 + attention, 6 attention layers of 64) and a fiftieth (Nemotron 3 Nano, 6 attention layers with 2 KV heads) of the Transformer's 40 GiB: their cost is still almost all cache, so the number and width of the attention layers decide it. Mamba-3 (2026) is not drawn: it changes the layer (a more expressive discretisation, complex-valued state, multi-input multi-output) and reports Mamba-2's perplexity at half its state size (Lahoti et al.), but no config of a released language model of that family was used here.
Every link opens in a new tab. Reading time of the resources below: 6h 30m.
COLM 2024, the paper itself (v2; arXiv's HTML numbers several of the PDF's tables as figures, so this page uses the PDF's numbering and links the HTML anchor); the HTML version has the anchors this page links to. abstract page, PDF.
(1h)
code and checkpoints, Apache 2.0 (repo, about 20 minutes for the README and entry path); also holds Mamba-2 and Mamba-3.
(20 min)
Maarten Grootendorst: the best intuition-first walkthrough, from RNN/CNN duality through selectivity, with excellent diagrams.
(35 min)
Sasha Rush: executable notebook covering the S4 lineage Mamba builds on; essential background for the discretization and convolution-mode math.
(1h 30m)
Sasha Rush: reimplements the selective scan kernel step by step in Triton; the fastest route to actually understanding the hardware-aware algorithm.
(1h)
Tri Dao and Albert Gu: the authors' own follow-up explaining how selective SSMs and attention are two views of the same family of structured matrices (the series is four parts).
(1h 15m)
Waleffe et al., NVIDIA (with Gu and Dao), 2024: the controlled test the paper could not run: 8B Mamba, Mamba-2, Transformer and a hybrid on the same 1.1T and 3.5T tokens; where pure SSMs match Transformers and where they do not (5-shot MMLU, Phonebook, long context).
(40 min)
Hugging Face docs: how to load the released checkpoints (for example state-spaces/mamba-130m-hf) without the CUDA kernels; the quickest way to try one.
(10 min)
2017: the architecture Mamba positions itself against; Mamba trades exact-recall KV cache for compressed recurrent state.
2022: same author (Dao) and same IO-aware philosophy; the selective scan kernel is the SSM analogue of FlashAttention's tiling and recomputation, and FlashAttention-2 is the baseline of Figure 8.
2023: attacks the KV-cache cost at serving time that Mamba removes architecturally.
2024: MoE, the other big efficiency axis; hybrids like Jamba and Nemotron 3 Nano combine both.
2022: the token budgets of Mamba's scaling-law protocol (Figure 4, Table 12).
2020: the model shapes and training recipe Mamba's scaling laws copy.
2021: rotary embeddings, part of the Transformer++ baseline and of the MHA-RoPE induction-heads baseline.
2024: the other road to a small KV cache, compressing attention (MLA) instead of replacing it.
sequence-model history: RNNs, convolutions, attention, state spaces.
under Topic: llm-architecture: SSMs, linear attention and the hybrid models Mamba seeded.
KV cache, batch size and throughput.
kernel fusion, parallel scan, the HBM and SRAM hierarchy.
the open hybrids of 2025 and 2026 with their layer mix and KV cache per token.
the linear-attention (lightning attention) hybrid route at frontier scale.
This page is one row of the Papers database; its properties (Paper, Takeaway, Topics, Year) live there.