Qwen4-35B-A3B, and the linear-attention shorts
TL;DR. Alibaba opened the first mid-size Qwen4 model (Apache 2.0). Qwen4-35B-A3B is a 35B-total, 3B-active MoE, plus a 20B n-gram embedding table and a 2B MTP (multi-token prediction) module, with a native 1,048,576-token context and text, image and video input. Its 40 layers repeat a pattern of three Gated DeltaNet layers (linear attention with a fixed-size state) for every one Qwen Sparse Attention layer, whose indexer picks a budget of 512 blocks or 2,048 tokens per query. Experts: 256, with 8 routed plus 1 shared active. Reported jumps over Qwen3.8-27B: DeepSWE 42.2 to 61.8, Terminal-Bench 4.1 5.6 to 21.2, APEX-Agents 47.5 to 59.0 (third-party AA and Mercor scores). Day-one support in transformers, llama.cpp, vLLM, SGLang, Unsloth GGUFs (UD-IQ4_XS at 20.5 GB for 24 GB GPUs, with the n-gram table kept on SSD) and about 192 tok/s on an RTX 5090 per community reports. It entered Arena's Agent Arena with scores pending.
flowchart LR
T["Tokens<br/><small>plus n-gram lookup</small>"] --> G["3x Gated DeltaNet<br/><small>fixed-size state</small>"]
G --> M["MoE<br/><small>8 of 256 + shared</small>"]
M --> S["Sparse attention<br/><small>2,048-token budget</small>"]
S --> R["Repeat x10<br/><small>40 layers</small>"]
R --> O["Output + MTP<br/><small>draft next tokens</small>"]
classDef input fill:#d0ebff,stroke:#1971c2,color:#1b1b1b,stroke-width:2px
classDef core fill:#e5dbff,stroke:#6741d9,color:#1b1b1b,stroke-width:2px
classDef loop fill:#fff3bf,stroke:#f08c00,color:#1b1b1b,stroke-width:2px
classDef exit fill:#d3f9d8,stroke:#2f9e44,color:#1b1b1b,stroke-width:2px
class T input
class G,M core
class S,R loop
class O exit
Why it matters
- Cache footprint is the design target. Three of four layers hold a constant-size state; the fourth reads a bounded slice. This is the architecture the KV-quantization papers (SealKV, the 12-03 Hopper kernel) have the least to offer, because there is little growing cache left to compress.
- N-gram embeddings as cheap capacity: a 20B lookup table (10M bigram/trigram entries at layer 2) adds quality without compute; Unsloth parks it on SSD. Continues the conditional-memory-embeddings thread.
- Token efficiency is a headline claim: fewer interaction rounds and shorter thinking at each effort level.
Research shorts from the same window
- Born Attention is Linear (2612.02459): attention weights defined as quantum-measurement probabilities |<q,k>|^2 over complex vectors are an exact finite kernel, so attention becomes an O(T d^2) recurrence with constant-state decoding. On an A100: 6.4 MB per layer and 0.12 ms/token at any length, versus a 3.2 GB FlashAttention-2 cache at 2.26 ms/token at 1M; fused prefill overtakes FA2 between 16K and 32K (4x at 128K). Quality: trails softmax by 0.12 nats at 1K and 0.77 at 16K when bolted into a real GPT (attention dilution, fixed by a decay); at 128K on PG-19, Born with decay is 0.32 nats ahead of softmax but gated linear attention is close and 1.8x faster. Small scale only. arXiv
- SWGDN (2611.33257): swap the short convolution in Delta-rule linear attention for sliding-window attention over projected q, k, v, so consecutive state updates see more similar key-value pairs. Drop-in for GDN2 and KDA without changing the update rule; wins at 340M. Directly relevant to Qwen4's Gated DeltaNet layers. arXiv
- Critical Sequence Length (2612.03183): the rule "double sequence length, halve batch" assumes tokens are independent gradient samples. Within a document they are not, so gradient noise has a floor. Past a measurable S*, longer sequences add context but barely cut noise. S* is set by the data and packing (chopping documents halves the floor), is stable across 125M-1B when measured on AdamW updates, and validation loss is flat beyond it while downstream scores are more fragile. A cheap knob for long-context pretraining budgets. arXiv
Relation to prior wiki
- Fourth open hybrid in two weeks keeping full attention in a minority of layers: ERNIE 5.5 Flash (11-24, HCA in 37 of 43 layers), Olmicro (12-02, 80% Gated DeltaNet), LingSante-3.1-flash (12-03, hybrid linear-attention MoE), now Qwen4-35B-A3B. The pattern is settled for open mid-size models.
- Contrasts with Amazon Ergo (12-02, conservative GQA with 3:1 sliding-to-global and no linear attention): two different answers to the cache problem from the week's two biggest open releases.
- Concept pages: attention-mechanisms, kv-cache, scaling-laws.
Sources: Qwen4-35B-A3B card · HF blog · @TeksEdge · raw: raw/labs/2026-12-04-103426-labs.md, raw/huggingface/2026-12-03-born-attention-is-linear-*.md, raw/huggingface/2026-12-03-swgdn-*.md, raw/huggingface/2026-12-03-critical-sequence-length-*.md