TL;DR
- Qwen released
Qwen/Qwen4-35B-A3Bon December 3, 2026: an Apache-2.0 multimodal mixture-of-experts model with a native 1,048,576-token context. The card says "35B with 3B activated, plus 20B n-gram embedding and 2B MTP". - I rebuilt the count from the safetensors headers of all 33 shards. The checkpoint stores 56.82B parameters (the Hub agrees). Of those, 35.04B is the text backbone, 20.48B is the n-gram table, 0.86B is the multi-token-prediction (MTP) head and 0.45B is the vision encoder. Active per token I get about 3.3B, so the "3B activated" label holds up.
- The KV cache is the story. Only 10 of 40 layers keep a classic KV cache, with 2 KV heads of dimension 256: 20 KiB per token, 20 GiB at 1M tokens in BF16. The same shape with KV in all 40 layers would need 80 GiB. The 30 linear-attention layers add a fixed state of about 60 MiB per sequence.
- The "35B" label hides the file size. BF16 is 113.7 GB, FP8 is 60.2 GB, and the two-file GGUF Q4_K_M is about 35.2 GB. The n-gram table is a lookup table, and llama.cpp can keep it in system RAM, which changes what GPU you need.
What did Qwen actually release on December 3?
The release is two official repositories, Qwen/Qwen4-35B-A3B (BF16) and Qwen/Qwen4-35B-A3B-FP8, both created on December 3 (UTC). Within hours the Hub also had community quantizations, including a large GGUF family from Unsloth. The license file is Apache 2.0 and the Hub tags it license:apache-2.0, which is the simplest license position among recent open releases of this size.
The model card describes a stack that is easy to misread, so here is the layout in one line: 10 repeated blocks, each made of three Gated DeltaNet layers followed by one sparse-attention layer, and every layer is followed by a mixture-of-experts feed-forward block. That is 40 layers, 256 routed experts per layer, 8 routed plus 1 shared expert active, hidden size 2048, expert width 512. There is also a gated residual with 4 branches, one MTP layer, a vision tower, and a per-layer n-gram embedding applied at layer 2.
The card points to vLLM, SGLang and TokenSpeed recipes for serving, and to llama.cpp, Ollama, Unsloth, mlx-vlm and LiteRT-LM for local use. It shows benchmark numbers only as an image, so I do not repeat any score here. This post is about the part you can check from the files: parameter accounting, cache size and memory fit.
Where do the 56.8B stored parameters sit?
I read the first bytes of each shard (a safetensors header is a length prefix followed by JSON), collected 1,466 tensor shapes and multiplied them out. The snippet is short enough to rerun:
import json, struct, math, urllib.request base = "https://huggingface.co/Qwen/Qwen4-35B-A3B/resolve/main/" shapes = {} for i in range(1, 34): name = f"model-{i:05d}-of-00033.safetensors" get = lambda a, b: urllib.request.urlopen( urllib.request.Request(base + name, headers={"Range": f"bytes={a}-{b}"})).read() n = struct.unpack("<Q", get(0, 7))[0] hdr = json.loads(get(8, 7 + n)) hdr.pop("__metadata__", None) shapes.update({k: v["shape"] for k, v in hdr.items()}) total = sum(math.prod(s) for s in shapes.values()) print(len(shapes), total) # 1466 tensors, 56,823,261,843 values The grouped result, in billions of parameters:
| Group | Parameters (B) | Notes |
|---|---|---|
| Routed experts | 32.21 | 40 layers x 256 experts x 3 x 512 x 2048 |
| N-gram tables | 20.48 | 128 shards of 160,003,584 values |
| Linear attention (30 layers) | 1.01 | Gated DeltaNet projections |
| Embedding | 0.51 | 248,320 x 2048 |
| Output head | 0.51 | untied from the embedding |
| MTP head | 0.86 | one extra layer with its own 256 experts |
| Vision encoder | 0.45 | 27-layer tower |
| Sparse attention (10 layers) | 0.29 | includes the indexer projections |
| Gated residual mixers | 0.34 | the 4-branch residual stream |
| Shared experts, routers, misc | 0.17 | |
| Total | 56.82 | matches the Hub's 56,823,261,808 BF16 values plus 35 int64 |
Three things stand out.
First, the "35B" is the text backbone only. Subtract the n-gram table, the MTP head and the vision tower from the total and you get 35.04B. The card's own phrasing, "35B with 3B activated, plus 20B n-gram embedding and 2B MTP", is consistent with that. For the MTP head I count 0.86B in the checkpoint, not 2B, so the card's figure probably counts something else, such as shared tensors; I only report what the shapes show.
Second, the routed experts are 92% of the backbone. Each token touches 8 of 256, which is 3.125% of 32.21B, or 1.01B. Add shared experts, attention, the residual mixers, routers and the output head and the active count is about 3.3B. The embedding is a lookup, so it does not count toward per-token compute.
Third, the n-gram table is 36% of the whole file and contributes no matrix multiplications. It is addressed by hashed bigram and trigram ids and sharded 128 ways, so each token reads a handful of 128-wide rows. That is a different cost profile from experts, which is why the GGUF packagers treat it separately.
How big is the KV cache at 1M tokens?
Take the config values: 40 layers, full_attention_interval of 4 (so layers 3, 7, 11 and so on use sparse attention), num_key_value_heads of 2, head_dim of 256. Only the sparse-attention layers store a per-token KV pair:
kv_layers, kv_heads, head_dim, bytes_per = 10, 2, 256, 2 # BF16 per_token = kv_layers * 2 * kv_heads * head_dim * bytes_per # K and V print(per_token) # 20480 bytes = 20 KiB print(per_token * 1_048_576 / 2**30) # 20.0 GiB at 1M tokens That is 20 KiB per token and 20.0 GiB for one million tokens. If every one of the 40 layers kept the same KV shape, the figure would be 80 GiB. Here are the values I computed for one sequence:
| Context (tokens) | This layout (GiB) | KV in all 40 layers (GiB) |
|---|---|---|
| 8,192 | 0.16 | 0.6 |
| 65,536 | 1.25 | 5.0 |
| 131,072 | 2.5 | 10.0 |
| 262,144 | 5.0 | 20.0 |
| 524,288 | 10.0 | 40.0 |
| 1,048,576 | 20.0 | 80.0 |
The 30 Gated DeltaNet layers do not grow with context. Each holds a state of 32 value heads x 128 x 128 values; the config sets the state dtype to float32, so that is 2 MiB per layer and about 60 MiB for all 30 layers per sequence, plus a small convolution buffer. This is an estimate from the config, and real engines may pad or store extra buffers.
Two caveats matter for planning. The sparse-attention layers use an indexer (4 query heads, 1 shared key head, dimension 128) with a budget of 2,048 tokens per step. That bounds how many cached tokens each decode step attends to, which cuts compute; it does not by itself shrink what is stored. The indexer also keeps its own keys, which I did not add above because the compression behavior depends on the engine. And a serving stack may allocate cache in blocks, so measured memory can sit above the formula.
Which GPU do you need?
File sizes come straight from the Hub API (GB = 10^9 bytes):
| Variant | Size | Notes |
|---|---|---|
| BF16 (official) | 113.7 GB | 56.8B values at 2 bytes |
| FP8 (official) | 60.2 GB | 128x128 block weights; lm_head and embedding stay BF16 |
| GGUF Q8_0 | 60.0 GB | 38.2 GB main file + 21.8 GB n-gram table |
| GGUF UD-Q4_K_M | 35.2 GB | 23.7 GB main + 11.5 GB n-gram table (IQ4_NL) |
| GGUF UD-IQ1_S | 21.3 GB | 9.8 GB main + 11.5 GB table |
The packager's note on the n-gram table is the useful detail for small GPUs: the table is the second file of every quant, it can be swapped for a more or less precise one, and the example command uses -ot per_layer_token_embd=CPU so the table sits in system RAM. In that setup the GPU holds roughly the main file plus cache, so Q4_K_M needs about 23.7 GB of VRAM before KV, and the table needs 11.5 GB of RAM. I did not run this myself; it is what the file layout and the packager's instructions imply. The packager also reports the table's relative error against BF16: 0.0053 for Q8_0, 0.0377 for Q5_1, 0.0758 for IQ4_NL. How that error shows up in task quality is not something those numbers say.
For a data-center card, the arithmetic is direct:
- One 80 GB GPU, BF16: does not fit. 113.7 GB exceeds 80 GB before any cache.
- One 80 GB GPU, FP8: 60.2 GB of weights leaves about 20 GB for cache, state and activations. At 262,144 tokens a sequence needs 5 GiB, so several fit; one full 1M-token sequence at 20 GiB would not leave room for anything else.
- Two 80 GB GPUs, BF16: 113.7 GB of weights across 160 GB leaves about 46 GB for cache, state and activations, which is two full 1M-token sequences of KV on paper.
- 24 GB consumer GPU: only with a low-bit GGUF and the table in RAM, and with a short context.
What speed ceiling does 3.3B active imply?
Decode at batch size 1 is bandwidth-bound: each step reads the active weights once. With about 3.3B active parameters at 2 bytes that is 6.6 GB per token. On a card with 3.35 TB/s of memory bandwidth (H100 SXM spec), the ceiling is about 507 tokens per second in BF16, and about 1,014 if the active weights were all 1 byte. These are illustrative ceilings, not measurements. Real engines pay for expert routing across the 256 experts, attention state, kernel launch overhead and the MTP draft step, and at larger batch sizes different tokens pick different experts, so the weights read per step grow. The ratio is the useful part: a 3.3B-active model has about one tenth of the per-token weight traffic of a 35B dense model.
Why does the architecture matter beyond the numbers?
The card names three themes: efficient long-sequence inference, long-horizon agent work and token efficiency, with reasoning effort levels xhigh, high, low and off. Only the first is something the files can confirm. A 3:1 ratio of linear to sparse attention is why a 1M-token window does not cost 80 GiB per user, and the 256-expert, 8-active design is why compute per token stays near 3B. The pattern matches other recent releases that cut cache by keeping full history in only a fraction of layers, as covered in earlier posts in this series.
The n-gram table is the new piece. It moves capacity out of matrix multiplications and into a lookup that can live on cheaper memory. If your deployment is limited by VRAM and not by RAM, that is a real lever. If your cluster has uniform nodes, it is mostly a packaging detail. The card says the n-gram embeddings improve quality without extra compute, which cannot be checked from shapes alone.
Quick checklist before you deploy
- Decide the context you actually serve. At 262K tokens the cache is 5 GiB per sequence; at 1M it is 20 GiB.
- Pick the weight format first: FP8 at 60.2 GB for one 80 GB card, BF16 across two.
- Check the engine version. The card recommends recent releases of vLLM, SGLang or TokenSpeed, and llama.cpp needs a build with Qwen4 support.
- Load-test with your real prompt lengths, because the MoE router and the indexer both depend on the data.
- Use the sampling settings on the card for thinking and non-thinking modes, and test the effort levels on your own tasks.
FAQ
How many parameters does Qwen4-35B-A3B have?
The checkpoint stores 56.82B values. The text backbone is 35.04B, the n-gram table 20.48B, the MTP head 0.86B and the vision encoder 0.45B. About 3.3B are active per token.
How large is the KV cache at 1M tokens?
About 20 GiB in BF16 for one sequence, because only 10 of 40 layers keep a KV cache (2 KV heads, head dimension 256, 20 KiB per token). The 30 linear-attention layers add roughly 60 MiB of fixed state.
Can I run it on one 80 GB GPU?
Not in BF16 (113.7 GB). The official FP8 build is 60.2 GB and fits with about 20 GB left for cache, state and activations.
What is the n-gram embedding and can it stay off the GPU?
It is a 20.48B-value table of hashed bigram and trigram embeddings applied at layer 2. The GGUF packager ships it as a separate file and shows how to hold it in system RAM with llama.cpp, so the GPU needs only the rest.
What is the license?
Apache 2.0, per the license file and Hub tag.
Sources and further reading
- Model card and files: Qwen/Qwen4-35B-A3B, FP8 build, Unsloth GGUF repository
- Earlier in this series: Amazon Ergo: 1.1T parameters, 55B active, and a 1M-token KV cache of only 64 GiB and Ling-3.2-air: 124B parameters, 5.5B active, and a KV cache from only 7 of 42 layers
All sizes and counts were read from the Hub on December 4, 2026. Throughput figures are arithmetic ceilings, and cache numbers are formulas from the published config.

