Qwen · Alibaba
Qwen3.5 35B-A3B
Qwen3.5 35B-A3B from Alibaba has 34,660,610,688 parameters in its language model, of which about 3.45B are used for each token (a mixture of experts). Its weights take 69.3 GB in BF16 and about 17.3 GB at 4-bit, and each token of context adds 20.5 KB of KV cache (671 MB at 32K tokens). The checkpoint also carries a 447M-parameter vision encoder.
Part of the Qwen3.5 family: 752M · 1.88B · 4.21B · 8.95B · 26.9B · 34.7B · 122B · 396B
Architecture · VRAM · KV cache · Tensor shapes · Parameter count · FLOPs
Architecture
| Architecture | Qwen3_5MoeForConditionalGeneration |
|---|---|
| Layers (L) | 40 |
| Hidden size (d) | 2,048 |
| Attention | GQA (8 query heads share each KV head) |
| Heads | 16 query, 2 key/value, 256 each |
| Feed-forward | 256 experts of 512, 8 per token, plus 1 shared (SwiGLU) |
| Vocabulary (V) | 248,320 |
| Tied embeddings | no: separate output head |
| Biases | none |
| Extra norms | pre-norm (RMSNorm before attention and FFN) |
| Max context | 262,144 tokens |
| Linear attention | Gated DeltaNet on 30 of 40 layers: 16 key heads and 32 value heads of 128; full attention (with a sigmoid output gate) on the other 10 |
| Vision encoder | ViT, 27 layers, 1,152 wide: 447M parameters with the projector (in the checkpoint, used only for images) |
| Weights in the release | – |
How much memory the weights need
Each parameter takes 4 bytes in FP32, 2 in BF16, 1 at 8 bits and half a byte at 4 bits, so the weights of the language model alone need:
| Precision | Bytes per parameter | Weights | |
|---|---|---|---|
| FP32 | 4 | 139 GB | 129.12 GiB |
| BF16 / FP16 | 2 | 69.3 GB | 64.56 GiB |
| INT8 / FP8 | 1 | 34.7 GB | 32.28 GiB |
| INT4 | 0.5 | 17.3 GB | 16.14 GiB |
GB here is 109 bytes; GiB (230) is what tools like nvidia-smi show. Real 4-bit files are a little larger: they also store scales, and some layers are often kept at higher precision. The vision encoder adds 893 MB in BF16 when used. Every expert has to be in memory, not just the active ones: the router picks different experts for each token. A running model also needs its KV cache, activations and the runtime's own buffers.
On common GPUs
Whether the weights plus a 8K-token KV cache fit in 90% of the card (how this is worked out):
Smallest card: 80 GB at BF16, 48 GB at 8-bit, 24 GB at 4-bit.
| GPU memory | BF16 | 8-bit | 4-bit |
|---|---|---|---|
| 8 GB | 69.6 GBtoo big | 37.1 GBtoo big | 19.7 GBtoo big |
| 12 GB | 69.6 GBtoo big | 37.1 GBtoo big | 19.7 GBtoo big |
| 16 GB | 69.6 GBtoo big | 37.1 GBtoo big | 19.7 GBtoo big |
| 24 GB | 69.6 GBtoo big | 37.1 GBtoo big | 19.7 GB |
| 48 GB | 69.6 GBtoo big | 37.1 GB | 19.7 GB |
| 64 GB | 69.6 GBtoo big | 37.1 GB | 19.7 GB |
| 80 GB | 69.6 GB | 37.1 GB | 19.7 GB |
Each cell is the weights plus the 8K-token KV cache at that precision; ✓ where it fits.
KV cache
What it is: the KV cache, explained.
Only some layers keep keys and values, and not all of the same size:
10 attention layers × 2 × 2 × 256 × 2 bytes = 20,480 bytes per token
The 30 linear-attention layers cache no keys or values. Each keeps a fixed-size state instead (a 128 × 128 matrix for each of 32 heads, plus the last 3 tokens for the short convolution), held in FP32: 65.9 MB per sequence, whatever the context length. See linear attention.
| Context | KV cache, BF16 | 8-bit KV | Weights + KV, BF16 |
|---|---|---|---|
| 4K | 83.9 MB | 41.9 MB | 69.4 GB |
| 32K | 671 MB | 336 MB | 70.0 GB |
| 128K | 2.7 GB | 1.3 GB | 72.0 GB |
| 256K (max) | 5.4 GB | 2.7 GB | 74.7 GB |
For one sequence. Batching multiplies the KV cache by the number of sequences, not the weights.
Every tensor shape
The names are those in the Hugging Face checkpoint (the language model's sit under language_model.); shapes are [out, in] for weight matrices, as PyTorch stores them. One block is shown: the model repeats it 40 times (in two kinds).
| Tensor | Shape | Parameters |
|---|---|---|
| Embedding | ||
model.language_model.embed_tokens.weight | [248,320, 2,048] | 508,559,360 |
| Linear-attention blocks (30 layers): model.layers.N.… | ||
linear_attn.in_proj_qkv.weightqueries and keys for each key head, values for each value head | [8,192, 2,048] | 16,777,216 |
linear_attn.in_proj_z.weightthe output gate | [4,096, 2,048] | 8,388,608 |
linear_attn.in_proj_b.weightper head: how strongly to write (β) | [32, 2,048] | 65,536 |
linear_attn.in_proj_a.weightper head: how fast to forget (α) | [32, 2,048] | 65,536 |
linear_attn.conv1d.weighta depthwise convolution over the last 4 tokens | [8,192, 1, 4] | 32,768 |
linear_attn.A_logper-head decay rate | [32] | 32 |
linear_attn.dt_bias | [32] | 32 |
linear_attn.norm.weightgated RMSNorm on each head's output | [128] | 128 |
linear_attn.out_proj.weight | [2,048, 4,096] | 8,388,608 |
mlp.gate.weightthe router | [256, 2,048] | 524,288 |
mlp.experts.gate_up_projevery expert's gate and up, one tensor | 256 × [1,024, 2,048] | 536,870,912 |
mlp.experts.down_proj | 256 × [2,048, 512] | 268,435,456 |
mlp.shared_expert.gate_proj.weightshared expert: runs for every token | [512, 2,048] | 1,048,576 |
mlp.shared_expert.up_proj.weight | [512, 2,048] | 1,048,576 |
mlp.shared_expert.down_proj.weight | [2,048, 512] | 1,048,576 |
mlp.shared_expert_gate.weighta sigmoid gate on the shared expert's output | [1, 2,048] | 2,048 |
input_layernorm.weight | [2,048] | 2,048 |
post_attention_layernorm.weight | [2,048] | 2,048 |
| Full-attention blocks (every 4th: layers 3, 7, …, 39): model.layers.N.… | ||
self_attn.q_proj.weightqueries and a sigmoid gate on the output, per head | [8,192, 2,048] | 16,777,216 |
self_attn.k_proj.weight | [512, 2,048] | 1,048,576 |
self_attn.v_proj.weight | [512, 2,048] | 1,048,576 |
self_attn.o_proj.weight | [2,048, 4,096] | 8,388,608 |
self_attn.q_norm.weightshared by every head | [256] | 256 |
self_attn.k_norm.weight | [256] | 256 |
mlp.gate.weightthe router | [256, 2,048] | 524,288 |
mlp.experts.gate_up_projevery expert's gate and up, one tensor | 256 × [1,024, 2,048] | 536,870,912 |
mlp.experts.down_proj | 256 × [2,048, 512] | 268,435,456 |
mlp.shared_expert.gate_proj.weightshared expert: runs for every token | [512, 2,048] | 1,048,576 |
mlp.shared_expert.up_proj.weight | [512, 2,048] | 1,048,576 |
mlp.shared_expert.down_proj.weight | [2,048, 512] | 1,048,576 |
mlp.shared_expert_gate.weighta sigmoid gate on the shared expert's output | [1, 2,048] | 2,048 |
input_layernorm.weight | [2,048] | 2,048 |
post_attention_layernorm.weight | [2,048] | 2,048 |
| After the last block | ||
model.language_model.norm.weightfinal norm | [2,048] | 2,048 |
lm_head.weightscores every token in the vocabulary | [248,320, 2,048] | 508,559,360 |
| Vision encoder: patches and positions | ||
model.visual.patch_embed.proj.weighta 2×16×16 convolution over frames and pixels | [1,152, 3, 2, 16, 16] | 1,769,472 |
model.visual.patch_embed.proj.bias | [1,152] | 1,152 |
model.visual.pos_embed.weightlearned positions, interpolated to the image's grid | [2,304, 1,152] | 2,654,208 |
| Vision encoder: one layer (×27): …layers.N.… | ||
blocks.N.attn.qkv.weight | [3,456, 1,152] | 3,981,312 |
blocks.N.attn.qkv.bias | [3,456] | 3,456 |
blocks.N.attn.proj.weight | [1,152, 1,152] | 1,327,104 |
blocks.N.attn.proj.bias | [1,152] | 1,152 |
blocks.N.mlp.linear_fc1.weight | [4,304, 1,152] | 4,958,208 |
blocks.N.mlp.linear_fc1.bias | [4,304] | 4,304 |
blocks.N.mlp.linear_fc2.weight | [1,152, 4,304] | 4,958,208 |
blocks.N.mlp.linear_fc2.bias | [1,152] | 1,152 |
blocks.N.norm1.weight | [1,152] | 1,152 |
blocks.N.norm1.bias | [1,152] | 1,152 |
blocks.N.norm2.weight | [1,152] | 1,152 |
blocks.N.norm2.bias | [1,152] | 1,152 |
| Vision encoder: merger | ||
model.visual.merger.norm.weight | [1,152] | 1,152 |
model.visual.merger.norm.bias | [1,152] | 1,152 |
model.visual.merger.linear_fc1.weighteach 2×2 group of patches, concatenated | [4,608, 4,608] | 21,233,664 |
model.visual.merger.linear_fc1.bias | [4,608] | 4,608 |
model.visual.merger.linear_fc2.weight | [2,048, 4,608] | 9,437,184 |
model.visual.merger.linear_fc2.bias | [2,048] | 2,048 |
The parameter count, step by step
Each line gives the formula, the numbers from config.json, and the subtotal. The symbols:
- V
- vocabulary 248,320
- d
- hidden size 2,048
- L
- layers 40
- H
- query heads 16
- K
- key/value heads 2
- h
- head size 256
- E
- routed experts 256
- k
- experts per token 8
- f_e
- expert FFN size 512
1. Embedding
One row of d numbers for each of the V tokens in the vocabulary.
2. Linear-attention blocks (30 layers), ×30
3. Full-attention blocks (every 4th: layers 3, 7, …, 39), ×10
4. Final norm and output head
5. Total
6. Active parameters per token
The router sends each token to 8 of the 256 experts in each MoE block, so only those experts' weights are used, plus the shared expert, which every token uses. One routed expert is 3,145,728 parameters.
7. Multi-token prediction
The checkpoint also ships 1 multi-token-prediction module, trained to guess tokens further ahead. It is not used for ordinary decoding (it can drive speculative decoding), so it is left out of the total above but is in the files.
8. Vision encoder
The checkpoint also holds an image encoder (Llama 4's own ViT, 27 layers of width d_v = 1,152, MLP f_v = 4,304) and a projector into the language model. It runs only when the prompt has an image, so it is listed apart from the language model.
patches and positions
one layer, ×27
merger
Hugging Face counts 35,951,822,704 parameters in the Qwen/Qwen3.5-35B-A3B-Base safetensors files. The arithmetic above matches exactly.
FLOPs per token
A forward pass costs about two floating-point operations (a multiply and an add) for every weight a token passes through: 2 × N, with N the active weights used in matrix multiplies (the embedding lookup is a read, not a multiply; the output head is a multiply). Here that is 2 × 3,454,988,928 = 6.9 GFLOPs per token.
Attention adds the work of comparing the token with every earlier one: 2 × L × T × H × (hqk + hv) for T tokens of context, which grows with the context while 2N does not.
That is for one new token at position T, as when generating. Averaged over a whole training sequence of length T, each token sees T/2 earlier ones on average, which halves it.
| Context T | 2N | Attention | Total per token |
|---|---|---|---|
| 4K | 6.9 GFLOPs | 734.0 MFLOPs | 7.6 GFLOPs |
| 32K | 6.9 GFLOPs | 5.4 GFLOPs | 12.3 GFLOPs |
| 128K | 6.9 GFLOPs | 21.5 GFLOPs | 28.4 GFLOPs |
| 256K | 6.9 GFLOPs | 43.0 GFLOPs | 49.9 GFLOPs |
Training costs about three times the forward pass per token (6N): the backward pass does roughly twice the forward work.
More in the glossary: FLOPs per token · quantization · parameters.
Compare
Qwen3.5 35B-A3B vs Gemma 4 26B-A4B · Qwen3.5 35B-A3B vs Qwen3 30B-A3B · Compare with any model →
Close in size: Seed-OSS 36B 36.2B · Qwen2.5 32B 32.8B · DeepSeek-R1-Distill-Qwen-32B 32.8B · Qwen3 32B 32.8B · OLMo 2 32B 32.2B
Source
Read from Qwen/Qwen3.5-35B-A3B-Base, fetched 2026-12-03. Qwen3.6-35B-A3B has these shapes.