# Qwen4-35B-A3B: Alibaba's Open MoE With 3B Active Parameters and a 1M-Token Context

> Source: <https://zyvop.com/qwen4-35b-a3b-alibaba-s-open-moe-with-3b-active-parameters-and-a-1m-token-context-oar52>
> Published: 2026-12-04 08:07:05+00:00

**Key takeaway:** Qwen4-35B-A3B activates about 3B of 35B parameters per token via 8-of-256 routed experts and keeps a 1,048,576-token window affordable by running 30 of 40 layers as Gated DeltaNet linear attention and 10 as sparse attention capped at 2,048 tokens.

Alibaba's Qwen team open-sourced **Qwen4-35B-A3B**, the first small-to-mid-size model in the Qwen4 family. It is a natively multimodal Mixture-of-Experts (MoE) model that activates about 3B of its 35B parameters per token, takes text, images and video as input, and supports a 1,048,576-token context natively. The license is Apache 2.0, so the weights are free to download, deploy and use commercially.

This post is based on launch-day material. The benchmark numbers are Qwen's own, and the model card flagged its benchmark section as still being finalized, so expect revisions.

## Specs at a glance

| Item | Value | 
|---|---|
| Type | Causal language model with a vision encoder | 
| Release | December 4, 2026 (Hugging Face and ModelScope) | 
| License | Apache 2.0 | 
| Parameters | 35B total, 3B active per token, plus a 20B n-gram embedding table and a 2B MTP module | 
| Input / output | Text, image, video in; text out | 
| Context | 1,048,576 tokens, native | 
| Depth | 40 layers, hidden size 2048 | 
| Experts | 256, with 8 routed and 1 shared active per token (expert dimension 512) | 
| Gated residual | 4 branches, bottleneck rank 256 | 

Hugging Face's launch post counts about 3.8B active and about 56B total parameters. Qwen's model card says 3B activated, plus the 20B n-gram table and 2B MTP module. This post follows the model card.

## How it works

Qwen previewed this architecture in Qwen3.8-Flash-Next. Qwen4-35B-A3B is the production version, and Qwen4-Max is the flagship built on the same design.

``` php
flowchart TB
    IN["Text · Image · Video"]:::io --> EMB["Token embeddings<br/>+ n-gram table (bigrams and trigrams, layer 2)"]:::emb
    EMB --> LIN
    subgraph BLOCK["One block, repeated 10 times (40 layers)"]
        LIN["Gated DeltaNet → MoE<br/>3 layers"]:::lin --> ATT["Qwen Sparse Attention → MoE<br/>1 layer"]:::attn
    end
    ATT --> OUT["LM head + 1-layer MTP head"]:::io
    classDef io fill:#334155,stroke:#0f172a,color:#ffffff
    classDef emb fill:#b45309,stroke:#78350f,color:#ffffff
    classDef lin fill:#0f766e,stroke:#134e4a,color:#ffffff
    classDef attn fill:#6d28d9,stroke:#4c1d95,color:#ffffff
```

- **Hybrid attention.** 30 of the 40 layers are Gated DeltaNet, a linear-attention layer that updates a fixed-size memory as it reads. The other 10 use Qwen Sparse Attention, where an indexer picks a budget of up to 2,048 tokens (512 blocks) to attend to. Together they keep the cache small enough for a 1M window.
- **Sparse MoE.** Each token goes through 8 routed experts plus 1 shared expert out of 256, which is why only about 3B parameters are active.
- **N-gram embeddings.** A 10-million-entry bigram and trigram table (about 20B parameters) is looked up at layer 2. Qwen says it improves quality without extra compute or accelerator memory. Unsloth and llama.cpp call it the "engram". Because it is a lookup, it can sit on SSD.
- **MTP.** A one-layer multi-token-prediction head, trained with multiple steps, supports speculative decoding.

## Benchmarks

Scores below are Qwen's reported results, as reproduced in Unsloth's launch guide. Bold marks the best score in each row.

| Benchmark | Qwen4-35B-A3B | Qwen3.8-Flash-Next | Qwen3.8-27B | Inkling2 Mini | 
|---|---|---|---|---|
| Terminal Bench 4.1 | 21.2 | **24.2** | 5.6 | 5.6 | 
| DeepSWE v1.1 | **61.8** | 58.7 | 42.2 | 48.2 | 
| FrontierCode-AA 2.0 | 16.1 | **27.1** | 14.9 | 15.1 | 
| NL2Repo | **51.7** | 48.1 | 42.3 | 41.8 | 
| APEX Agents v1.1 | 59.0 | **61.0** | 47.5 | 50.9 | 
| Work360 | 42.9 | **43.7** | 37.1 | 30.4 | 
| AA-Briefcase v1.1 (Elo) | 1486 | **1567** | 1391 | 1263 | 
| AutomationBench-AA | **57.9** | 55.9 | 48.2 | 41.8 | 
| HealthBench Professional | **47.4** | 34.8 | 29.8 | 45.7 | 
| GPQA | 86.9 | **91.7** | 89.2 | 86.9 | 
| Chartography | **27.8** | 24.6 | **27.8** | 22.1 | 
| VideoIndex | **52.9** | 51.4 | 51.9 | 44.0 | 

```
%%{init: {"theme": "base", "themeVariables": {"xyChart": {"plotColorPalette": "#6d28d9, #f59e0b"}}}}%%
xychart-beta
    title "Coding-agent benchmarks (bars: Qwen4-35B-A3B, line: Qwen3.8-Flash-Next)"
    x-axis ["Terminal Bench 4.1", "DeepSWE v1.1", "FrontierCode-AA 2.0", "NL2Repo"]
    y-axis "Score" 0 --> 70
    bar [21.2, 61.8, 16.1, 51.7]
    line [24.2, 58.7, 27.1, 48.1]
```

What the table shows:

- **Against Qwen3.8-Flash-Next** , the larger model it previews, it wins 6 of 12 and loses 6. It leads on DeepSWE, NL2Repo, AutomationBench-AA, HealthBench Professional, Chartography and VideoIndex. Its largest gap is FrontierCode-AA 2.0 (16.1 vs 27.1).
- **Against Qwen3.8-27B** , it is ahead on 10 of 12, ties on Chartography and trails on GPQA.
- **Against Inkling2 Mini** , it is ahead on 11 of 12 and ties on GPQA.

## Thinking modes and recommended settings

- **Default:** thinking on,`reasoning_effort=high` ,`preserve_thinking` on. Levels are`xhigh` (hardest tasks),`high` ,`low` and`off` .`enable_thinking=False` is the same as`off` .
- **Thinking sampling:**`temperature=1.0` ,`top_p=0.95` ,`top_k=20` ,`min_p=0.0` ,`presence_penalty=0.0` .
- **Non-thinking sampling:**`temperature=0.7` ,`top_p=0.80` ,`top_k=20` ,`min_p=0.0` ,`presence_penalty=1.5` .
- **Output budget for agentic work:** up to 262,144 reasoning tokens and 131,072 answer tokens.
- **Hour-long video:** raise`longest_edge` in`video_preprocessor_config.json` to 469,762,048 (about 224k video tokens).

Qwen notes that lower reasoning effort does not always finish multi-turn agent tasks faster. It can cause weaker analysis, more failures and retries, and higher total latency and token use.

## Call it from code

Any OpenAI-compatible server works, including vLLM, SGLang and Qwen Cloud.

``` python
from openai import OpenAI

client = OpenAI()  # set OPENAI_BASE_URL and OPENAI_API_KEY for your server

resp = client.chat.completions.create(
    model="Qwen/Qwen4-35B-A3B",
    messages=[{"role": "user", "content": "Write a Python function to merge two sorted linked lists."}],
    reasoning_effort="high",  # "xhigh" | "high" | "low" | "off"
)
print(resp.choices[0].message.content)
```

The reference tokenizer needs `tiktoken` and `trust_remote_code=True`. A Jinja chat template ships only for backward compatibility, and it can produce different token IDs.

## Run it locally

The 20B n-gram table is a lookup, so runtimes can memory-map it from SSD. Budget RAM and VRAM for the weights without it, then add room for the KV cache and the vision projector. The figures below are Unsloth's starting points, not full runtime requirements.

| Quant level | Memory with engram on SSD | Notes | 
|---|---|---|
| 1-bit | 9.8–10.8 GB | Smallest. UD-IQ1_S loses 5.8 accuracy points and is weaker at tool calling | 
| 2-bit | 11.9–16.1 GB |  | 
| 3-bit | 17.2–19.4 GB | `UD-IQ3_XXS` for 18 GB devices with short context | 
| 4-bit | 20.5–24.7 GB | `UD-IQ4_XS` for 24 GB devices;`UD-Q4_K_XL` is a good default (36.2 GB download) | 
| 5-bit | 25.9–27.8 GB |  | 
| 6-bit | 29.2–30.5 GB |  | 
| 8-bit | 40.5 GB | 62.3 GB download | 

Qwen4 support is in mainline llama.cpp from PR #33626 onward, so build the latest `master`:

```
./llama.cpp/build/bin/llama-server -hf unsloth/Qwen4-35B-A3B-GGUF:UD-Q4_K_XL \
    -ngl 999 -fa on --jinja -c 32768 \
    --load-mode mmap --lazy-mode on -ot per_layer_token_embd=CPU \
    --temp 1.0 --top-p 0.95 --top-k 20 --min-p 0.0
```

Every GGUF includes the MTP head. Adding `--spec-type draft-mtp --spec-draft-n-max 2` enables speculative decoding, which Unsloth measured at roughly 1.2–1.3x faster decode on an RTX 5090, a Mac M5 Max and an RTX Spark. Unsloth recommends depth 1 when experts spill to CPU.

Unsloth's own accuracy test used 300 questions from GSM8K, MATH-500, CRUXEval-O and MMLU-Pro with thinking on. BF16 scored 95.3%, and differences under about one point are within noise.

```
%%{init: {"theme": "base", "themeVariables": {"xyChart": {"plotColorPalette": "#0f766e, #94a3b8"}}}}%%
xychart-beta
    title "Accuracy by GGUF quant (teal) vs BF16 baseline (gray), %"
    x-axis ["IQ1_S", "IQ2_XS", "Q3_K_XL", "IQ4_XS", "Q4_K_XL", "Q6_K_XL", "Q8_K_XL"]
    y-axis "Accuracy (%)" 88 --> 96
    line [89.6, 93.8, 94.0, 95.2, 95.0, 94.9, 94.8]
    line [95.3, 95.3, 95.3, 95.3, 95.3, 95.3, 95.3]
```

## Limits to know before adopting it

- **Not a clean win over its predecessor.** It trails Qwen3.8-Flash-Next on FrontierCode-AA 2.0, Terminal Bench 4.1, APEX Agents, Work360, AA-Briefcase and GPQA.
- **Self-reported numbers.** Qwen's benchmark section was still being finalized at launch.
- **Fresh runtimes required.** llama.cpp needs a recent`master` . The Unsloth MLX 4-bit build is text-only (no vision, no MTP), and plain`mlx-lm` needs a patch module.
- **Aggressive quants cost accuracy.** Stay at`UD-IQ4_XS` or larger if you rely on tool calling.
- **Same rules as other Qwen releases.** Qwen's ethics statement prohibits harmful use, and it says the model supports professional judgment rather than replacing it.
