The Delta Rule and Gated DeltaNet: Memory That Overwrites
The night watchman's whiteboard
Picture a night watchman who tracks the state of a building on a fixed-size whiteboard. First method, naive: he adds every new observation on top of the others, after one night, everything overlaps and becomes unreadable. Second method, smart: when a piece of information changes ("door 3 is now closed"), he first erases the old note about door 3, then writes the new one in its place.
That second method is the delta rule. It is the ingredient that revived linear attention in 2024-2025, and the basic building block of the mechanisms used by Qwen3-Next, Kimi Linear and Kimi K3.
Reminder: the fixed-size memory
A linear-attention layer (or SSM (see the Mamba and Linear attention lessons) keeps no growing KV cache: it compresses the entire past into a fixed-size state matrix) an associative memory where each key points to a value. At every token, the memory is updated, then the next token arrives.
The whole question is: how do you update that memory without saturating it or blurring everything together?
Naive accumulation and its problem
The first linear attentions (2020) did a simple addition: memory = memory + (new key × new value). Like the watchman overloading his whiteboard, associations pile up. If the key "door 3" appears ten times with different values, all ten versions coexist and interfere with each other. Recall quickly becomes approximate.
The delta rule: erase, then write
DeltaNet applies the methodical watchman's fix. For each new key→value pair:
- Read what the memory already holds for this key.
- Subtract that old value (the targeted erase).
- Write the new value in its place.
Hence the name: only the delta is written, the difference between what you want to store and what was already there. A single key is touched; the rest of the memory is preserved. In 2024, researchers showed how to parallelize this computation efficiently on GPUs, that is what made DeltaNet usable at scale.
Parallelizing Linear Transformers with the Delta Rule over Sequence LengthThe update reads S = (I − k·kᵀ)·S + v·kᵀ, where S is the memory (the state matrix), k and v the current token's key and value, and I the identity matrix (the one that changes nothing). The term (I − k·kᵀ) is a projection that "empties" the direction of key k in memory S; the term v·kᵀ writes the new value there. (In practice, a learned coefficient β, the write gate, doses the strength of this replacement.) Geometrically, (I − 2·k·kᵀ) would be a Householder reflection, the delta rule is a damped version of it.
The gate: tuning forgetfulness
Erasing what gets replaced is not enough: information that is never updated should also fade eventually, otherwise the memory fills up with stale entries. That is the role of the gate (forgetting mechanism): at each token, the whole memory is slightly attenuated.
Gated DeltaNet (NVIDIA, late 2024) combines the two: delta rule + gate.
Gated Delta Networks: Improving Mamba2 with Delta Rule Its gate is scalar: one coefficient per token, applied uniformly, the whole memory fades at the same pace. Simple and already very effective: Gated DeltaNet is the linear mechanism Alibaba picked for Qwen3-Next, in a 3:1 hybrid with full attention.

From scalar gate to diagonal gate
The scalar gate's limitation: everything is forgotten at the same pace. Yet some information deserves to stay for a long time (a name, an instruction given at the start), while other information can vanish quickly (transitional details).
Hence the next refinement: one forgetting coefficient per channel of the memory. Each dimension fades at its own pace. Mathematically, this amounts to multiplying the state by a diagonal matrix (one coefficient per row, zeros everywhere else), hence the term "diagonal gate". This is the core of KDA, Kimi's mechanism (next lesson).

Naive accumulation → delta rule (overwrite what you replace) → + scalar gate (everything fades uniformly) = Gated DeltaNet → + diagonal gate (each channel fades at its own pace) = KDA. Each step adds control over what the memory keeps or forgets.
Why it matters
In 2025-2026 this family of mechanisms became the de facto standard for the linear layers of large hybrid models: Qwen3-Next (Gated DeltaNet), Kimi Linear and Kimi K3 (KDA), and several NVIDIA research architectures. When a paper or technical document mentions a "delta rule", a "gate" or "diagonal matrices" inside a linear-attention layer, this is exactly what it is talking about.

Key takeaways
- A linear layer compresses the past into a fixed-size memory; the whole game is the update rule.
- The delta rule erases a key's old value before writing the new one, a targeted "erase and replace".
- The gate tunes forgetting: scalar (uniform, Gated DeltaNet) or diagonal (per channel, KDA).
- These mechanisms power the linear layers of recent large hybrids (Qwen3-Next, Kimi K3).
1. Why did the first generation of linear attentions, which simply added every new key-value association to the memory, end up recalling information poorly?
2. What exactly does the delta rule do when an already-known key comes back with a new value?
3. The delta rule already erases what it replaces. Why does Gated DeltaNet still add a forgetting gate?
4. What is the difference between Gated DeltaNet's scalar gate and KDA's diagonal gate?