DEV Community

Cover image for 56.8B stored, 3B active: Qwen4-35B-A3B's real size
frank chu
frank chu

Posted on

56.8B stored, 3B active: Qwen4-35B-A3B's real size

Qwen4-35B-A3B activates 3B parameters per token, but you have to store 56.8B of them: the download is 113.6 GB across 33 safetensors shards.

The model hit Hacker News this week as "35B with 3B activated." That phrasing is accurate and also incomplete, and the model card itself says why, in a line that's easy to skim past: "35B with 3B activated, plus 20B n-gram embedding and 2B MTP." I pulled the file listing and config from Hugging Face and did the arithmetic.

What actually downloads

shards:            33 safetensors files
total_size:        113,646,523,896 bytes (from model.safetensors.index.json)
tensors:           1,466
dtype:             bfloat16
implied params:    113.6 GB / 2 bytes = 56.8B
Enter fullscreen mode Exit fullscreen mode

56.8B stored vs 3B activated is an 18.9x ratio. The headline arithmetic (35 + 20 + 2 = 57B) checks out against the bytes on disk. Nobody is lying; the "35B" in the name is just not the number that determines whether the model fits on your GPU. At bf16, weights alone exceed a single 80 GB card before you've allocated a byte of KV cache.

Where the parameters live

From config.json: 40 layers, hidden size 2048, 256 routed experts per layer with 8 activated plus 1 shared, expert intermediate size 512. Each expert is three matrices (gate, up, down), so:

per_expert = 3 * 2048 * 512            # 3,145,728 params
routed     = per_expert * 256 * 40     # 32.21B
shared     = per_expert * 40           #  0.13B
activated  = per_expert * 9 * 40       #  1.13B per token
ngram      = 10_000_000 * 2048         # 20.48B
token_emb  = 248_320 * 2048            #  0.51B (x2: embeddings + lm_head, untied)
Enter fullscreen mode Exit fullscreen mode
Component Params Share of 56.8B
Routed experts (256 × 40 layers) 32.21B 57%
N-gram embedding (10M × 2048) 20.48B 36%
Token embedding + lm_head 1.02B 2%
Shared experts 0.13B <1%
Everything else (attention, DeltaNet, vision, MTP, norms) ~3.0B ~5%

Two things stand out. First, the n-gram embedding is the second-largest component in the model — bigger than most entire models people run locally. It's a lookup table (the index shows it stored as 128 shard tensors under layer 1's ple module), so it costs memory bandwidth only for the rows you touch, but it costs capacity in full. "Improves quality without extra compute or accelerator memory overhead," says the model card. The compute part is plausible. The memory part is doing a lot of work in that sentence: 20.48B bf16 parameters is 41 GB of accelerator memory by any accounting I know.

Second, of the 3B "activated" parameters, only 1.13B are experts. The rest is attention, the gated DeltaNet layers (30 of 40 layers are linear attention; only 10 are full attention), embeddings, and the rest of the dense path. A3B is not "a 3B model with extra experts bolted on" — the dense backbone alone is roughly 1.9B of always-on compute.

The context window, priced

The card advertises a native 1,048,576-token context. Naive dense KV cache for just the 10 full-attention layers (2 KV heads, head dim 256, bf16) would be:

10 layers x 2 KV heads x 2 (K+V) x 256 x 2 bytes = 20,480 bytes/token
x 1,048,576 tokens = 21.5 GB per sequence
Enter fullscreen mode Exit fullscreen mode

That's the number the architecture is designed to avoid — sparse attention with a 2,048-token budget and an indexer compression ratio of 4, plus linear attention elsewhere. Fine. But it's a reminder that "1M context" and "3B active" are both statements about the cheap axis. The expensive axes — 113.6 GB of weights, cache for long contexts — are where this model actually lives.

The naming problem

None of this makes Qwen4-35B-A3B a bad model; I haven't run it, and sparse models genuinely do trade capacity for compute. But "35B-A3B" now encodes three different numbers (35B language model, 3B active, 56.8B stored), and the one in the name is neither the compute number nor the capacity number. If you're planning hardware, the only honest label would be A3B-S57B. Until model names carry the stored count, the file listing is the spec sheet.

Sources

Top comments (0)