gated-deltanet -- the linear-attention delta-rule state update
Attention remembers every past word and re-reads them all. This is the alternative: a fixed-size table of associations — this cue goes with that content — which never grows, however long the conversation runs. The trick that makes it usable is what happens when a cue already on file comes back: the model first erases what was stored under it, then writes the new content in its place, so a repeat updates the entry instead of stacking a second copy on top until the table turns to mush. Everything also fades slightly each step, so old entries eventually disappear. Fixed size is the whole point and the whole cost — the table holds only so much.
Interactive page: the GatedDeltaNet recurrence -- a linear-attention variant that carries a matrix state (an associative key→value memory) and updates it with a gated delta rule (Qwen3-Next / Gated DeltaNet hybrids). Anchor: N1 sequence mixer (linear attention; constant-size matrix state instead of a KV cache); Family E, companion to ssm-scan mamba-block. See.
What it shows
Instead of attention's softmax(QKᵀ)V (which re-reads the whole KV cache), linear attention keeps a fixed [d×d] state matrix S -- a sum of key→value associations -- and reads it with the query: oₜ = Sₜ qₜ. GatedDeltaNet's update rule:
Sₜ = αₜ · Sₜ₋₁ · (I − βₜ kₜ kₜᵀ) + βₜ vₜ kₜᵀ
- αₜ (gate / decay): shrinks the whole memory each step (forgetting) -- the "gated" part.
- delta rule (βₜ):
(I − βₜ kₜ kₜᵀ)first erases the value currently stored at keykₜ(the term−βₜ (Sₜ₋₁ kₜ) kₜᵀ), then+ βₜ vₜ kₜᵀwrites the new valuevₜthere. So a repeated key overwrites instead of piling up -- the memory doesn't saturate (vs plain linear attentionSₜ = Sₜ₋₁ + vₜ kₜᵀ).
The state matrix S [d×d] is the centrepiece; it evolves as you step the sequence. Each step shows the token's k / v / q, the gate α and write β, the written association βvkᵀ, and the output o = S q. Toggle the delta rule off to watch the memory saturate.
Drag a v (value) component to change what gets written and watch S + the output re-run; hover any state cell, k/v/q, or output. The scan auto-plays loops.
Render tier
T2 (WebGL2 heatmaps for the [d×d] state + written-association matrices; Canvas2D for the k/v/q/o bars and the formula).
Wiring
layout.mount + controls (L, d, alpha, beta, delta, seed) + an L-step Transport (the state evolves over the sequence) + onPointer value drag + hover. ?step / ?drag / ?delta / ?hover hooks. Source: page.js.