Attention

Linear attention (gated DeltaNet)

Replaces the attention matrix with a fixed-size recurrent state. Cost stays constant per token, no KV cache growth.

First page of Transformers are RNNs: Fast Autoregressive Transformers with Linear AttentionIntroduced inJun 2020Transformers are RNNs: Fast Autoregressive Transformers with Linear AttentionKatharopoulos et al. · arXiv 2006.16236 ↗
Attentionthe KV cache grows with every tokenGated recurrent stateevery token rewrites one fixed SσScost per token growscost stays constant

Linear attention keeps a compact running state that is updated once per token (here with the gated delta rule: the state is selectively decayed and rewritten), so generation cost does not grow with context length and there is no per-token KV cache. Qwen3.5-style hybrids use linear attention in most layers and keep periodic full-attention layers for precise long-range recall. The best of both worlds for long contexts.

Adoption over time

Share of new models that have included linear attention over time.

27%2022202320242025202627%20222023202420252026

See it in real models

Open any of these on hfviewer to find this block in the interactive architecture graph.

Qwen/Qwen3.5-9B architecture graphQwen/Qwen3.5-9Bimage-text-to-text · ↓ 9.2M · ♡ 2kOpen in visualizer nvidia/Qwen3.6-35B-A3B-NVFP4 architecture graphnvidia/Qwen3.6-35B-A3B-NVFP4text-generation · ↓ 8.7M · ♡ 483Open in visualizer Qwen/Qwen3.6-35B-A3B-FP8 architecture graphQwen/Qwen3.6-35B-A3B-FP8image-text-to-text · ↓ 7.6M · ♡ 318Open in visualizer Qwen/Qwen3.5-4B architecture graphQwen/Qwen3.5-4Bimage-text-to-text · ↓ 6.6M · ♡ 740Open in visualizer Qwen/Qwen3.6-35B-A3B architecture graphQwen/Qwen3.6-35B-A3Bimage-text-to-text · ↓ 6.2M · ♡ 2kOpen in visualizer Qwen/Qwen3.6-27B-FP8 architecture graphQwen/Qwen3.6-27B-FP8image-text-to-text · ↓ 5.7M · ♡ 313Open in visualizer Qwen/Qwen3.6-27B architecture graphQwen/Qwen3.6-27Bimage-text-to-text · ↓ 5.3M · ♡ 2kOpen in visualizer Qwen/Qwen3-Coder-Next-FP8 architecture graphQwen/Qwen3-Coder-Next-FP8text-generation · ↓ 2.9M · ♡ 161Open in visualizer Qwen/Qwen3.5-0.8B architecture graphQwen/Qwen3.5-0.8Bimage-text-to-text · ↓ 2.7M · ♡ 626Open in visualizer Qwen/Qwen3.5-27B architecture graphQwen/Qwen3.5-27Bimage-text-to-text · ↓ 2.6M · ♡ 1kOpen in visualizer Qwen/Qwen3.5-35B-A3B architecture graphQwen/Qwen3.5-35B-A3Bimage-text-to-text · ↓ 2.4M · ♡ 1kOpen in visualizer datalab-to/chandra-ocr-2 architecture graphdatalab-to/chandra-ocr-2image-text-to-text · ↓ 2.2M · ♡ 448Open in visualizer

Browse all 204 models with this in the catalog →

Related concepts

hfviewer renders the full architecture of 2,300+ Hugging Face models as interactive graphs. Hover any block to see what it does, with this model’s real numbers.

Browse all model graphs →