Sponsored by

 
researchaudio.iobag tag 1205 · qwen4-35b-a3b
gpu
carry-on: 3B active
→
ram
checked: 20.5B table
→
ssd
overflow: table pages

The Smallest Qwen4 Is 54 Percent Lookup Table

20B parameters skip the GPU. Alibaba’s own paper says when they earn the disk space.

Alibaba released Qwen4-35B-A3B on December 4. It is the first model with the Qwen4 name and open weights. The name says 35B. The checkpoint holds 56.8B parameters.

The extra 20.5B parameters are one table. The model does not multiply this table. For each token, it reads a few rows. Unsloth packs the table in a separate file. In the smallest quant, the table file is larger than the model file.

This changes how you size a machine for the model. This issue shows where each part can go, what the table gives you, and what it costs.

 
bag 01
What shipped on December 4
tag: one checkpoint, two kinds of weights
itemvalue
Language model35B total, 3B active per token
Experts256 experts, 8 routed + 1 shared per token
N-gram table20.48B values, read at layer 2
Draft head (MTP)about 2B, 1 layer
Layers40 = 10 × (3 Gated DeltaNet + 1 sparse attention)
Context1,048,576 tokens, native
Checkpoint113.6 GB in BF16, 33 files, Apache 2.0

source: model card, config.json; table size from the Unsloth table notes

weigh-in: share of the 56.8B checkpoint parameters

64% · experts, attention, vision, MTP36% · table

20.48B of 56.82B. Hugging Face lists the total as 56,823.3M.

 
bag 02
The table is a lookup, not a matrix
tag: read a line, not the whole book

An n-gram is a short run of tokens. Qwen4 uses bigrams and trigrams. Each new token ends one bigram and one trigram.

The model hashes these n-grams to slots in the table. The card lists 10,000,000 n-gram entries. The model reads the rows at those slots. A gate adds the result to the token at layer 2.

Think of a phone book. To find one number, you do not read every page. You go to one line. The book can be large because you read so little of it.

what one token reads, in BF16

active experts
 
about 3B values · about 6 GB
n-gram table
 
2,048 values · about 4 KB

my arithmetic from config.json (ple_embed_dim 2048), not a vendor number. The red bar is drawn at its minimum width; to scale it would be invisible.

The Qwen3.8-Next design paper puts the table at layer 2 for one reason. The host can fetch the rows while layer 1 runs. The model card says the table adds quality “without extra compute or accelerator memory overhead.” That is true when the table is not on the accelerator. It still needs a place.

 
bag 03
In the 1-bit file set, the table is the larger file
tag: the quant changes the model, not the table

Unsloth ships each GGUF quant as two files. File 2 holds the table and nothing else. Look at how the share moves as the quant gets smaller.

quantmodel filetable filetable share
UD-IQ1_S9.75 GB11.52 GB54%
UD-IQ2_XXS11.88 GB11.52 GB49%
UD-Q3_K_XL19.36 GB11.52 GB37%
UD-Q4_K_XL24.72 GB11.52 GB32%
UD-Q5_K_XL27.84 GB15.36 GB36%
UD-Q8_K_XL40.53 GB21.76 GB35%

GB = 10^9 bytes, from the repo file list on December 5. Share = table file / both files.

The same 11.52 GB table goes with 15 quants, from 1-bit to 4-bit. When you pick fewer bits, you shrink the model file. The table file stays the same size.

You can swap the table. Unsloth publishes it at four precisions and measured the error against BF16.

table typesizerelative error
BF1640.96 GB0 (lossless)
Q8_021.76 GB0.0053
Q5_115.36 GB0.0377
IQ4_NL11.52 GB0.0758

source: Unsloth table notes. Error = RMSE of a row / RMS of the BF16 row, median of 3,000 random rows. I found no benchmark of what this error does to answers.

State of Product reveals what AI still hasn’t solved

80% of product professionals say AI helps them ship faster, but customers aren’t seeing value any sooner. Atlassian’s State of Product 2027 explores the gains AI is delivering and the challenges that remain, from decision-making that hasn’t kept pace to gut instinct overriding customer evidence.

 
bag 04
Where each part can go
tag: carry-on, checked bag, overflow
tierwhat goes therehow
GPUmodel file, KV cachedefault with -ngl 999
RAMthe n-gram table-ot per_layer_token_embd=CPU
SSDtable pages not in RAMUnsloth Desktop does this

Unsloth says its desktop app keeps the table on SSD and runs a 3-bit quant in 18 GB of RAM.

Unsloth gives this llama.cpp command. It loads a 4-bit model with a higher-precision Q8_0 table, and keeps the table in system RAM.

llama-server \
  -m UD-Q4_K_XL/Qwen4-35B-A3B-UD-Q4_K_XL-00001-of-00002.gguf \
  --ple engram/Qwen4-35B-A3B-engram-Q8_0.gguf_file \
  -ngl 999 -fa on --jinja -c 32768 \
  -ot per_layer_token_embd=CPU

Unsloth: “a larger table needs more RAM, not more VRAM.”

One hands-on test ran the 2-bit set with no GPU. The machine had 4 vCPUs and 15 GB of RAM. The two files were 23.4 GB. The server held 13.3 GB with a 16,384-token context. So at least 10 GB of the files stayed on disk. It generated about 7.7 tokens per second.

Where would you keep the 20B n-gram table

Login or Subscribe to participate

 
bag 05
What the table gives, in Alibaba’s own tests
tag: extra memory helps, a swap does not

The design paper (Qwen Team, August 31) tests the table two ways. The results point in different directions.

test A · swap experts for table
same total parameters
1.202 → 1.197
best loss, table at 25% of budget
downstream tests: “no clear improvement” over the MoE baseline
test B · add the table on top
more total parameters
1.585 → 1.541
loss at 50× vocabulary
MMLU-Pro 33.43 → 35.80
MATH 32.52 → 37.32
GSM8K 59.21 → 64.00
C-Eval 66.91 → 72.12

source: arXiv 2608.30320, Tables 8 and 9. The paper does not give the model size for these runs.

The table helps when it is extra. As a replacement for experts, it gave no clear gain. Qwen4-35B-A3B uses it as extra: 35B, plus 20B of table.

There is a ceiling too. Loss keeps falling up to 200× vocabulary. The paper says the benchmarks do not follow. The 35B model sits near 40× (10,000,000 slots against a 248,320-token vocabulary).

 
bag 06
Sparse attention reads less. It stores the same.
tag: plan the cache before the 1M context

30 of the 40 layers are Gated DeltaNet. Each keeps a fixed-size state, so long context does not grow them. The other 10 layers use Qwen Sparse Attention. They keep a full KV cache.

cache partper tokenat 1,048,576 tokens
10 sparse-attention layers20,480 bytes21.5 GB
Indexer keys (4× compressed)640 bytes0.7 GB
30 DeltaNet layersfixedabout 63 MB per sequence
If all 40 layers were attention81,920 bytes85.9 GB

my arithmetic from config.json: 10 layers × 2 KV heads × 256 dims × K and V × 2 bytes (BF16). Not a vendor number. The MTP layer adds one more attention layer if you use it.

At each step, the sparse layers read up to 2,048 tokens of the cache, picked by a small indexer. That cuts the work. It does not cut the storage. At 1M tokens, the paper measures the attention module at 7.6× faster prefill and 4.9× faster decode than dense attention.

 
bag 07
How it scores, and how much it writes
tag: top of its class, last on tokens

Artificial Analysis ran the xhigh setting. The default setting is high.

measureQwen4-35B-A3Bclass median
Intelligence Index25 (1st of 17)11
Output tokens for the index175M (16th of 16)95.9M
Cost per index task0.55 USDnot listed
Time per index task15.2 min15.2 min
Output speed225 tokens/snot listed

class: open-weights models from 4B to 40B. Read December 5.

The model card lists “improved token efficiency.” That compares Qwen4 to older Qwen models. Against its class, it writes the most tokens. Both statements can be true. Budget for the class number.

For scale: Qwen4-Max, which has no open weights, has 2.4T backbone parameters plus a 328B n-gram table, about 12% of its total. The open model gives the table three times that share.

 
bag 08
Claim check
tag: what the card says, what the files say
claimwhat the files showstatus
“35B”56.8B in the checkpointfootnote
No extra accelerator memorytrue when the table sits in RAM or on SSDconditional
Table improves qualitywhen added, yes; as a swap, no clear gainholds
Native 1M contextabout 22 GB of cache in BF16plan memory
Improved token efficiencyvs older Qwen; most tokens in its classrelative
 
bag 09
Check the numbers yourself
tag: five minutes with one file
1. Open config.json.
2. Find ple_embed_dim. It is 2048.
3. Multiply by 2 bytes. Result: 4,096 bytes per token from the table.
4. Find num_key_value_heads (2) and head_dim (256).
5. Count “full_attention” in layer_types. Result: 10.
6. Multiply 2 × 256 × 2 (K and V) × 10 × 2 bytes. Result: 20,480 bytes of cache per token.
 
For this model, VRAM is not the first question. First, decide how much RAM and disk you give to a table that does not need the GPU.
ResearchAudio.io
Sources: Qwen4-35B-A3B model card · config.json · Unsloth GGUF table notes · Qwen3.8-Next design paper · Artificial Analysis · Sulat hands-on · The New Stack on Qwen4-Max
File sizes read from Hugging Face on December 5, 2026.