AI
Qwen4-35B-A3B: Hybrid MoE Architecture, 1M-Token NVFP4 Cache, and the Token Verbosity Trade-Off
Alibaba's Qwen4-35B-A3B brings a 1,048,576-token native context window and Apache 2.0 weights to a 3B-active Mixture-of-Experts model—shrinking 1M-token KV cache to 8 GiB in NVFP4. Yet independent Artificial Analysis runs show it generates 175 million tokens across the Intelligence Index, turning a $0.06/1M input rate into $0.55 per task. Here is the full architectural, benchmark, and vLLM deployment breakdown.
11 min read
Qwen4-35B-A3B: Hybrid MoE Architecture, 1M-Token NVFP4 Cache, and the Token Verbosity Trade-Off
Executive Summary
On December 4, 2026, Alibaba's Qwen team released Qwen4-35B-A3B under an ungated Apache 2.0 license, marking the first open-weight release of the Qwen4 series (following repository creation on December 3). The model pairs 35 billion main parameters (~3B–3.8B active per token) with a 20B Per-Layer N-gram Embedding (PLE) table and a 2B Multi-Token Prediction (MTP) module—totaling ~56.8B–57B stored parameters—and supports native text, image, and video inputs across a 1,048,576-token context window.
For production AI engineers, the release presents a sharp architectural and economic split:
- Memory breakthrough for long context: By pairing 30 Gated DeltaNet linear attention layers with only 10 Qwen Sparse Attention (QSA) layers trained for NVFP4 KV caching, a full 1M-token context requires just 8 GiB of KV cache in vLLM's day-0 implementation (versus 80–86 GiB for 40-layer BF16 full attention).
- High single-GPU throughput: On a single NVIDIA B300 with FP8 weights and MTP-3 speculative decoding, vLLM sustains 514 output tokens/s at concurrency 1 (P50 TPOT of 1.91 ms, P50 TTFT of 46 ms).
- The verbosity trap: Independent testing by Artificial Analysis (reported by OrcaRouter on December 4, 2026) places
Qwen4-35B-A3B(xhigh) at 25 on the Intelligence Index (#1 of 6 in its class, vs. a median of 9). However, it generated 175 million tokens to complete the suite against a class median of 95.9 million, taking 14.3 minutes per task and pushing total evaluation cost to $0.55 per task despite a listed $0.06/1M input rate. - Strong document & repo analysis, weaker terminal agents: It beats the larger
Qwen3.8-Flash-Nexton DeepSWE v1.1 (61.8 vs. 58.7) and HealthBench Professional (47.4% vs. 34.8%), but trails by 11 points on FrontierCode-AA 2.0 (16.1 vs. 27.1).
Architecture & How It Works
Rather than a clean-sheet redesign, Qwen4-35B-A3B productionizes the hybrid architecture previewed in Qwen3.8-Flash-Next (Hugging Face Blog). Its 40 layers are organized into 10 repeating blocks, each consisting of three Gated DeltaNet linear attention layers followed by one Qwen Sparse Attention (QSA) layer, with every attention layer followed by a fine-grained Mixture-of-Experts (MoE) sublayer.
flowchart LR
Input["Input Tokens / Vision Embeddings"] --> Layer2["Layer 2: 20B N-Gram Lookup (10M Bigrams/Trigrams, Host RAM)"]
Layer2 --> BlockLoop["10x Hybrid Blocks (40 Layers Total)"]
subgraph BlockLoop["Each 4-Layer Block (4-Stream Gated Residuals)"]
direction LR
GDN["3x Gated DeltaNet (Fixed State) + MoE (8+1/256 Experts)"] --> QSA["1x Qwen Sparse Attention (NVFP4 KV, Top-512 Blocks) + MoE"]
end
BlockLoop --> MTP["1-Layer MTP-3 Draft Head (2B Params)"]
MTP --> Output["4-Token Parallel Verify & Output"]Core Architectural Specifications
| Component | Specification | Engineering Implication |
|---|---|---|
| Total / Active Parameters | ~35B main (~3B–3.8B active) + 20B N-gram + 2B MTP (~57B total) | Low FLOPs per token, but 56.8B weights must still sit in memory or host RAM |
| Layer Topology | 40 layers: 10 × (3 × Gated DeltaNet → MoE, 1 × QSA → MoE) |
75% of layers hold fixed-size recurrent state with zero KV cache growth |
| Gated DeltaNet | 32 V heads, 16 QK heads, head dim 128 | Compresses long sequences into constant memory |
| Qwen Sparse Attention (QSA) | 16 Q heads, 2 KV heads, head dim 256, RoPE dim 64 | MQA indexer (4 Q, 1 shared K, dim 128) selects top 512 4-token blocks (2,048 tokens) |
| Mixture of Experts (MoE) | 256 routed experts; 8 routed + 1 shared active; dim 512 | Fine-grained routing keeps active compute ~3B–3.8B |
| Gated Residuals | 4 residual streams, bottleneck rank 256 | Mixes multi-stream state around every attention and MoE sublayer |
| N-gram Embeddings | 10,000,000 bigrams/trigrams at Layer 2 (~20.5B params) | Lookups replace matrix math; vLLM pins table in host RAM to save 20.5 GB VRAM |
| Native Context & Modalities | 1,048,576 tokens; text, image, video | Trained natively for NVFP4 KV cache (3.6x smaller than BF16) |
| License | Apache 2.0 (ungated) | Unrestricted commercial and self-hosted deployment |
Storage vs. Compute: The 57B Footprint Surprise
The model's name emphasizes its 35B main weights and 3B active parameters, but engineers deploying it locally must account for the 20.5B N-gram embedding table and 2B MTP module. Because N-gram embeddings are table lookups rather than dense matrix multiplications, they add virtually zero FLOPs per token while inflating disk and memory requirements:
- BF16 checkpoint: 113.7 GB total (72.7 GB model + 41 GB N-gram table), requiring four 80 GB accelerators unless offloaded.
- FP8 checkpoint: 60.2 GB total (39.7 GB model + 20.5 GB N-gram table). When vLLM pins the N-gram table in host RAM and prefetches rows over a side CUDA stream, the active model plus a full 1M-token context fits comfortably on a single 80 GB GPU.
- 4-bit quantizations (GGUF / AWQ): Roughly 30 GB, allowing local execution on a single 48 GB workstation GPU or high-memory unified-memory Mac.
API & Reasoning Effort Controls
Qwen4-35B-A3B defaults to thinking mode (reasoning_effort="high", preserve_thinking=True) and supports four explicit levels: xhigh, high, low, and off (equivalent to enable_thinking=False). Because Qwen's reference tokenizer distinguishes control tokens at the ID level and relies on tiktoken, production deployments must pass trust_remote_code=True rather than relying solely on Jinja compatibility templates.
{
"model": "Qwen/Qwen4-35B-A3B",
"messages": [
{ "role": "user", "content": "Audit this repository diff for race conditions." }
],
"temperature": 1.0,
"top_p": 0.95,
"extra_body": {
"top_k": 20,
"chat_template_kwargs": {
"reasoning_effort": "high",
"preserve_thinking": true
}
}
}
For long-horizon agentic tasks, Qwen recommends capping internal reasoning at 262,144 tokens and final output at 131,072 tokens within the 1M window. For hour-scale video inputs, overriding video_preprocessor_config.json with longest_edge: 469762048 (224k video tokens) enables higher frame-rate sampling.
Benchmarks, Cost & Latency Analysis
Vendor launch charts can obscure real-world trade-offs, so we compare Qwen's published 12-panel numbers against independent evaluations from Artificial Analysis (via OrcaRouter) and BenchLM, alongside day-0 serving benchmarks from vLLM.
Vendor-Reported Capability Benchmarks
Across Qwen's 12-panel comparison against the larger Qwen3.8-Flash-Next and dense Qwen3.8-27B (combining Artificial Analysis, Mercor's APEX-Agents, and Qwen's internal Work360):
| Benchmark | Qwen4-35B-A3B | Qwen3.8-Flash-Next | Qwen3.8-27B | Source / Note |
|---|---|---|---|---|
| DeepSWE v1.1 | 61.8 (#1 <128B) | 58.7 | 42.2 | Vendor chart / HF card |
| Terminal-Bench 4.1 | 21.2 (#1 <128B) | 24.2 | 5.6 | Artificial Analysis (xhigh) |
| FrontierCode-AA 2.0 | 16.1 | 27.1 | 14.9 | Artificial Analysis |
| NL2Repo | 51.7 | 48.1 | 42.3 | Vendor chart |
| APEX-Agents v1.1 | 59.0 | 61.0 | 47.5 | Mercor leaderboard |
| AutomationBench-AA | 57.9 | 55.9 | 48.2 | Artificial Analysis |
| HealthBench Professional | 47.4% | 34.8% | 29.8% | Vendor chart |
| GPQA Diamond | 86.9% | 91.7% | 89.2% | Vendor chart |
| Work360 | 42.9% | 43.7% | 37.1% | Qwen internal benchmark |
| Chartography | 27.8 (tie) | 24.6 | 27.8 (tie) | min_pixels = 4096×32×32 |
| VideoIndex | 52.9 | 51.4 | 51.9 | Vendor chart |
| AA-Briefcase v1.1 (Elo) | 1486 | 1567 | 1391 | Artificial Analysis |
Pattern check: Qwen4-35B-A3B wins 6 and loses 6 against Qwen3.8-Flash-Next. Its strengths cluster around long-context knowledge retrieval, repository-scale reading (DeepSWE, NL2Repo), and domain reasoning (HealthBench). Its weaknesses cluster around interactive terminal and code-editing agents (trailing by 11 points on FrontierCode-AA 2.0 and 3 points on Terminal-Bench 4.1).
On the independent BenchLM leaderboard (December 4, 2026), Qwen4-35B-A3B currently holds an Estimated composite score of 52.3/100 (#87 of 218 models overall, #50 of 182 in Coding), reflecting partial independent coverage on day one. Notably, Qwen's own blog also disclosed a cyber-defense evaluation where the base model passed 4 of 12 checks, a 50-example adversarial fine-tune passed 6 of 12, and a 100-example fine-tune regressed to 3 of 12—underscoring that there is no separate safety card yet.
The Token-Price vs. Task-Cost Inversion
Independent Artificial Analysis telemetry highlights why per-million-token pricing can mislead budget projections:
- Listed API Pricing: Reported at $0.06 / 1M input tokens and $0.36 / 1M output tokens on Artificial Analysis (with a 95% cache discount), while Kingy.ai notes QwenCloud Singapore rates of $0.06 / $0.48 per 1M tokens. Caveat: Artificial Analysis's page simultaneously displayed "no publicly available API" in secondary chart legends and Qwen's launch blog did not publish official per-token rates, so treat these figures as provisional until verified on Alibaba Cloud's billing console.
- Output Speed vs. Verbosity: Although the model streams at a brisk 238 tokens/s on AA's endpoint, it consumed 175 million tokens to finish the Intelligence Index—1.82x the class median of 95.9 million tokens.
- Per-Task Cost & Latency: Because of that verbosity at
xhighreasoning effort, average task duration stretched to 14.3 minutes (vs. 5.3 minutes median), pushing total Intelligence Index cost to $0.55 per task (ranking 4th of 5 in its class despite having the lowest input rate).
Day-0 Serving & Zero-Mismatch RL Throughput (vLLM)
Because only 3B parameters activate per token, decode steps are fast enough (~4 ms for a 4-position verify + 3-token MTP draft on an NVIDIA B300) that CPU overhead, kernel launch gaps, and top-k/top-p sampling become the primary bottleneck. To solve this, the vLLM and Inferact teams shipped CUDA-graph in-place indexer updates (#58449), parallel vocabulary sampling masks (#66792), and Programmatic Dependent Launch (PDL) kernel overlapping:
| Hardware & Workload | Throughput | Latency / Notes |
|---|---|---|
| 1x NVIDIA B300 (FP8, c=1) | 514 tok/s | P50 TPOT 1.91 ms, P50 TTFT 46 ms (2.25 accepted tokens/step) |
| 1x NVIDIA B300 (FP8, c=4) | 336 tok/s per req | P50 TPOT 2.81 ms, P50 TTFT 62 ms |
| 1x NVIDIA GB200 (RL Rollout, c=32, BI=1) | 6,322 tok/s | 0 / 682,536 bit mismatches across 10 DAPO steps (92.7% of BI=0 speed) |
| 1x NVIDIA GB200 (RL Rollout, c=64, BI=1) | 8,894 tok/s | 89.2% of BI=0 speed (9,966 tok/s) |
Without batch invariance (VLLM_BATCH_INVARIANT=0), 97.8% of generated tokens (4,005 of 4,096) diverged between vLLM rollout and Megatron-LM training; enabling VLLM_BATCH_INVARIANT=1 eliminates the divergence while preserving NVFP4 KV cache, FP8 indexer, MTP-3, and prefix caching.
Production Deployment & Trade-Offs
When to Adopt Qwen4-35B-A3B
- Single-pass, long-document & multimodal analysis: If your pipeline ingests 200k–1M token PDFs, hour-long videos, or entire codebases (DeepSWE / NL2Repo) and asks focused questions, the 8 GiB NVFP4 KV cache and $0.06/1M input economics are unmatched in the Apache 2.0 tier.
- Single-GPU 80 GB or 48 GB local hosting: Offloading the 20.5 GB FP8 N-gram table to pinned host RAM lets one 80 GB card serve full 1M-token contexts, while 4-bit GGUF/MLX builds run locally on 48 GB cards or 24–48 GB Apple Silicon machines (with reduced context).
- Batch-invariant RL pipelines: Teams running SkyRL or Megatron-LM reinforcement learning get day-0 bitwise reproducibility on Blackwell hardware at ~90% of peak rollout speed.
When to Wait or Use Alternatives
- Multi-turn terminal and coding agents: At
xhighreasoning effort, the model's 1.8x verbosity and 14.3-minute task times create severe queueing and output-cost penalties, while FrontierCode-AA 2.0 (16.1) lagsQwen3.8-Flash-Next(27.1). Testreasoning_effort="low"or"off", or route agentic coding loops toQwen3.8-Flash-Nextor frontier API models. - Short-context, latency-sensitive chat: If your prompts rarely exceed 32k tokens, carrying 20B extra N-gram parameters in host or GPU memory adds checkpoint download and RAM overhead without unlocking long-context savings.
Deployment Gotchas Checklist
- Use
vllm/vllm-openai:qwen4(NVIDIA) orvllm/vllm-openai-rocm:qwen4(AMD MI350X/MI355X): Older vLLM releases lack the in-place MTP indexer CUDA graph update and NVFP4 sparse attention kernels. - Pin
trust_remote_code=True: Required for the referencetiktoken-backed Qwen4 tokenizer to preserve exact control-token IDs. - Audit
reasoning_effortper route: Defaulthigh(and especiallyxhigh) inflates output token bills; explicitly setloworofffor deterministic extraction or UI-facing endpoints.
FAQ
1. Why does a "35B" model have a 113.7 GB BF16 checkpoint?
Qwen4-35B-A3B has 35B main transformer/MoE parameters (~3B–3.8B active per token), plus a 20.5B Per-Layer N-gram Embedding (PLE) table at layer 2 and a 2B MTP layer, totaling ~56.8B–57B stored parameters. The N-gram table adds storage and RAM overhead, not per-token compute FLOPs.
2. How much VRAM is required to run the full 1M-token context?
With vLLM's FP8 checkpoint, the model weights take 39.7 GB, the 20.5 GB N-gram table sits in pinned host RAM, and the 1M-token NVFP4 KV cache for the 10 QSA layers takes just 8 GiB. That allows a single 80 GB GPU (H100/H200/B200/B300) to hold the model and full 1M context.
3. Can I use Qwen4-35B-A3B commercially?
Yes. The weights are released under the Apache 2.0 license on Hugging Face with no additional acceptable-use restrictions.
4. Why did Artificial Analysis report $0.55 per task if input tokens cost $0.06/1M?
At xhigh reasoning effort, Qwen4-35B-A3B generated 175 million output/reasoning tokens across the Intelligence Index (nearly double the 95.9M class median). In output-heavy reasoning loops, token verbosity—not input price—dominates the final bill.
5. Which local and cloud inference engines support Qwen4-35B-A3B on day 0?
Day-0 support is available in vLLM, SGLang, Hugging Face Transformers, llama.cpp, Ollama, Unsloth, MLX, LiteRT-LM, and Alibaba T-Head Zhenwu (vllm-sail).
Sources
- Qwen/Qwen4-35B-A3B Model Card — Hugging Face (Published December 4, 2026 — Primary)
- Welcome Qwen 4: Cutting-edge intelligence on-device — Hugging Face Blog (Published December 4, 2026 — Primary)
- Qwen4-35B-A3B on vLLM: Day-0 Support — vLLM Blog (Published December 4, 2026 — Primary)
- Qwen4-35B-A3B: AA Index 25, but $0.55 a Task — OrcaRouter (Published December 4, 2026 — Secondary)
- Qwen4-35B-A3B Benchmarks & Context — BenchLM (Updated December 4, 2026 — Secondary)
- Alibaba opens Qwen4-35B-A3B with multimodal input and million-token context — TechNode (Published December 4, 2026 — Secondary)