Glossary · Attention
Linear attention (Gated DeltaNet)
Also: Gated DeltaNetlinear_attnhybrid attentionKimi Delta AttentionKDAfull_attention_interval
Read it at the depth you need: one sentence · a paragraph · the math · in the models here
1In one sentence
Attention replaced by a fixed-size memory that each token updates and reads: cost and memory stay constant however long the context. Hybrid models keep full attention on a few layers.
2In a paragraph
Ordinary attention compares each new token with every earlier one, so its cost and its KV cache grow with the context. Linear attention keeps a fixed-size memory instead: a small matrix per head that every token writes its key and value into and reads its query out of. Gated DeltaNet makes that memory forget (a learned decay per head) and overwrite rather than pile up (the "delta rule"). It is cheaper but recalls exact details less well, so Qwen3-Next and Qwen3.5 use it on three layers in four and keep full attention on the fourth.
3The math, shapes and parameters
Per head, with a state S of size dk × dv, decay αt and write strength βt (both computed from the token):
St = αt · St−1 (I − βt ktktT) + βt vtktT ot = St qt
The ktktT term erases what the state held for kt before writing the new value. Before this, q, k and v pass through a short depthwise convolution over the last 4 tokens; after it, a gated RMSNorm and an output projection. In Qwen3.5's checkpoint: in_proj_qkv [2Hk·dk + Hv·dv, d], in_proj_z (the gate), in_proj_a and in_proj_b [Hv, d], conv1d, A_log, dt_bias, norm, out_proj [d, Hv·dv].
state per layer = Hv × dk × dv numbers, at any context length
Kimi Delta Attention (Kimi Linear, Kimi K3) is a variant with a decay per channel rather than per head.
4In the 96 models on this site
The KV cache at the full context against the fixed state, per sequence:
| Model | Linear / full layers | Value heads × d_k × d_v | KV at max context | State (FP32) |
|---|---|---|---|---|
| Qwen3.5 0.8B | 18 / 6 | 16 × 128 × 128 | 3.2 GB at 256K | 20.2 MB |
| Qwen3.5 2B | 18 / 6 | 16 × 128 × 128 | 3.2 GB at 256K | 20.2 MB |
| Qwen3.5 4B | 24 / 8 | 32 × 128 × 128 | 8.6 GB at 256K | 52.7 MB |
| Qwen3.5 9B | 24 / 8 | 32 × 128 × 128 | 8.6 GB at 256K | 52.7 MB |
| Qwen3.5 27B | 48 / 16 | 48 × 128 × 128 | 17.2 GB at 256K | 157 MB |
| Qwen3.5 35B-A3B | 30 / 10 | 32 × 128 × 128 | 5.4 GB at 256K | 65.9 MB |
| Qwen3-Next 80B-A3B | 36 / 12 | 32 × 128 × 128 | 6.4 GB at 256K | 79.0 MB |
| Qwen3.5 122B-A10B | 36 / 12 | 64 × 128 × 128 | 6.4 GB at 256K | 156 MB |
| Qwen3.5 397B-A17B | 45 / 15 | 64 × 128 × 128 | 8.1 GB at 256K | 195 MB |
Introduced in Yang, Kautz and Hatamizadeh, “Gated Delta Networks: Improving Mamba2 with Delta Rule” (2024).
Related
Mamba (state-space layers) · Self-attention · KV cache · Sliding-window attention · every term