Glossary · Attention

Mamba (state-space layers)

Also: Mamba-2SSMstate space modelhybrid_override_pattern

Read it at the depth you need: one sentence · a paragraph · the math · in the models here

1In one sentence

A recurrent layer that carries a fixed-size state from token to token instead of attending to the past; hybrids such as Nemotron-H mix many Mamba layers with a few attention layers.

2In a paragraph

A state-space layer reads the sequence like a recurrent network: it keeps a state, updates it with each token, and reads its output from it. Mamba makes the update depend on the token (it is "selective"), so it can choose what to keep and what to forget, and it trains in parallel like attention. Its memory per sequence is fixed, which makes long contexts cheap. NVIDIA's Nemotron-H models and IBM's Granite 4 use mostly Mamba-2 layers with a handful of attention layers for exact recall.

3The math, shapes and parameters

Mamba-2, per head h with a scalar decay:

St = exp(ΔtAh) · St−1 + Δt · xt BtT    yt = St Ct + Dh xt

x is the head's slice of the input (p channels), B and C are N-wide vectors shared by a group of heads, Δ is a per-head time step. One in_proj [2·H·p + 2·g·N + H, d] produces x, a gate z, B, C and Δ; a short depthwise convolution runs over x, B and C; then A_log, D and dt_bias (one per head), a gated RMSNorm and out_proj [d, H·p].

state per layer = H × p × N numbers (plus the convolution's last few inputs)

4In the 96 models on this site

ModelPatternMamba layersHeads × p × NState (FP32)KV per token
Nemotron 3 Nano 30B-A3BMEMEM*EMEMEM*EMEMEM*EMEMEM*EMEMEM*EMEMEMEM*EMEMEMEME23 of 5264 × 64 × 12849.9 MB6.1 KB
Nemotron 3 Super 120B-A12BMEMEMEM*EMEMEMEM*EMEMEMEM*EMEMEMEMEM*EMEMEMEMEM*EMEMEMEMEM*EMEMEMEMEM*EMEMEMEM*EMEMEMEME40 of 88128 × 64 × 128173 MB8.2 KB
Nemotron 3 Ultra 550B-A55BMEMEMEM*EMEMEM*EMEMEMEM*EMEMEMEM*EMEMEM*EMEMEMEM*EMEMEMEM*EMEMEM*EMEMEMEM*EMEMEMEM*EMEMEM*EMEMEMEM*EMEMEMEME48 of 108256 × 64 × 128413 MB12.3 KB

Introduced in Dao and Gu, “Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality” (2024).

Related

Linear attention (Gated DeltaNet) · KV cache · Mixture of experts (MoE) · every term