Qwen4-35B-A3B: Alibaba's First Open-Weight Qwen4 Multimodal MoE, 3:1 Hybrid Attention, and 20.5B PLE Offloading
Inside Qwen4-35B-A3B: Alibaba's Apache 2.0 35B MoE (3B active) with 1M multimodal context, 3:1 Gated DeltaNet + QSA attention, and 20.5B PLE offloading.

Summary
Three weeks ago, when Alibaba Cloud launched the closed, subscription-gated qwen4-max-preview, the open-source community wondered whether the Qwen4 generation marked a quiet retreat from open weights (a crossroads we analyzed in Qwen4-Max Preview and Alibaba’s Open-Weights Crossroads). On December 4, 2026, Alibaba’s Qwen team delivered an emphatic answer: Qwen/Qwen4-35B-A3B is officially open-weight under the permissive Apache 2.0 license.
More importantly, Qwen4-35B-A3B is not a warmed-over dense checkpoint. It debuts the production Qwen4 open-weight blueprint: a natively multimodal Mixture-of-Experts (MoE) backbone with 35B total backbone parameters (~3B–3.8B active per token), a 1-million-token (1,048,576) native context window across text, images, and video, and a 3:1 hybrid attention stack pairing 30 Gated DeltaNet linear-attention layers with 10 Qwen Sparse Attention (QSA) layers. Hidden inside the full checkpoint is a fascinating systems twist: an additional ~20.5B Per-Layer N-gram Embedding (PLE) table and ~2B Multi-Token Prediction (MTP) head—bringing the total weight count on disk past 56B while still allowing quantized single-GPU execution by offloading the zero-matmul PLE tables straight to host RAM or memory-mapped SSD.
Hugging Face / Official Model Card Summary
| Specification | Qwen4-35B-A3B Details |
|---|---|
| Official Repository | Qwen/Qwen4-35B-A3B (Hugging Face) & ModelScope |
| License | Apache 2.0 (fully open-weight, commercial-friendly) |
| Backbone Architecture | 40-layer hybrid decoder: 10 × (3 × Gated DeltaNet + 1 × Qwen Sparse Attention) + Sparse MoE |
| MoE Configuration | 35B main backbone (256 routed experts, top-8 active + 1 shared expert; ~3B–3.8B active per token) |
| Auxiliary Memory Modules | ~20.5B Per-Layer N-gram Embeddings (PLE) + ~2B Multi-Token Prediction (MTP) speculative head |
| Native Modalities | Text, Images, and Video (native multimodal vision-language pipeline) |
| Context Window | 1,048,576 tokens (1M native) |
| Reasoning Modes | Dual-mode toggle: Thinking (deep coding/agent loops) and Non-Thinking (fast interactive responses) |
| Day-0 Quantizations & Engines | vLLM (NVFP4 KV cache), SGLang, ggml-org GGUF, Unsloth GGUF & MLX, RadixArk/Qwen4-35B-A3B-NVFP4 |
Prior Reading Material
To get the most out of this architectural breakdown—especially the continuity from Alibaba’s closed preview, the MoE routing mechanics, and the benchmark comparison against Inkling 2 Mini—check out these related deep dives:
- Qwen4-Max Preview: 1M Multimodal Context, 393K Thinking Budget, and Alibaba’s Open-Weights Crossroads — Our November 15 analysis of the closed
qwen4-max-previewlaunch and the community debate this release directly resolves. - Frontier MoE Deep-Dive: Analyzing Alibaba’s Qwen 3.8 Flagship Architecture, Performance, and Token Pricing — The previous-generation Qwen3.8 baseline that Qwen4-35B-A3B now outperforms at roughly one-third the active footprint.
- Thinking Machines Inkling 2 Mini: Looped MoE Architecture, Benchmarks, and Running Locally on a Laptop — Direct local-AI competitor featured alongside Qwen4-35B-A3B in Alibaba’s official launch benchmarks.
- Understanding Mixture-of-Experts (MoE): From Specialist Clinics to Kimi K3’s 896-Expert Router — Intuitive primer on sparse expert routing, shared experts, and active-versus-total parameter economics.
- vLLM v0.32.0: /v1/systemone Structured Decisions, NVFP4 KV Cache Everywhere, Model Runner V2, and Multi-API Worker Scaling — Explains the
nvfp4KV cache compression that makes serving Qwen4-35B-A3B at 1M context practical in production.
1. From Speculation to Apache 2.0: Resolving the Qwen4 Crossroads
When we covered Qwen4-Max Preview in mid-November, Alibaba had shipped only a single proprietary, two-week API snapshot (qwen4-max-preview, later rolling into the 2.4T proprietary Qwen4-Max flagship) with zero downloadable weights and zero official benchmark tables. Developers who had relied on Alibaba’s track record of 470+ open-weight releases legitimately asked whether Qwen4 would stay locked behind Alibaba Cloud Model Studio.
flowchart TD
classDef hist fill:#0f172a,stroke:#38bdf8,stroke-width:2px,color:#ffffff;
classDef tension fill:#1c1812,stroke:#f59e0b,stroke-width:2px,color:#ffffff;
classDef release fill:#064e3b,stroke:#10b981,stroke-width:2px,color:#ffffff;
A["Sept 22, 2026: Alibaba previews four-tier Qwen4 roadmap at Apsara"]:::hist
B["Nov 11–16, 2026: Proprietary Qwen4-Max ships API-only behind Token Plan"]:::tension
C["Community Debate: Is Alibaba pivoting away from open weights for Qwen4?"]:::tension
D["Dec 4, 2026: Qwen4-35B-A3B drops on Hugging Face & ModelScope under Apache 2.0"]:::release
A --> B --> C --> D
With Qwen4-35B-A3B, Alibaba not only kept its open-weight commitment—it skipped releasing a traditional dense 27B model in favor of a far more ambitious 35B-total / ~3B-active multimodal MoE that decisively beats dense Qwen3.8-27B while matching Qwen3.8-Flash-Next at roughly one-third the size.
2. Inside the 40-Layer 3:1 Hybrid Architecture
The core engineering problem of 2026 open-weight models is brutally simple: a 1-million-token context window is useless if the KV cache explodes your GPU memory and grinds decode speed to single-digit tokens per second.
Classic Transformers force every layer to store Key and Value vectors for every single previous token. Multiply 40 dense attention layers by 1,048,576 tokens, and your memory budget vanishes before the model finishes reading a single enterprise repository. Qwen4-35B-A3B solves this by refusing to treat every layer equally.
Figure 1: Qwen4-35B-A3B’s 40-layer decoder repeats a 4-layer block ten times—interleaving three fixed-memory Gated DeltaNet linear-attention layers with one global Qwen Sparse Attention (QSA) layer, paired with a 256-expert MoE and a built-in Multi-Token Prediction head.
Think of the 40-layer stack like an engineering team reviewing a massive 500-page codebase:
- 30 Gated DeltaNet Layers (The Fast Running-Notes Readers): Three out of every four layers use Gated DeltaNet, a linear-attention mechanism that maintains a fixed-size recurrent memory state instead of an ever-growing KV table. Whether the prompt is 4,000 tokens or 900,000 tokens long, a Gated DeltaNet layer updates its compact working state in constant memory—handling local syntax, flow, and running context at blistering speed.
- 10 Qwen Sparse Attention (QSA) Layers (The Indexed Deep-Lookup Specialists): Every fourth layer switches to Qwen Sparse Attention. Rather than attending blindly to all one million tokens, QSA groups tokens into blocks and uses a lightweight learned indexer (which
vLLMcaches cleanly in FP8) to jump straight to the exact high-relevance paragraphs or code symbols anywhere in the 1M-token window. - 256-Expert Fine-Grained MoE (
Top-8 + 1 Shared): Every layer feeds into a fine-grained Mixture-of-Experts bank of 256 routed experts plus 1 always-on shared expert. Each token activates only 8 routed specialists plus the shared generalist—giving the model 35B parameters of specialized capacity while paying only ~3B–3.8B active parameters of compute per generated token. - Native Multi-Token Prediction (MTP): Instead of requiring you to host a separate draft model for speculative decoding, Qwen4-35B-A3B ships with an integrated ~2B MTP head that drafts multiple upcoming tokens per forward pass and verifies them in parallel.
3. The Hidden 20.5B Parameter Twist: Per-Layer N-gram Embeddings (PLE)
If you download the Qwen/Qwen4-35B-A3B weights from Hugging Face and inspect the file sizes, you will notice an immediate surprise: a model named “35B” carries more than 56B total parameters on disk.
Where do the extra ~22B parameters come from? About ~2B belong to the MTP speculative head, and roughly 20.5B parameters belong to Per-Layer N-gram Embeddings (PLE)—an Engram-style conditional memory architecture that decouples factual/phrase storage from reasoning compute.
Figure 2: Splitting Qwen4-35B-A3B’s ~56B+ total weights across hardware tiers—keeping the hot 35B MoE backbone and 2B MTP head in GPU VRAM while offloading the 20.5B O(1) Per-Layer N-gram Embedding (PLE) lookup tables to host system RAM or memory-mapped SSD.
Here is why that architectural split is a gift for local and single-GPU deployments:
- Zero Matrix Multiplications for PLE: Traditional transformer weights must sit inside high-bandwidth GPU HBM/GDDR because every token triggers massive matrix multiplications across them. A Per-Layer N-gram Embedding table works like a giant encyclopedia index: given the current token n-gram, the runtime performs a tiny O(1) memory lookup and adds the retrieved vector into the layer’s hidden state.
- Clean Host RAM / SSD Offloading: Because PLE lookups transfer only a handful of kilobytes per token, they do not need to occupy precious GPU VRAM. Local runtimes like llama.cpp and Unsloth explicitly route
per_layer_token_embdtensors to host CPU RAM or memory-mapped storage (mmap), leaving your 24 GB GPU free to hold the quantized 35B MoE backbone, the MTP head, and a generous context window.
4. Official Benchmarks: Coding, Agentic Work, and Multimodal Recall
Alibaba’s official launch benchmark suite compares Qwen4-35B-A3B directly against three clear reference points: the much larger Qwen3.8-Flash-Next, the previous-gen dense Qwen3.8-27B, and Thinking Machines’ local-first Inkling 2 Mini.
Figure 3: Official Qwen4-35B-A3B evaluation results across 12 software engineering, professional agent, healthcare, reasoning, and multimodal benchmarks compared against Qwen3.8-Flash-Next, Qwen3.8-27B, and Inkling 2 Mini. Source: Qwen / Alibaba Cloud.
| Benchmark | Domain | Qwen4-35B-A3B | Qwen3.8-Flash-Next | Qwen3.8-27B | Inkling 2 Mini |
|---|---|---|---|---|---|
| DeepSWE v1.1 | Software Engineering | 61.8 | 58.7 | 42.2 | 48.2 |
| NL2Repo | Repository Development | 51.7 | 48.1 | 42.3 | 41.8 |
| Terminal Bench 4.1 | Terminal Agent | 21.2 | 24.2 | 5.6 | 5.6 |
| FrontierCode-AA 2.0 | Competitive / Frontier Coding | 16.1 | 27.1 | 14.9 | 15.1 |
| AutomationBench-AA | Task Automation | 57.9 | 55.9 | 48.2 | 41.8 |
| APEX Agents v1.1 | Professional Agent Tasks | 59.0 | 61.0 | 47.5 | 50.9 |
| Work360 | Professional Knowledge Work | 42.9 | 43.7 | 37.1 | 30.4 |
| AA-Briefcase v1.1 (Elo) | Enterprise Workflow Elo | 1486 | 1567 | 1391 | 1263 |
| HealthBench Professional | Healthcare Reasoning | 47.4 | 34.8 | 29.8 | 45.7 |
| GPQA | Graduate-Level Science | 86.9 | 91.7 | 89.2 | 86.9 |
| Chartography | Chart Understanding (Vision) | 27.8 | 24.6 | 27.8 | 22.1 |
| VideoIndex | Video Understanding | 52.9 | 51.4 | 51.9 | 44.0 |
Three Key Takeaways from the Numbers
- A Generational Leap in Long-Horizon Software Engineering: On DeepSWE v1.1 (
61.8vs.42.2), NL2Repo (51.7vs.42.3), and Terminal Bench 4.1 (21.2vs.5.6— nearly 4× higher), Qwen4-35B-A3B crushes the denseQwen3.8-27Bwhile activating a fraction of the compute per token. It even beats the largerQwen3.8-Flash-Nexton both DeepSWE v1.1 and NL2Repo. - Real-World Agentic Focus Over Static Trivia: Notice the intentional trade-off on GPQA (
86.9vs.Qwen3.8-27B’s89.2) contrasted with massive gains on HealthBench Professional (47.4vs.29.8), AutomationBench-AA (57.9vs.48.2), and APEX Agents v1.1 (59.0vs.47.5). Qwen4-35B-A3B is clearly post-trained for multi-step enterprise tool execution, long-document analysis, and domain grounding rather than static exam memorization. - Genuine Native Multimodality: Leading VideoIndex (
52.9) and tying for first on Chartography (27.8) confirms that its vision-and-video pipeline is a first-class citizen—not a bolted-on adapter—making it compelling for enterprise PDFs, dashboards, and screen-recording agent loops.
Independent Audit: Artificial Analysis Intelligence Index, Pricing & Verbosity
Independent evaluations from Artificial Analysis corroborate Qwen4-35B-A3B’s efficiency while highlighting one crucial production caveat: reasoning verbosity.
Figure 4: Independent Intelligence Index scores, API token pricing, and evaluation verbosity for Qwen4-35B-A3B (
xhigh) compared against Mistral Large 4, Inkling 2 Mini, and proprietary Qwen4-Max. Source: Artificial Analysis and Alibaba Cloud.
- Punching Far Above Its Weight Class: Evaluated at
xhighreasoning effort, Qwen4-35B-A3B scores 25 on the Artificial Analysis Intelligence Index—comfortably ahead of the open-weight 40B–150B parameter median, +5 points ahead of Inkling 2 Mini (20), and just a single point behind the much heavier Mistral Large 4 (26). - 25× Lower Input Cost Than
Qwen4-Max: On hosted API endpoints (Alibaba Cloud Model Studio / Artificial Analysis tracking),Qwen4-35B-A3Bis priced around $0.06 / 1M input tokens and $0.36–$0.48 / 1M output tokens, versus $1.50 / $4.50 per 1M tokens for proprietary Qwen4-Max (Intelligence Index 43). - The Verbosity Caveat (
175MEval Tokens): Artificial Analysis flagged thatQwen4-35B-A3Batxhigheffort generates roughly 175M tokens across the benchmark suite—about 1.82× the industry median (95.9Mtokens). Because output tokens cost 6×–8× more than input tokens (and dictate wall-clock latency), production teams should reserve Thinking mode for complex multi-file coding or debugging and switch to Non-Thinking mode for routine classification, extraction, and short tool calls.
5. Day-0 Support from vLLM: 514 tok/s on B300, 8 GiB 1M Context & Zero-Mismatch RL
Alongside Alibaba’s release, the vLLM Team and Inferact published an in-depth Day-0 engineering breakdown for Qwen4-35B-A3B demonstrating what it takes to serve a 3B-active hybrid MoE at extreme speed across NVIDIA Blackwell & Hopper, AMD MI350X & MI355X, and Alibaba T-Head Zhenwu PPUs.
Figure 5: The four engineering pillars behind vLLM’s Day-0 Qwen4-35B-A3B release—10× KV cache compression, CUDA-graphed MTP-3 & PDL kernel overlap, multi-vendor silicon kernels, and bitwise Zero-Mismatch RL. Source: vLLM Team & Inferact.
1. 1M-Token Context in Just 8 GiB of GPU Memory
On a traditional 40-layer dense Transformer in BF16, a 1-million-token context requires roughly 80 GiB of KV cache alone. Because Qwen4-35B-A3B only caches KV state on its 10 Qwen Sparse Attention (QSA) layers—and was trained natively for an NVFP4 KV cache (~3.6× smaller than BF16, powered by FlashInfer CAKE tcgen05 and PrimTS kernels on datacenter Blackwell)—vLLM shrinks a full 1M-token context down to just 8 GiB. Combined with keeping the 20.5 GB FP8 N-gram table (41 GB in BF16) in pinned host memory and streaming lookups asynchronously over a CUDA side stream, both the 39.7 GB FP8 model and a 1M-token context fit comfortably on a single GPU.
2. Solving “Small Model, Exposed Overhead” (514 tok/s on 1× B300)
With only 3B active parameters, a single forward pass is so fast (~4 ms on a B300 to verify 4 tokens and draft 3 MTP tokens) that CPU scheduling, kernel launch gaps, and sampling dominate latency. The vLLM team engineered three targeted optimizations to eliminate that overhead:
- Single CUDA Graph for MTP Draft Steps: Instead of returning to the CPU to rebuild QSA indexer metadata between MTP draft steps 2 and 3, vLLM updates the indexer metadata in place on the GPU, replaying steps 2 and 3 inside a single CUDA graph.
- SM-Parallel Top-k / Top-p Sampling: Qwen4 recommends
top_k=20andtop_p=0.95. Previously, verifying 4 tokens launched only 4 GPU programs (leaving 144 of a B300’s 148 SMs idle). vLLM now parallelizes each token’s vocabulary masking across SMs while keeping rejection sampling exact. - Programmatic Dependent Launch (PDL): Across Qwen4’s 4-stream Gated Residuals and Gated DeltaNet layers, vLLM uses
griddepcontrol.waitandgriddepcontrol.launch_dependentsso up to three consecutive short kernels overlap in flight—prefetching router and up-projection weights before their predecessors finish.
| Concurrent Requests (1× NVIDIA B300, FP8 + MTP-3) | Output Tokens/s per Request | P50 TPOT | P50 TTFT |
|---|---|---|---|
| 1 request (avg. 2.25 accepted tokens/step) | 514 tok/s | 1.91 ms | 46 ms |
| 4 concurrent requests | 336 tok/s | 2.81 ms | 62 ms |
3. Multi-Vendor Silicon & Day-0 Zero-Mismatch RL
- AMD & Alibaba Silicon on Day 0: On AMD MI350X / MI355X, vLLM runs QSA and prefill on AITER and FlyDSL kernels with
--monokernelpersistent decode launches and on-load--quantization mxfp4for routed experts. On Alibaba T-Head Zhenwu PPUs, Day-0 support ships via thevllm-sailplugin (single M890 TP1 or dual 810E TP2 + EP). - Zero-Mismatch RL (
VLLM_BATCH_INVARIANT=1): Without batch invariance, 97.8% of generated tokens (4,005 / 4,096) diverge between vLLM rollouts and Megatron-LM (mLite) training. Using the Day-0 recipes inInferact/zero-mismatch-rlon NVIDIA GB200 (with SkyRL + Megatron-LM), enablingVLLM_BATCH_INVARIANT=1achieves 0 / 682,536 bit mismatches across 10 DAPO RL steps—while keeping NVFP4 KV, FP8 indexer, MTP-3, prefix caching, and CUDA graphs enabled at 92.7% of standard throughput (6,322 tok/s vs. 6,821 tok/s on 1× GB200 atc=32).
6. Day-0 Deployment: Official vLLM Docker Images, SGLang, and Local llama.cpp
Official vLLM Docker Launch (NVIDIA Blackwell / Hopper — FP8 + NVFP4 KV + MTP-3)
The vLLM team provides dedicated Day-0 container images (vllm/vllm-openai:qwen4 for NVIDIA and vllm/vllm-openai-rocm:qwen4 for AMD) with native qwen4 tool-call and reasoning parsers:
# Terminal command (official vLLM Day-0 Docker server on NVIDIA GPU)
docker run --gpus all --ipc=host -p 8000:8000 \
-v /Users/username/.cache/huggingface:/root/.cache/huggingface \
-e VLLM_USE_RUST_FRONTEND=1 \
vllm/vllm-openai:qwen4 Qwen/Qwen4-35B-A3B-FP8 \
--trust-remote-code --enable-prefix-caching --max-model-len auto \
--disable-flashinfer-autotune \
--kv-cache-dtype nvfp4 --attention-config.indexer_kv_dtype fp8 \
--enable-auto-tool-choice --tool-call-parser qwen4 --reasoning-parser qwen4 \
--speculative-config '{"method":"mtp","num_speculative_tokens":3,"index_share_for_mtp_iteration":true}'
For AMD MI350X / MI355X clusters, swap in vllm/vllm-openai-rocm:qwen4 with VLLM_ROCM_USE_AITER=1, --monokernel, and --quantization mxfp4 to quantize routed experts at load. And for high-concurrency agent fleets sharing massive repository prefixes, SGLang also offers Day-0 support with RadixAttention prefix reuse across Qwen4’s hybrid layers.
Single-GPU Local Execution with llama-server (PLE Offloaded to Host RAM)
For local workstations (e.g., a single 24 GB RTX 4090/5090 or Apple Silicon unified memory via unsloth/Qwen4-35B-A3B-MLX-4bit), download a quantized GGUF checkpoint from ggml-org/Qwen4-35B-A3B-GGUF or unsloth/Qwen4-35B-A3B-GGUF and offload the 20.5B PLE tables cleanly to CPU RAM:
# Terminal command (local OpenAI-compatible server via llama.cpp)
llama-server \
-m /Users/username/models/Qwen4-35B-A3B-Q4_K_M.gguf \
--load-mode mmap \
--lazy-mode on \
-ot per_layer_token_embd=CPU \
-ngl 99 \
-c 131072 \
--port 8080
With -ot per_layer_token_embd=CPU and --load-mode mmap, the hot 40-layer MoE backbone stays pinned in GPU VRAM (-ngl 99), while the massive n-gram embedding tables stream transparently from system RAM with negligible latency overhead.
Conclusion
Qwen4-35B-A3B puts the “is Alibaba abandoning open weights?” speculation from November firmly to rest. By combining Apache 2.0 weights, a 1M-token native multimodal context, a 3:1 Gated DeltaNet + Qwen Sparse Attention hybrid decoder, 20.5B offloadable Per-Layer N-gram Embeddings, and built-in MTP speculative decoding, Alibaba has set a new architectural bar for what a single-GPU open-weight agent model can deliver.
If you are building local coding agents, enterprise document/knowledge-base pipelines, or cost-sensitive multimodal workflows that previously required 100B+ cloud endpoints, Qwen/Qwen4-35B-A3B deserves an immediate spot on your evaluation bench.
