Why discretization matters

Zero-order hold, stability regions, and why Mamba-3 swapped its integrator: the numerical analysis inside modern sequence models.

June 2026 · 10 minute read

Mamba-3 landed this spring (Lahoti et al., ICLR 2026), from a team that includes the original Mamba authors. Its abstract lists three improvements, and the first is easy to read past: “a more expressive recurrence derived from SSM discretization.” Unpacked, it means something striking. Mamba-3 swapped its numerical integrator (the rule that converts a continuous-time model into the discrete steps a GPU actually runs), replacing a first-order update with a second-order trapezoidal rule.

There is no exotic neural machinery in that. The trapezoidal rule is textbook numerical analysis, and the theory that explains why it is the right upgrade was worked out by Dahlquist and the ODE community in the 1950s and ’60s. Yet in 2026 it sits at the center of a frontier sequence-model architecture.

This page is a short tour of why. The claim: for state-space models, discretization is not plumbing. It is a design axis, and stability, memory, and accuracy all hang off it.

A sequence model is an ODE in disguise

A structured state-space model (SSM) starts life as a linear ordinary differential equation:

h˙(t)=Ah(t)+Bu(t),y(t)=Ch(t).\dot h(t) = A\,h(t) + B\,u(t), \qquad y(t) = C\,h(t).

The state h(t)h(t) is a vector of memory; the input u(t)u(t) is the signal — for a language model, ultimately the token stream. This is the same object control engineers have studied since the 1960s.

But a GPU does not see continuous time. It sees a sequence u1,u2,u_1, u_2, \ldots, so the model must be discretized: pick a step size Δ\Delta and a rule that turns the continuous matrices (A,B)(A, B) into discrete counterparts (Aˉ,Bˉ)(\bar A, \bar B), giving a recurrence

hk+1=Aˉhk+Bˉukh_{k+1} = \bar A\,h_k + \bar B\,u_k

that approximates the flow of the ODE. That conversion rule is a numerical integrator, and everything in this story turns on which one you pick.

S4, the architecture that launched the modern SSM line, discretized with the bilinear transform — a rule we will meet properly below. Later SSMs, Mamba included, settled on discretizations built around the exact exponential Aˉ=eAΔ\bar A = e^{A\Delta}, the zero-order hold (ZOH) and its close cousins: hold the input constant across each step and integrate the rest exactly. The recipe is the same either way, and one detail is crucial: Δ\Delta is a learnable parameter — the network tunes its own timescale by gradient descent. Mamba pushes this further; we will get there. First: what could possibly go wrong?

Stability is geometry

The simplest integrator anyone writes down is forward Euler: follow the local slope, Aˉ=I+ΔA\bar A = I + \Delta A. To see why it can fail, look at one mode at a time (take AA diagonalizable — every matrix in this story is). If λ\lambda is an eigenvalue of AA, the discretization maps it to an eigenvalue μ\mu of Aˉ\bar A, and the recurrence multiplies that mode by μ\mu at every step. After a thousand tokens, that is μ1000\mu^{1000}. The discrete model survives precisely when μ1|\mu| \le 1.

So the continuous and discrete worlds have different stability geographies. A continuous mode decays when Re(λ)<0\operatorname{Re}(\lambda) < 0 — the left half-plane. A discrete mode survives when μ\mu lies in the unit disk. A discretization is a map between these two pictures, and the whole question is where it sends the stable region.

ZOH sends λeλΔ\lambda \mapsto e^{\lambda\Delta}, and eλΔ=eΔRe(λ)<1|e^{\lambda\Delta}| = e^{\Delta\,\operatorname{Re}(\lambda)} < 1 whenever Re(λ)<0\operatorname{Re}(\lambda) < 0 — for every step size Δ>0\Delta > 0. Decay in, decay out, unconditionally. Numerical analysts call such schemes A-stable; ZOH earns the label trivially, since eλΔe^{\lambda\Delta} is the exact solution map and exactness preserves decay. Forward Euler instead sends λ1+λΔ\lambda \mapsto 1 + \lambda\Delta: a point marching along a straight line away from 11. For any decaying mode there is a finite threshold (for real λ\lambda, Δ>2/λ\Delta > 2/|\lambda|) beyond which the image exits the disk, and the discrete model blows up even though the continuous system it approximates decays perfectly.

Two-panel plot. Left: two continuous eigenvalues in the shaded left half-plane. Right: the unit circle with the discrete eigenvalues produced by forward Euler, ZOH, and bilinear at step size 0.1, all inside the disk.

The eigenvalue map at a small step (Δ=0.1\Delta = 0.1): a damped oscillator’s two continuous eigenvalues (left) and their discrete images under forward Euler, ZOH, and bilinear (right). At this Δ\Delta everyone agrees: all images sit safely inside the unit disk.

Small steps are safe for everyone. Trouble starts as Δ\Delta grows — drag it:

Interactive plot: six left-half-plane eigenvalues mapped into the complex plane by ZOH and forward Euler as the step size Δ varies. ZOH keeps every eigenvalue inside the unit disk for all Δ; forward Euler pushes them out as Δ grows.

ZOH μ = eλΔ  ·  forward Euler μ = 1 + λΔ  ·  gray circle = stability boundary

For SSMs this is not a hypothetical, because Δ\Delta is learned, and in Mamba it is computed per token from the input. Training explores Δ\Delta-space freely. With an A-stable scheme, every Δ\Delta the optimizer can reach yields a stable recurrence: HiPPO initialization is built to place AA‘s eigenvalues in the left half-plane, and an A-stable rule (bilinear for S4, the eAΔe^{A\Delta} family for Mamba) keeps their images inside the disk. That stability is a theorem, not a lucky hyperparameter (ch. 4).

Operator stability is the same dichotomy

The slider above moved the time-step Δ\Delta and watched the discretization itself fail. The very same explicit-versus-implicit split lives one level in — inside the recurrence’s own update rule, on the learning step. Two modern sequence-model operators, DeltaNet and Longhorn, both run an online associative memory on a state SS: each token nudges SS toward writing value vv at key kk, one step of regression on a recall loss. The deviation from that fixed point contracts by a per-step factor ρk\rho_k in the key direction, and the two operators differ in exactly one place — whether that write step is taken explicitly or implicitly: forward Euler versus backward Euler again, now on the learning step instead of the time step.

DeltaNet writes with an explicit rate β\beta, so it is forward Euler on the online-learning flow — safe for gentle writes, unstable once the write is too large:

ρkDeltaNet=1βk2,stable    βk2(0,2).\rho_k^{\mathrm{DeltaNet}} = \bigl|\,1 - \beta\,\|k\|^2\,\bigr|, \qquad \text{stable} \iff \beta\|k\|^2 \in (0, 2).

Longhorn writes implicitly — it solves for the step instead of extrapolating it — which makes the effective rate βeff=1/(α+k2)\beta^{\mathrm{eff}} = 1/(\alpha + \|k\|^2) shrink to meet the key. That is backward Euler’s A-stability guarantee, replayed:

ρkLonghorn=αα+k2<1for every α>0 and every nonzero key.\rho_k^{\mathrm{Longhorn}} = \frac{\alpha}{\alpha + \|k\|^2} < 1 \quad\text{for every } \alpha > 0 \text{ and every nonzero key.}

Fix β=α=1\beta = \alpha = 1 and both radii live on one axis — the write strength k2\|k\|^2. Drag it past k2=2\|k\|^2 = 2 and watch only the explicit operator leave the stable band:

Interactive plot: the per-step spectral radius rho of DeltaNet (explicit, red dashed) and Longhorn (implicit, blue solid) as the write strength ||k||^2 varies, with beta = alpha = 1. DeltaNet crosses rho = 1 into the shaded unstable band at ||k||^2 = 2; Longhorn stays below 1 for every write.

Drag ‖k‖² past 2 — which operator blows up?

The harder the write, the harder Longhorn contracts it (ρk0\rho_k \to 0 as k2\|k\|^2 \to \infty), so there is no boundary to cross. The two radii even obey a conservation law, ρkLonghorn+βeffk2=1\rho_k^{\mathrm{Longhorn}} + \beta^{\mathrm{eff}}\|k\|^2 = 1: whatever contraction Longhorn gives up, it spends on a self-limiting write, so the effective βeffk2=1ρk\beta^{\mathrm{eff}}\|k\|^2 = 1 - \rho_k approaches but never reaches 11 — not even half the explicit boundary of 22, no matter how large the key. The closed forms, the Rayleigh-quotient drift guard that pins them to the materialized iteration matrix, and the chunkwise-parallel implementations are in ch. 12 of the book (runnable companion code).

Accuracy is a ladder

Staying stable is not the same as being right: the discrete model should also track the continuous one. The standard yardstick is the order of accuracy: error shrinking like O(Δp)O(\Delta^p) as the step refines. ZOH is exact on the unforced system (eAΔe^{A\Delta} is the true flow map), but it freezes the input across each step, which costs it accuracy on forced systems: first order, p=1p = 1.

Log-log plot of maximum error versus step size for forward Euler, ZOH, and bilinear on a forced damped oscillator. Euler and ZOH lines have slope one; the bilinear line has slope two.

Error vs step size on a forced damped oscillator (log–log). Forward Euler and ZOH converge at first order (slope 1\approx 1); the bilinear transform converges at second order (slope 2\approx 2). Empirical slopes, measured against a high-accuracy implicit reference (SciPy’s Radau integrator, rtol 101110^{-11}).

Climbing the ladder means letting the input vary across the step, and the classical way to do that is the trapezoidal rule: average the endpoints. In the SSM world it shows up in two guises:

Log-log convergence plot comparing ZOH, bilinear, and exponential-trapezoidal schemes. ZOH has slope one; bilinear and exponential-trapezoidal both have slope two.

The exponential-trapezoidal scheme joins bilinear at second order (slope 2\approx 2) while retaining ZOH’s exact treatment of the autonomous flow — the combination Mamba-3’s discretization builds on (same Radau reference).

More precision: the Dahlquist barrier

Dahlquist’s second barrier theorem (1963): an A-stable linear multistep method cannot exceed order 2, and among A-stable order-2 methods the trapezoidal rule has the smallest error constant. If you insist on unconditional stability in that family, second order is the ceiling — and the trapezoidal rule sits exactly at it. Explicit methods such as forward Euler cannot be A-stable at all: their stability regions are bounded sets. The full machinery — Butcher tableaus, stability functions, region plots for the schemes above — is in ch. 5 of the book.

More precision: computing Aˉ\bar A and Bˉ\bar B

ZOH’s input matrix is Bˉ=A1(eAΔI)B\bar B = A^{-1}(e^{A\Delta} - I)B — awkward when AA is singular or badly conditioned. The standard trick: build the augmented block matrix with AΔA\Delta and BΔB\Delta in the top row and zeros below, and take one matrix exponential; Aˉ\bar A and Bˉ\bar B appear as blocks of the result, no inverse required (a construction going back to Van Loan 1978). The φ\varphi-functions of the exponential-trapezoidal scheme fall out of the same construction with one more block (Al-Mohy & Higham 2011 give the modern treatment). Derivation in ch. 4, production implementations in the companion code.

Selectivity is adaptive stepping

Through this lens, Mamba’s signature “selectivity” reads as something an ODE person already knows. Mamba computes Δt\Delta_t from the current token: the network runs an adaptive step size, the same idea every production ODE solver has used for decades. A small Δt\Delta_t barely advances the state (hold your memory); a large one integrates far (reset toward the new input); Δ\Delta is simultaneously the stability knob and the memory horizon. The discretization is the gating mechanism.

Which makes Mamba-3’s headline change read like the natural next move from the numerical-analysis playbook. The first-order update was the accuracy bottleneck (the paper pins its predecessors’ rule down as exponential-Euler: exact exponential for the state, Euler for the input), so it is replaced with a generalized trapezoidal rule — in its own terms an exponential-trapezoidal discretization: exact exponential for the state, trapezoid for the input, second-order and A-stable, the very ceiling Dahlquist’s barrier sets in the classical constant-step theory. Mamba-3 combines it with a second, independent upgrade, a complex-valued state, so each mode can rotate as well as decay (ch. 10 develops the scheme in full). The reported payoff is concrete, for the system as a whole: perplexity comparable to Mamba-2 with half the state size, plus gains on retrieval and state-tracking. The paper credits its three changes together; better numerics helped buy that memory.

The theory underneath (A-stability, order conditions, the barrier theorems, the equivalence results that tie consistency and stability to convergence) was finished before “sequence model” meant anything neural. None of this is my invention, and that is the point: the bridge between classical numerical analysis and modern architectures is short, load-bearing, and still being crossed. If this page pulled you across it, the book below walks the whole span, with derivations, exercises, and runnable companions.

Sources & going deeper