Key takeaways
- DeltaNet is linear attention that overwrites the value stored for a key in a fixed-size memory, instead of only adding to it, so generation needs no growing KV cache.
- Gated DeltaNet, from MIT and NVIDIA researchers, adds a learned gate that fades old memory, and Qwen3-Next and Qwen3.5 use it in three of every four layers.
- A November 25, 2026 paper shows Gated DeltaNet-2 can crash in 64K-context training and proposes Stable GDN-2, which raised a 128K RULER average from 4.82 to 11.62 in a 1.6B model.
Gated DeltaNet is a kind of linear attention: a replacement for a transformer's attention layer that keeps a fixed-size memory instead of a growing KV cache. It updates that memory with the "delta rule", which overwrites the value stored for a key instead of piling new values on top, plus a gate that fades old memory. Songlin Yang of MIT and Jan Kautz and Ali Hatamizadeh of NVIDIA introduced it in Gated Delta Networks: Improving Mamba2 with Delta Rule, an ICLR 2025 paper, and Qwen now uses it in three of every four layers of Qwen3-Next and Qwen3.5.
It is in the research feeds again this week. Stable Gated DeltaNet-2, posted on November 25, 2026, shows that the newest version of the idea can blow up during long-context training, and proposes a fix. It topped Hugging Face Papers on November 27 with 74 upvotes.
The problem: attention remembers everything
Standard attention compares each new token with every earlier one, so the model keeps the keys and values of all previous tokens, and the cache grows with every token. That is why long context windows are expensive to serve.
Linear attention, proposed by Katharopoulos et al. in 2020, drops the softmax so the math can be rearranged. Each head keeps one matrix, a recurrent state, and adds every new key-value pair into it:
S_t = S_{t-1} + v_t k_t^T
To read, the model multiplies the state by the current query. The state's size doesn't depend on how many tokens came before, so memory stays constant. The catch is that this memory only adds. It can't remove an old association, and once a sequence holds more items than the state has dimensions, keys collide and retrieval gets blurry.
DeltaNet: overwrite instead of append
DeltaNet replaces the addition with the delta rule, from Widrow and Hoff's 1960 work. Before writing, the layer reads what the memory currently stores for the incoming key, then moves that value toward the new one by a learned step size, beta:
S_t = S_{t-1} - beta_t (S_{t-1} k_t - v_t) k_t^T
The "delta" is the gap between what the memory predicted and the new value. Each token takes one step of gradient descent on the memory. A new key gets written; a key already there gets its value replaced rather than averaged in.
Schlag et al. proposed DeltaNet in 2021, but it trained token by token. In a 2024 paper, Yang and co-authors from MIT and Soochow University rewrote the update so it could be computed in parallel chunks. Their 1.3B-parameter DeltaNet, trained on 100B tokens, beat the linear-time models Mamba and GLA on perplexity and zero-shot tasks, and hybrids with a few attention layers beat their transformer baseline.
The authors listed its limits, including weak performance past the training length, and suspected it needed a way to decay old memory.
Gated DeltaNet: add a forget gate
Gated DeltaNet multiplies the memory by a learned gate, alpha, between 0 and 1, before the delta update:
S_t = S_{t-1} (alpha_t (I - beta_t k_t k_t^T)) + beta_t v_t k_t^T
With alpha near 0, the layer wipes its memory, useful when the text changes topic. With alpha near 1, it acts like DeltaNet and edits one association without touching the rest. In the paper's words, "gating enables rapid memory erasure while the delta rule facilitates targeted updates".
| Model | How the memory changes at each token |
|---|---|
| Linear attention | Adds the new pair, never removes anything |
| Mamba2 | Fades all memory by one factor, then adds |
| DeltaNet | Overwrites the value stored for the current key |
| Gated DeltaNet | Fades memory by a learned gate, then overwrites |
| Gated DeltaNet-2 | Separate per-channel gates for erasing and writing |
Needle-in-a-haystack tests on 1.3B models show the trade. On the simplest test at 8K tokens, DeltaNet scored 98.8, Gated DeltaNet 91.8 and Mamba2 30.4. On a harder test with real essays as filler, at 4K tokens, Gated DeltaNet scored 92.2, Mamba2 56.2 and DeltaNet 18.6: without a gate, the memory fills with junk. The authors report that Gated DeltaNet beat Mamba2, DeltaNet and other linear models at 400M and 1.3B parameters. Code is on GitHub.
Which released models use Gated DeltaNet
Shipping models use hybrids, with full attention every few blocks for precise recall.
- Qwen3-Next-80B-A3B: the model card lists 48 layers as 12 repeats of three Gated DeltaNet layers and one gated attention layer, with 262,144 tokens of native context.
- Qwen3.5: the Qwen3.5-27B card lists 64 layers in the same three-to-one pattern, also with 262,144 tokens native.
- Kimi Linear: Moonshot AI's card calls its Kimi Delta Attention "a refined version of Gated DeltaNet", with a separate decay per channel, and says it cuts KV cache needs by up to 75%.
The new paper: when the memory explodes
Gated DeltaNet-2 (GDN-2), from Hatamizadeh, Yejin Choi and Kautz (arXiv 2605.22791), split the single beta gate into two per-channel gates, one for erasing and one for writing. Its repository says NeurIPS 2026 accepted it.
Xichong Zhang and 13 co-authors from MemTensor, USTC, HKUST, SUSTech, SJTU and other institutions found a flaw in that split. GDN-2's erase step reads the memory along one direction and writes its correction along a slightly different one. They prove this lets erasure alone enlarge the state, with growth that can turn exponential even after the model stops writing. In the original Gated DeltaNet, reading and writing use the same key, and this can't happen.
At a 64K-token context, 3 of 8 GDN-2 pretraining runs and 4 of 8 post-training runs crashed with NaN losses. In one replayed crash the state overflowed at token 52,736. A run that finished normally still had state entries of 3.157 × 10^36, with nothing odd in the loss curve.
Stable GDN-2 splits the erase gate into two square roots, one on each side, so reading and writing point the same way and erasing can only shrink the state. Because that also weakens writing, the authors add a second write whose size is tied to how much the layer forgets. They prove the state then grows at most with the square root of the sequence length.
How much the fix helps
The team trained 20-layer models of about 1.6B parameters (pure linear) and 1.55B (one attention layer in four) on 82.78B tokens of 64K-token sequences. Against GDN-2:
- In the pure linear model, the average RULER long-context score at 128K tokens rose from 4.82 to 11.62, ahead of KDA and two other stabilization methods.
- In the hybrid, average accuracy on nine common-sense tasks rose from 49.91% to 50.53%.
The wins aren't across the board. In the hybrid at 128K, β-Guard and D-Clip scored slightly higher. KDA had lower perplexity in the pure linear setting. All the RULER scores are low in absolute terms, the main comparisons use one training seed, and the paper doesn't link to code.
The fix targets GDN-2, not the Gated DeltaNet layers shipping in Qwen models. Its lesson for anyone training delta-rule layers at long context is that a smooth loss curve doesn't prove the memory is healthy: check the size of the state. Next to watch: whether a lab ships GDN-2 or its stable variant, as Qwen did with Gated DeltaNet.
Frequently asked questions
What is the difference between Gated DeltaNet and Mamba?
Mamba2 fades all of its memory by one factor and then adds the new token, so it cannot change one stored fact without touching the rest. Gated DeltaNet keeps that gate but also uses the delta rule to overwrite the value stored for the current key. In the Gated DeltaNet paper's 1.3B tests, it beat Mamba2 on language modeling and on most needle-in-a-haystack retrieval tests.
Does Qwen use Gated DeltaNet?
Yes. The model cards for Qwen3-Next-80B-A3B and Qwen3.5-27B list a layout of three Gated DeltaNet layers followed by one gated attention layer, repeated through the model, with 262,144 tokens of native context.
What is Gated DeltaNet-2?
Gated DeltaNet-2 is a 2026 follow-up from NVIDIA researchers that replaces the single update gate with separate per-channel gates for erasing old memory and writing new values. A November 2026 paper found that this split can make the memory grow without bound during long-context training and proposed a stable variant.
Is there code for Gated DeltaNet?
Yes. NVIDIA's reference code is at github.com/NVlabs/GatedDeltaNet, and the DeltaNet kernels are in the open-source flash-linear-attention library.
Sources
- Gated Delta Networks: Improving Mamba2 with Delta RulearXiv (Yang, Kautz, Hatamizadeh)
- Parallelizing Linear Transformers with the Delta Rule over Sequence LengtharXiv (Yang et al.)
- Stable Gated DeltaNet-2: Understanding and Mitigating Recurrent State InstabilityarXiv (Zhang et al.)
- Stable Gated DeltaNet-2 paper pageHugging Face
- Gated DeltaNet-2: Decoupling Erase and Write in Linear Attention (repository)NVIDIA (NVlabs)
- Gated DeltaNet codeNVIDIA (NVlabs)
- Qwen3-Next-80B-A3B-Instruct model cardQwen
- Qwen3.5-27B model cardQwen
- Kimi-Linear-48B-A3B-Instruct model cardMoonshot AI
