Mamba-3: Improved Sequence Modeling using State Space Principles
Let the state rotate as it fades, and a fixed-size memory can keep a count.
Mamba-3 makes three changes to the Mamba-2 layer. Each step writes a blend of the current and the previous token, the state rotates as well as decays, and the per-token update into the state has rank four instead of one.
Explaining the paperMamba-3: Improved Sequence Modeling using State Space PrinciplesA 2026 paper from the authors of Mamba. All three changes add arithmetic to a decode step that spends its time waiting on memory, and the rotation takes the model from chance to 100 on the parity task.
Mamba-3 is a recurrent layer for language models, a drop-in replacement for attention that keeps a fixed-size state instead of a growing cache. It modifies Mamba-2 in three places, each motivated by a different view of the same recurrence:
- as a discretized differential equation: a better integration rule adds a second, lagged input term (the exponential-trapezoidal update);
- as a linear dynamical system: complex eigenvalues let the state rotate, which lets it count, and the rotation is computed as a data-dependent rotary embedding on and ;
- as a GPU kernel: the per-token write into the state becomes a rank- matrix product (MIMO), which raises the arithmetic per byte of a decode step.
Around the layer, the block drops Mamba-2's short convolution, normalizes and biases and , and alternates with a separate MLP. The last section reads the results, including where the paper's own claims run ahead of its tables.
Why a recurrent model's decode step is memory-bound
A Transformer answers a question about token 4,000 by attending to token 4,000: every key and value it has computed stays in a cache that grows with the sequence. A recurrent, or linear-time, layer keeps one fixed block of numbers, the state, updates it once per token, and reads each output from it, so a million-token sequence uses the same state memory as a ten-token one.
Mamba-2 is the version Mamba-3 starts from. Per head it keeps a state and updates it with values projected from the current token : a decay and a gain (two scalars), a 128-number vector that says which direction in the state to write along, and a 128-number vector that says which direction to read from:
Here is one channel of the token. A head has 64 channels that share , , and , so the state of one head is a 64 × 128 matrix, 8,192 numbers. At the paper's 1.5B scale (model width 2,048, expansion 2, head dimension 64) there are 64 heads in each of 24 layers, about 25 MB of state in bf16 in total, independent of sequence length.
Generating one token loads that state, does a little arithmetic on it, and writes it back. Per head the step reads the 8,192-number state, , , the 64 channels of and a scalar: 17,026 bytes at two bytes per number, by the paper's count. The arithmetic is one scaling of the state, one outer product added into it, and one matrix-vector product to read it out, which the paper's Table 2 counts as operations for state size and head dimension : 40,896. Operations per byte moved is the step's arithmetic intensity, here 2.4 (the paper rounds it to 2.5).
An H100 does about 989 trillion dense bf16 operations per second and reads about 3.35 TB/s from its memory, so a kernel needs about 295 operations per byte before arithmetic, rather than memory traffic, sets its run time. At 2.4 the decode step sits more than a hundred times below that line, and the GPU's compute units are idle for nearly all of it. Mamba-2, Gated DeltaNet and every other fixed-state layer are in the same position, because the state is small and read once per token.
So any change that adds operations without adding bytes costs almost nothing at decode time. All three of Mamba-3's changes add operations: a third term in the update for a more accurate step, a rotation for the ability to count, and a rank-four update to use the idle compute units.
How Mamba gets its recurrence from a differential equation
Linear-attention papers write equation (1) down directly. State space models derive it from a continuous-time system, a bank of linear differential equations driven by an input signal :
Tokens are treated as samples of that signal taken at times , a distance apart, and the system is discretized, turned into a recurrence over the samples. In Mamba, is a positive number the model computes from each token (a softplus of a linear projection plus a per-head bias), and is negative, so the system decays. A large treats the token as a long stretch of time: the state forgets more of its past and writes the token in harder.
Over one step the system has an exact solution. Multiplying through by an integrating factor carries the old state forward by one exponential and adds the new input as an integral:
Mamba freezes at the step's right endpoint, which gives the decay for the first term. The second term, the state-input integral, is where discretization rules differ, because the model only sees the integrand at the two endpoints, the previous token and the current one. Zero-order hold, the classical rule, assumes the input was constant across the step and integrates exactly, giving a gain of .
Mamba-1's paper says it uses zero-order hold. Its code computes the gain as , a simplification Albert Gu confirmed in the repository (issue #129), and Mamba-2 inherited it. The deployed rule therefore combines an exact exponential for the decay with a rectangle for the input: the integrand is held at its right-endpoint value across the step of width . Mamba-3's first contribution is to place that rule in a family, an exponential decay times a quadrature rule for the integral, and to name it exponential-Euler; any other quadrature rule then gives another member of the family.
How the exponential-trapezoidal update works
The rectangle is exact only when the integrand does not change between the two tokens, and its error grows with how much it does change. The trapezoid rule from numerical analysis averages the two endpoints instead. Mamba-3 uses a weighted average with a weight chosen per token, which turns equation (1) into a three-term recurrence:
is a sigmoid of a per-head projection of the current token, so it lies in . At the middle term vanishes and (5) is Mamba-2's update. At it is the classical trapezoid rule.
The factor inside is the integrand's own decay. Write the integrand with frozen at :
At the right endpoint the exponential is 1, so . At the left endpoint it is , because an input deposited one step earlier has decayed for one step. The last two terms of (5) are therefore times a weighted average of at the two endpoints, with weights and . Drag in Figure 1 to both ends and watch the amber rectangle miss the teal area in opposite directions.
A worked step with one channel and . Take , and for every token, so , and . Feed the inputs :
- Mamba-2 (): the state reads 0.500, 0.303, 0.184.
- Mamba-3: first , then , then 0.184.
From the second step on, the two states are identical. With constant and , the trapezoid term writes a fraction of each token immediately and the remaining one step later, already decayed, so the total weight a past token carries is unchanged. The difference appears when the settings vary by token, because the delayed share of token is set by token 's own and . If the second token above had instead, its would be and the state after it 0.455, so the second token's sets how much more of the first token the state carries.
The accuracy argument comes with a condition the trained model does not meet. The paper's Remark 3 says the state-input integral is discretized to second order, with local error , provided stays within of . The released model leaves as an unconstrained sigmoid, and the paper's ablation (Table 8, 440M parameters) prefers that: learned reaches 15.72 test perplexity, fixed 15.76, and Mamba-2's 15.81. So Mamba-3 as trained is not a second-order method.
Order of accuracy also describes the limit , and in Mamba is a learned, unitless number that is never driven to zero. The 0.09-perplexity gain from the third term is better read as a new data-dependent term in the recurrence than as reduced truncation error, and the next section shows what that term computes.
The trapezoid term as a two-tap filter
Call the state-input, the vector a token contributes before any weight is applied. Then (5) reads:
The bracket is a causal filter of width two over the state-inputs, with weights chosen per token. Recurrent layers already carry a short filter of this kind. Mamba-1 runs a depthwise causal convolution of width 4 over , and Mamba-2 runs one over , and together, followed by a SiLU. Gated DeltaNet, a linear-attention model that first erases part of its state along the written key before adding the new value (the "delta" rule), and the strongest baseline in this paper, has one too: its own ablation moves average perplexity from 27.35 to 28.95 at 400M parameters when the convolution is removed.
The two filters sit at different points. The short convolution is a separate layer with its own weights, mixing raw token features before is applied. Mamba-3's filter has no weights of its own: its taps and come from the same , and that produce the decay, and it mixes after has been applied. Switch Figure 2 between the two layers and watch the fan-in move from the top lane to the bottom one.
A filter inside the recurrence would be a bad trade if it slowed training. Mamba-2 trains by writing the full sequence as one matrix product, , where is a lower-triangular mask: entry is the weight with which token 's write reaches token 's read, the product of the decays in between times the gain. That form runs on tensor cores instead of as a sequential scan. Mamba-3's mask is the same decay mask times a matrix with one extra band:
The left factor is Mamba-2's decay mask. The right factor is the width-two filter as a matrix, on the diagonal and one below; Mamba-2 has there instead. Multiplying out, the inside completes the decay product, and every entry below the diagonal becomes
against Mamba-2's . Figure 3 shows the three matrices for six tokens. Set the step size to constant and the off-diagonal entries match Mamba-2's at every , as in the worked example; only the diagonal shrinks. Switch the step size to vary by token and each column blends its own token's step with the next one's.
Applying the extra band costs little, and the paper's Mamba-3 training kernels run about level with Mamba-2's. With a filter inside the recurrence, Mamba-3 ships without the external convolution. The evidence is Table 5(a), at 440M parameters: a Mamba-3 with neither the trapezoid term nor the learnable / biases (a block change covered below) reaches 16.68 perplexity; adding the trapezoid gives 16.49; adding the biases gives 15.72; adding the short convolution back on top gives 15.85. That shows the convolution adds nothing once the other two are present. The table has no run with the convolution and without them, so it does not show that the new pieces do the convolution's job, and a 0.13-perplexity difference from one run each (the paper reports no seeds or variance) does not show that the convolution hurts.
Every row of that table already has the data-dependent rotation, so the paper never measures the rotation's effect on language perplexity. Its evidence is the formal-language table, covered in the next section.
The decode-time saving is smaller than removing a layer suggests. A width-4 convolution caches a three-token buffer between steps; Mamba-3's third term caches the previous and , a comparable amount. What goes is a layer, its activation and a kernel launch.
Why a rotating state can count: parity and modular counting
Parity is the smallest hard sequence task: read a string of zeros and ones and say whether the number of ones is even. A one-layer LSTM solves it, because its state passes through a tanh and multiplicative gates every step, and nonlinear updates are not constrained by the argument below. Mamba-2 scores 0.90 on it, which on the paper's scale is chance. The argument concerns layers whose update is linear in the state, which every model here is, because linearity is what allows the parallel training form.
Mamba-2's transition , with and , is a real number strictly between 0 and 1 multiplying every entry of the state. Between writes the state can only shrink toward the origin along the line it is on; it can never flip sign. Grazzi et al. (2025) proved the consequence: a linear recurrent layer can compute parity only if some transition has an eigenvalue outside the non-negative reals.
The paper's example fix is a rotation, , where turns a two-dimensional state by angle . Each 1 turns the state half a circle and each 0 leaves it, so after an odd number of ones it points the opposite way, and a fixed linear readout of the first coordinate changes sign. In Figure 4, set the angle to and press Play: the readout bar flips on every 1.
The paper attributes the limitation to real eigenvalues, which it says "cannot represent rotational hidden state dynamics", and gives as the cure. But , a real matrix with both eigenvalues equal to . Parity needs a negative eigenvalue, which is the fix Grazzi et al. proposed, and Gated DeltaNet with its eigenvalue range widened to scores 100 on parity in Mamba-3's own results table, matching Mamba-3.
A non-real eigenvalue is needed one task later. The only real numbers that return to 1 after finitely many multiplications are and , so a real transition can cycle with period at most two. Counting modulo 5 needs a transition that returns to the identity after five steps and not before, a rotation by . Grazzi et al.'s second theorem makes this precise: counting modulo , for not a power of two, needs an eigenvalue with a nonzero imaginary part. Set the angle in Figure 4 to and the orbit closes after five ones; move it off that value and it no longer closes at five.
A complex eigenvalue factors into a decay and a turn:
In real coordinates the turn is a 2 × 2 rotation acting on a pair of state entries. The paper's Proposition 2 states the equivalence: a complex state of channels is a real state of numbers whose transition is one scalar decay times a block diagonal of 2 × 2 rotations, one angle per pair. A complex number is two real numbers, so this costs no extra memory. In the state-size experiments below, Mamba-3 matches Mamba-2 at half the state.
Complex numbers are not new to the Mamba line. The related-work section says they "were phased out in Mamba-1 and successors", but Mamba-1's own ablation reports a complex selective transition at 9.16 perplexity against 8.71 for the real one on language, and Mamba-1 switched to complex for its audio experiment. Mamba-3's addition is a data-dependent imaginary part that never needs complex arithmetic to evaluate.
Mamba-3 is also more restricted than the classical complex SSMs. S4D, S5 and the LRU give each channel its own complex eigenvalue, so each channel has its own decay rate and rotation speed. Mamba-3 gives each pair its own angle but makes all pairs share one decay , because only a shared scalar decay keeps the mask in (7) a matrix of scalars, which is what keeps training a matrix multiply.
That structure sets a ceiling. The rotations act in fixed coordinate planes, so they commute, and the transitions one layer can compose form an abelian group: the layer can hold any number of independent counters that wrap around, and it cannot track a process where the order of operations changes the result. Shuffling a deck is the standard example, because two riffle shuffles applied in the other order give a different deck. In group terms, cyclic counting is reachable and the word problem for the permutation group is not, at any depth, assuming the standard conjecture . The circuit class matching what Mamba-3 adds is , which Barrington and Thérien tied to solvable groups; the paper labels it , a larger class that contains it.
Computing the rotation as a data-dependent RoPE
With the rotation, the recurrence to compute is Mamba-2's update with applied to the previous state:
Computed as written, this loses what Mamba-2 gained. Applying to the state every step is work proportional to the 8,192-number state, and a matrix-valued transition breaks the scalar mask that lets training run as a matrix multiply.
The paper moves the rotation off the state with a change of variables. Define the running rotation and the rotated state . Substitute into (9):
Since (the rotations commute), the rotation on the previous state is exactly , and multiplying both sides by removes it. The transition is a scalar again, and the leftover rotation lands on the projections:
Instead of turning the state, the layer turns and , each by the rotation accumulated up to its own position. Follow what the output at position reads from a write at position . The weight is a dot product of two rotated vectors, and since with orthogonal factors, the shared prefix cancels:
The pair is turned by the sum of the per-step angles of tokens through , and by nothing else. The same cancellation makes rotary position embeddings (RoPE) encode relative distance, which is why the paper calls this a data-dependent RoPE. In Figure 5, move the key position and watch which bars add up on the dial.
Ordinary rotary embeddings fix a frequency per dimension and multiply it by the absolute position, so the angle between two tokens depends only on their separation. Mamba-3 keeps the mechanism and changes where the angle comes from: each token projects its own, and the layer carries the running sum. With and a constant , ordinary RoPE comes back. In the released kernels the per-step angle is , at most half a turn times that token's step size, and the accumulated angle is kept modulo . At decode it is 32 numbers per head, updated with one add and one sine and cosine per token. The scan kernel sees a scalar decay and real vectors, as it did in Mamba-2, and no complex arithmetic runs anywhere.
In the released code only half the state rotates: the default rope_fraction is 0.5, so of the 128 state dimensions the first 64 carry rotations (32 angles) and the other 64 behave as a plain real decaying state, which a readout can reach regardless of what lies between write and read. The paper does not vary this fraction, so how much of the state needs to rotate is unmeasured. Proposition 2 also stacks the real state as all real parts followed by all imaginary parts, while writing the rotation as a block diagonal of adjacent 2 × 2 blocks; those need different orderings. The kernel for the ordinary rank-one layer (SISO, named in the next section) interleaves adjacent pairs, and the TileLang MIMO kernel pairs dimension with ; the math is consistent, but the proposition cannot be copied into code as printed.
Combining the rotation with the three-term update gives the recurrence Mamba-3 runs. Each state-input keeps the rotation accumulated up to its own position, so the lagged term carries , not :
The paper writes (10) and (11) with a plain , the same symbol as the unrotated state of (9), while its appendix proofs call it . The outputs agree between the two forms, which is all the propositions claim; the states differ by the accumulated rotation, which matters when inspecting a cached state.
Below is one decode step for one head at the paper's shapes. Line 2 lists what is carried between tokens: the state, the running angles, and the previous token's and . Two lines have no counterpart in the main-text equations. is a per-head skip that adds a scaled copy of the input to the output, present in every Mamba implementation since Mamba-1. The final is the block's output gate, which the paper writes only in Appendix C.
# one Mamba-3 decode step, one head. d_state = 128, headdim = 64
# carried between tokens: h (64,128), phi (32,), B_prev (128,), x_prev (64,)
z, x, B, C, dt_r, A_r, lam_r, th_r = split(in_proj(u)) # u: (d_model,)
dt = softplus(dt_r + dt_bias) # this token's step size, > 0
A = -heavy_tail(A_r) # this token's decay rate, < 0
alpha = exp(dt * A) # the decay itself, in (0,1)
lam = sigmoid(lam_r) # the trapezoid blend lambda, in (0,1)
beta = alpha * dt * (1 - lam) # weight on the PREVIOUS state-input
gamma = lam * dt # weight on the current one
B = rms_norm(B) + B_bias # 128 numbers; C is treated the same way
C = rms_norm(C) + C_bias
phi = (phi + dt * pi * tanh(th_r)) % (2 * pi) # 32 running angles
B, C = rotate(B, phi), rotate(C, phi) # first 64 dims of each
h = alpha * h + beta * outer(x_prev, B_prev) + gamma * outer(x, B)
y = h @ C + D * x # (64,)
B_prev, x_prev = B, x # the extra cache the third term needs
return out_proj(y * silu(z))MIMO: a rank-4 state update for the same state size
Back to the 2.4 operations per byte. Within one head the 64 channels share , and , so stacking them makes the state a 64 × 128 matrix, and each step adds an outer product of the token's 64-number value vector with its 128-number . That outer product has rank one: 8,192 multiplications to produce 8,192 numbers of update.
Widen both factors: let be and be , and the update becomes a matrix product of rank . The result has the same 64 × 128 shape, so the state does not grow, and the extra bytes are small because is small next to and . The operation count grows roughly -fold. In signal-processing terms this is the move from a single-input single-output (SISO) system to a multi-input multi-output (MIMO) one, hence the name. A rank- update is the more accurate description, because the "inputs" are learned rescalings of one projection, not separate data channels; the paper describes MIMO as motivated by inference efficiency.
The paper's introduction says MIMO "increases decoding FLOPs by up to ". Its Table 2 formulas give a SISO step operations and a rank- step . At the trained configuration, , , , that is 40,896 against 139,008, a ratio of 3.40. For large and the ratio tends to , also 3.4 at , because the operations that scale the old state do not grow with . A true needs . The bytes moved go from 17,026 to 18,946, up 11%.
Table 2's byte count also omits two things. Summing the tensor shapes it lists gives one -sized tensor more than the printed formula, and neither counts writing the updated state back. Counting the full round trip, the intensity is about 1.2 for SISO and 3.9 at , so the step is even more memory-bound than the paper says. On the paper's count the distance to the 295 break-even shrinks from about 120× to about 40×; on the full round trip, from about 240× to about 75×.
The rank also costs training time. A rank- recurrence is state updates sharing one decay, summed into one state, and readouts, each contracting against that sum:
Every write reaches every read, so an algorithm that materializes all the write-read pairs runs the SISO computation times, 16 times at . The chunked algorithm avoids most of that. SSD, the structured state space duality algorithm Mamba-2 trains with, splits the sequence into chunks, does a quadratic computation inside each chunk and a recurrence between chunks; the quadratic part is what grows as . Shrinking the chunk by a factor of holds that part fixed while the number of chunks grows by , for an -fold cost overall. The released code uses chunk size 64 for SISO and for MIMO. Measured, the MIMO training kernels are about 2× slower at , better than 4× because the extra compute overlaps with memory movement.
The rank also adds parameters. and are shared across all heads in a layer, so widening their projections from to (for model width ) is affordable. , and the gate are per head, and widening their projection from to would multiply the largest part of the parameter count. Mamba-3 instead keeps the ordinary projection and rescales its output into copies with a learned, data-independent vector, parameters per head. To keep the total parameter count equal to the SISO model's, Mamba-3 offsets the extra MIMO parameters by narrowing the MLP: at 1.5B its inner width drops from 4,096 to 3,824, a 6.6% cut.
Earlier MIMO state space models, S5 and the LRU, used the term for the opposite purpose: they replaced S4's bank of independent per-channel SSMs with one shared multi-channel SSM to shrink the recurrent state, and the paper describes them as trading some expressivity for simpler training. Mamba-3 keeps the state at Mamba-2's size and does more operations per step.
The Mamba-3 block, layer by layer
The changes so far are inside the recurrence. The block around it changes too; Figure 7 switches between the two blocks.
The first change is an RMSNorm on and right after projection, which the paper calls BCNorm. Under the duality Mamba-2 established, plays the role of the attention query and the key, and the released kernel is called with and . Normalizing them is the SSM counterpart of the QK-norm that recent Transformers use for training stability. There is no softmax in an SSD layer; unit-RMS and bound the entries of directly, which Wortsman et al. identified as what stabilizes large-scale training. The paper credits BCNorm with letting it drop Mamba-2's post-gate RMSNorm, but reports no run without BCNorm anywhere.
The second change is a learnable bias added to and after the norm (and, in the code, before the rotation), one value per head per state dimension, initialized to ones. The initialization changes what the layer computes at the start of training. After RMSNorm each of and has unit root-mean-square over its 128 entries, so their inner product has mean 0 and a spread of about , set by content. Adding ones to both adds a constant:
Each sum runs over 128 roughly centred entries of unit size, so each has a spread of about 11, like the content term. The three add in quadrature to a spread of about around a mean of 128. At initialization most of every entry of , the score the decay mask multiplies, is a data-independent constant, so the layer starts as a nearly content-blind decaying average of the sequence and learns content selectivity on top. The rotation modifies this for the rotated half: for two positions far apart the 32 accumulated angles are effectively random, those 64 dimensions' share of the constant averages out, and about 64 remains. Figure 8 samples 3,000 token pairs both ways for each initialization the paper tried.
The ablations fit that reading. Initializing the biases to zero costs 0.85 perplexity (16.57 against 15.72); a uniform initialization, where the two biases are uncorrelated and their product sums to about zero, costs 0.35 (16.07). Any positive initialization works about equally well: gives 15.76 and ones held frozen 15.80. The paper offers its own hypothesis, that the biases "induce a convolution-like behavior", and the constant offset is this page's reading of the same numbers.
The paper cites Yu and Erichson's block-biased Mamba as motivation. Their Theorem 4 gives two separate sufficient fixes for single-layer universal approximation: block partitioning alone, or a channel-specific bias on alone. Mamba-3's Table 10(b) finds alone the worst of the four options, 16.68 against 16.52 for no bias, while alone gives 15.98 and both 15.69. The bias on the read side carries the effect, and the cited theory is about the write side.
The third change moves the output norm. Mamba-2 put an RMSNorm after the gate and before the output projection, added because larger models were unstable. Mamba-3 removes it from pure models, and the released module has it off by default. Hybrids that interleave attention layers need a norm back, and the paper's Table 9 (1.5B hybrids, needle-in-a-haystack retrieval at up to 4,096 tokens, twice the 2,048 training context) varies two things at once: where the norm sits and whether it averages per head ("grouped") or across all heads of the layer. At 4,096, across the table's three needle tasks and both norm types (six comparisons), moving the norm before the gate wins five. Grouped against layer-wide shows no clean winner: across the same three tasks at both placements, the layer-wide norm is ahead in four of six, although the caption names the pre-gate grouped version best.
The fourth change is to the stack. Mamba-1 and Mamba-2 stack one block type with no separate MLP, and both papers ablated interleaving an MLP and found it slightly worse. Mamba-3 alternates its layer with a SwiGLU MLP block in the style of LLaMA. It reverses the earlier ablations, and the paper does not ablate it; it says only that the baselines follow their own papers' recipes.
The remaining nonlinearities in the layer are a softplus on , a sigmoid on , the two RMSNorms, a SiLU on the gate, and an activation on that the paper does not mention and the code calls heavy_tail: for and for , negated and clamped at . It approaches zero slowly for negative inputs, so a moderate projection still gives a long memory, and its docstring says it improves stability at higher learning rates. No convolution or activation acts on the path.
Mamba-3 results: perplexity, state tracking, retrieval and speed
Every model in the comparison (a Transformer, Mamba-2, Gated DeltaNet, Mamba-3 SISO and Mamba-3 MIMO at ) is trained on 100 billion tokens of FineWeb-Edu with the Llama-3.1 tokenizer and a 2,048-token context, at four sizes: 180M, 440M, 880M and 1.5B parameters. The Mamba models use expansion 2, state size 128 and head dimension 64. Downstream quality is the average of seven zero-shot tasks.
At 1.5B the zero-shot averages are 55.4 for the Transformer, 55.7 for Mamba-2, 55.8 for Gated DeltaNet, 56.4 for Mamba-3 SISO and 57.6 for MIMO: +0.6 for SISO over the best baseline, a further +1.2 for MIMO, +1.8 in total, and +2.2 over the Transformer. The ordering repeats at 880M, 440M and 180M, which is stronger evidence than any single gap. Seven tasks give each model's average a sampling error of roughly half a point; scoring all models on the same examples cancels part of that, but with one run per model and no variance reported, 0.6 points is within noise and 1.8 is not.
The 180M row does not rank anything. OpenBookQA has four choices, so chance is 25%, and all five models score between 21.8 and 23.2. ARC-Challenge, also four choices, spans 27.3 to 28.2, and WinoGrande, a binary task, spans 51.2 to 52.9. Three of the seven columns are noise, and 100 billion tokens for 180 million parameters is about 556 tokens per parameter, 28 times the 20 that Chinchilla's compute-optimal fit recommends.
Perplexity is the cleaner measure. On FineWeb-Edu at 1.5B, Mamba-2 reaches 10.47, Mamba-3 SISO 10.35 and MIMO 10.24. The total 0.23 is a 2.2% drop, 0.022 nats (0.032 bits) per token. In the paper's own Mamba-2 column, going from 880M to 1.5B parameters (11.35 to 10.47) is worth 0.081 nats, so by this page's interpolation Mamba-3's gain is about what a 10-20% larger Mamba-2 would give.
The state-size sweep bears directly on decode speed, since state size sets the bytes per step. Across 440M models trained to twice the Chinchilla token count at state sizes 16, 32, 64 and 128, Mamba-3 with half the state reaches better pretraining perplexity than Mamba-2 while moving half the state bytes per generated token.
State tracking gives the largest differences in the paper. Table 5(b) reports scaled accuracy, where 0 is chance and 100 is perfect, on parity, modular arithmetic without brackets, and modular arithmetic with brackets:
- Mamba-3: 100.00, 98.51, 87.75.
- Mamba-3 with ordinary RoPE: 1.56, 20.70, 2.62.
- Mamba-3 without the rotation: 2.27, 1.49, 0.72.
- Mamba-2: 0.90, 47.81, 0.88.
- Gated DeltaNet with eigenvalues in : 100.00, 99.25, 93.50.
The ordinary-RoPE row keeps the rotation but fixes its angles by position, and it fails too, so the angle has to depend on the token. Two points qualify the headline. Mamba-2's 47.81 in the middle column is far from chance (about 2.9× chance in raw terms), so the introduction's "no better than random guessing" is wrong for that cell. And Gated DeltaNet with negative eigenvalues, an existing linear model, ties on parity and beats Mamba-3 on both arithmetic columns; the paper calls Mamba-3 competitive, "matching parity and approaching" it.
Retrieval goes the other way, as the paper says. Extracting fields from semi-structured documents, Mamba-3 SISO trails the Transformer at 1.5B, 28.5 against 48.9 on SWDE and 23.4 against 58.4 on FDA, the expected cost of a fixed-size state. On question answering the gap is a few points: 40.1 against 46.6 on SQuAD and 64.5 against 67.5 on TriviaQA. On the easiest needle-in-a-haystack task at 4,096 tokens, twice the training length, Mamba-3 scores 88.2 against Mamba-2's 62.0. The Transformer scores 100.0 at 2,048 and 0.0 at 4,096, which the paper attributes to its RoPE failing to extrapolate past the training length.
MIMO wins perplexity and the zero-shot average at all four sizes (perplexity 16.46, 12.72, 11.11 and 10.24 against SISO's 16.59, 12.87, 11.23 and 10.35), and it loses the harder needle tasks at 4,096 tokens, 40.4 against SISO's 50.6 and 25.6 against 34.2. Its prefill takes about 20% longer, 19.44 s against 16.22 s at 16,384 tokens.
Measured latency confirms the arithmetic-intensity argument. One decode step at batch 128 on an H100, bf16, state size 128, 1.5B models, takes 0.156 ms for Mamba-3 SISO, 0.179 ms for MIMO, 0.203 ms for Mamba-2 and 0.257 ms for Gated DeltaNet. The rank-4 update does 3.4 times the operations, costs 15% more time than SISO, and is still faster than Mamba-2. Section 4.4 says SISO is fastest "across all configurations", but at fp32 with state size 64 Mamba-2's 0.295 ms beats SISO's 0.310; the table caption's narrower claim, bf16 at state size 128, holds.
End to end at 16,384 tokens, prefill plus decode, the recurrent models finish in 141 to 152 seconds and a Transformer served with vLLM (the PagedAttention engine) takes 977. The Transformer is Llama-3.2-1B, smaller than the 1.5B recurrent models, and its 977 seconds were measured at batch 16 and multiplied by 8 because batch 128 did not fit in GPU memory. Neither caveat changes the trend, only the ratio: the Transformer's cost grows with context length and the recurrent models' does not.
Mathematically the three changes are unrelated. All three meet the same two constraints: training must stay a matrix multiply, and the decode step, which is waiting on memory, must not move many more bytes. The trapezoid adds one band to a mask that already existed, the rotation adds 32 running angles per head and leaves the transition a scalar, and the rank-4 update uses compute that was idle. At 1.5B the MIMO model is 1.8 points above the best baseline on zero-shot average, and its decode step takes 12% less time than Mamba-2's (0.179 ms against 0.203 ms).
Questions you might still have
Do you need complex numbers to solve parity?
No. Multiplying the state by −1 on every 1 and reading its sign at the end computes parity, and −1 is a real number. Grazzi et al. (2025) proposed this sign flip for linear RNNs, and Gated DeltaNet with its eigenvalue range widened to [−1, 1] scores 100 on parity in Mamba-3’s own table, the same as Mamba-3. A non-real eigenvalue is needed one task further on, counting modulo 5: no real number other than ±1 returns to 1 after a finite number of multiplications, so a real transition cycles with period at most two. Even on the modular-arithmetic tasks Gated DeltaNet stays ahead, 99.25 and 93.50 against 98.51 and 87.75.
Is the data-dependent rotation the same thing as RoPE?
The algebra is the same and the angles are different. Ordinary rotary embeddings (the RoPE explainer on this site covers them) use a fixed frequency per dimension multiplied by the absolute position, so the rotation between two tokens depends only on how far apart they are. Mamba-3 accumulates a per-token angle produced by a projection of that token, so the rotation between two positions depends on which tokens lie between them. Swapping in ordinary RoPE and keeping everything else drops parity from 100 to 1.56.
How can a decode step do 3.4 times the arithmetic at almost the same speed?
The step is limited by memory traffic. Reading one head’s state and the token’s vectors moves about 17 kilobytes for about 41,000 floating-point operations, 2.4 operations per byte, while an H100 needs about 295 before arithmetic becomes the limit. The rank-4 update raises the operations by 3.4× and the bytes by 11%, to an intensity of about 7.3, still far below 295. Measured bf16 decode latency at batch 128 goes from 0.156 ms to 0.179 ms.
Does removing the short convolution save memory at inference?
Very little. It removes a layer, its SiLU and one kernel launch, but Mamba-3 has to cache the previous token’s B and x for the third term of its update, about as many numbers as Mamba-2’s three-token convolution buffer. The evidence is also narrower than the framing: Table 5(a) shows the convolution adds nothing on top of the trapezoid term and the B/C biases (15.85 against 15.72 perplexity, one run each), and there is no run with the convolution but without them.
How much of the 1.5B gap is real?
The ordering (MIMO, then SISO, then Gated DeltaNet, then Mamba-2 on the zero-shot average) repeats at all four model sizes, which is the strongest evidence in the table. A seven-task average has a sampling error of roughly half a point per model and the paper reports one run per model, so the +0.6 of Mamba-3 SISO over Gated DeltaNet is within noise and the +1.8 of MIMO is not. On perplexity, 10.47 to 10.24 at 1.5B is a 2.2% drop, roughly what a 10-20% larger Mamba-2 would give.
Why not give the state a full transition matrix, as an LSTM effectively has?
Training would lose its matrix-multiply form. Mamba-2 trains as Y = (L ⊙ CBᵀ)X, which needs the transition to be one scalar per step so the mask L holds products of scalars. Mamba-3’s rotations are block-diagonal, commute with each other and share one scalar decay, which is exactly what lets them be moved onto B and C, leaving a scalar transition again. A general dense transition has no such change of variables. In exchange, a single layer can only compose commuting operations, so non-commutative tracking such as the S₅ word problem stays out of reach.
Where does Mamba-3 sit next to Mamba-2 and S4?
S4 (explained on this site) has a structured complex transition per channel that does not depend on the input. Mamba made Δ, B and C depend on the token and used a real diagonal transition. Mamba-2 restricted the transition further, to one positive scalar per step, which made training a matrix multiply. Mamba-3 keeps that scalar decay and adds a block of rotations beside it, which restores complex eigenvalues while keeping the matrix-multiply form.
Footnotes & further reading
- The paper: Lahoti, Li, Chen, Wang, Bick, Kolter, Dao and Gu, Mamba-3: Improved Sequence Modeling using State Space Principles (2026). The kernels and the
Mamba3module are in state-spaces/mamba; the decode step above followsops/triton/mamba3/mamba3_siso_step.pyandmodules/mamba3.py. - The layer this one modifies: Dao & Gu, Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality (2024), explained here as Mamba-2; and Gu & Dao, Mamba, explained here as Mamba. The discretization discrepancy between Mamba-1's equation (4) and its code is issue #129.
- The discretization lineage: Gu, Goel & Ré, Efficiently Modeling Long Sequences with Structured State Spaces (S4, bilinear); Gu et al., S4D; Smith, Warrington & Linderman, S5 (zero-order hold, and the earlier MIMO formulation). For exponential integrators generally, Hochbruck & Ostermann, Exponential Integrators (Acta Numerica, 2010): what that literature calls exponential Euler has the gain , which is Mamba-3's zero-order-hold row rather than its exponential-Euler row.
- Rotary embeddings: Su et al., RoFormer, explained here as RoPE. The Transformer baseline's architecture is from Attention Is All You Need and LLaMA.
- State tracking: Grazzi, Siems, Zela, Franke, Hutter & Pontil, Unlocking State-Tracking in Linear RNNs Through Negative Eigenvalues (ICLR 2025); Merrill, Petty & Sabharwal, The Illusion of State in State-Space Models; Sarrof, Veitsman & Hahn, The Expressive Capacity of State Space Models; and Delétang et al., Neural Networks and the Chomsky Hierarchy, the source of the scaled-accuracy protocol and the one-layer LSTM baseline.
- The bias motivation: Yu & Erichson, Block-Biased Mamba for Long-Range Sequence Processing (NeurIPS 2025). The bounded-logit mechanism behind QK-norm is from Wortsman et al., Small-scale proxies for large-scale Transformer training instabilities.
- The strongest baseline: Yang, Kautz & Hatamizadeh, Gated Delta Networks, whose Table S.1 is the source for the short convolution's value there (27.35 to 28.95 average perplexity without it).
- Evaluation: Penedo et al., The FineWeb Datasets; Hsieh et al., RULER for the needle-in-a-haystack tasks; and Hoffmann et al., Training Compute-Optimal Large Language Models, explained here as Chinchilla. The vLLM serving engine is Kwon et al., PagedAttention, explained here as PagedAttention.
- The hardware numbers: the roofline framing is Williams, Waterman & Patterson, Roofline (CACM 2009), which calls the quantity operational intensity. The 295 operations per byte is 989 dense bf16 TFLOP/s over 3.35 TB/s of HBM3 from NVIDIA's H100 datasheet; the dense figure, not the one with sparsity.
How could this explainer be improved? Found an error, or something unclear? I read every message.