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:

ModelLinear / full layersValue heads × d_k × d_vKV at max contextState (FP32)
Qwen3.5 0.8B18 / 616 × 128 × 1283.2 GB at 256K20.2 MB
Qwen3.5 2B18 / 616 × 128 × 1283.2 GB at 256K20.2 MB
Qwen3.5 4B24 / 832 × 128 × 1288.6 GB at 256K52.7 MB
Qwen3.5 9B24 / 832 × 128 × 1288.6 GB at 256K52.7 MB
Qwen3.5 27B48 / 1648 × 128 × 12817.2 GB at 256K157 MB
Qwen3.5 35B-A3B30 / 1032 × 128 × 1285.4 GB at 256K65.9 MB
Qwen3-Next 80B-A3B36 / 1232 × 128 × 1286.4 GB at 256K79.0 MB
Qwen3.5 122B-A10B36 / 1264 × 128 × 1286.4 GB at 256K156 MB
Qwen3.5 397B-A17B45 / 1564 × 128 × 1288.1 GB at 256K195 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