DeepSeek · DeepSeek
DeepSeek-V3.2
DeepSeek-V3.2 from DeepSeek has 671,877,944,064 parameters, of which about 38.4B are used for each token (a mixture of experts). Its weights take 1.34 TB in BF16 and about 336 GB at 4-bit, and each token of context adds 85.9 KB of KV cache (2.8 GB at 32K tokens).
Part of the DeepSeek family: 15.7B · DeepSeek-V3 · DeepSeek-R1 · DeepSeek-V3.1 · 672B
Architecture · VRAM · KV cache · Tensor shapes · Parameter count · FLOPs
Architecture
| Architecture | DeepseekV32ForCausalLM |
|---|---|
| Layers (L) | 61 |
| Hidden size (d) | 7,168 |
| Attention | MLA (multi-head latent attention) |
| Heads | 128 (query/key 128+64, value 128); KV compressed to rank 512 |
| Feed-forward | 256 experts of 2,048, 8 per token, plus 1 shared (SwiGLU); 3 dense layers (layers 0–2) with FFN 18,432 |
| Vocabulary (V) | 129,280 |
| Tied embeddings | no: separate output head |
| Biases | none |
| Extra norms | pre-norm (RMSNorm before attention and FFN) |
| Max context | 163,840 tokens |
| Sparse attention | DeepSeek Sparse Attention: a 64-head indexer picks the top 2,048 earlier tokens for each query |
| Weights in the release | FP8 (with BF16 scales and norms) |
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 alone need:
| Precision | Bytes per parameter | Weights | |
|---|---|---|---|
| FP32 | 4 | 2.69 TB | 2502.94 GiB |
| BF16 / FP16 | 2 | 1.34 TB | 1251.47 GiB |
| INT8 / FP8 | 1 | 672 GB | 625.74 GiB |
| INT4 | 0.5 | 336 GB | 312.87 GiB |
| As released (whole checkpoint) | 1 (FP8) | 689 GB | 641.97 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. 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):
Too big for any single card up to 80 GB, even at 4-bit: it needs 379 GB there. Split across 80 GB GPUs it takes at least 18 at BF16, 10 at 8-bit, 5 at 4-bit (the last row).
| GPU memory | BF16 | 8-bit | 4-bit |
|---|---|---|---|
| 80 GB | 1.34 TBtoo big | 715 GBtoo big | 379 GBtoo big |
| 80 GB × n | 18 cards | 10 cards | 5 cards |
Each cell is the weights plus the 8K-token KV cache at that precision; ✓ where it fits. The 80 GB × n row divides that evenly over n cards (tensor or pipeline parallel), the best case: real splits duplicate some buffers.
KV cache
What it is: the KV cache, explained.
MLA caches one compressed latent of r_kv = 512 numbers plus a shared RoPE key of h_r = 64 per layer, instead of full keys and values for every head:
L × (r_kv + h_r + h_I) × 2 bytes = 61 × (512 + 64 + 128) × 2 = 85,888 bytes per token
That is the figure for runtimes that cache the latent (vLLM, SGLang, DeepSeek's own). Code that expands it back to per-head keys and values caches 61 × 128 × (192 + 128) × 2 = 5.0 MB per token.
| Context | KV cache, BF16 | 8-bit KV | Weights + KV, BF16 |
|---|---|---|---|
| 4K | 352 MB | 176 MB | 1.34 TB |
| 32K | 2.8 GB | 1.4 GB | 1.35 TB |
| 128K | 11.3 GB | 5.6 GB | 1.36 TB |
| 160K (max) | 14.1 GB | 7.0 GB | 1.36 TB |
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; shapes are [out, in] for weight matrices, as PyTorch stores them. One block is shown: the model repeats it 61 times (in two kinds).
| Tensor | Shape | Parameters |
|---|---|---|
| Embedding | ||
model.embed_tokens.weight | [129,280, 7,168] | 926,679,040 |
| Dense blocks with an indexer (layers 0–2): model.layers.N.… | ||
self_attn.q_a_proj.weightcompress the query | [1,536, 7,168] | 11,010,048 |
self_attn.q_a_layernorm.weight | [1,536] | 1,536 |
self_attn.q_b_proj.weightexpand to every head | [24,576, 1,536] | 37,748,736 |
self_attn.kv_a_proj_with_mqa.weightthe latent that is cached, plus one shared RoPE key | [576, 7,168] | 4,128,768 |
self_attn.kv_a_layernorm.weight | [512] | 512 |
self_attn.kv_b_proj.weightexpand the latent to keys and values | [32,768, 512] | 16,777,216 |
self_attn.o_proj.weight | [7,168, 16,384] | 117,440,512 |
self_attn.indexer.wq_b.weightindexer queries, from the compressed query | [8,192, 1,536] | 12,582,912 |
self_attn.indexer.wk.weightone indexer key per token, cached | [128, 7,168] | 917,504 |
self_attn.indexer.k_norm.weightLayerNorm | [128] | 128 |
self_attn.indexer.k_norm.bias | [128] | 128 |
self_attn.indexer.weights_proj.weighthow much each indexer head counts | [64, 7,168] | 458,752 |
mlp.gate_proj.weight | [18,432, 7,168] | 132,120,576 |
mlp.up_proj.weight | [18,432, 7,168] | 132,120,576 |
mlp.down_proj.weight | [7,168, 18,432] | 132,120,576 |
input_layernorm.weight | [7,168] | 7,168 |
post_attention_layernorm.weight | [7,168] | 7,168 |
| MoE blocks with an indexer (layers 3–60): model.layers.N.… | ||
self_attn.q_a_proj.weightcompress the query | [1,536, 7,168] | 11,010,048 |
self_attn.q_a_layernorm.weight | [1,536] | 1,536 |
self_attn.q_b_proj.weightexpand to every head | [24,576, 1,536] | 37,748,736 |
self_attn.kv_a_proj_with_mqa.weightthe latent that is cached, plus one shared RoPE key | [576, 7,168] | 4,128,768 |
self_attn.kv_a_layernorm.weight | [512] | 512 |
self_attn.kv_b_proj.weightexpand the latent to keys and values | [32,768, 512] | 16,777,216 |
self_attn.o_proj.weight | [7,168, 16,384] | 117,440,512 |
self_attn.indexer.wq_b.weightindexer queries, from the compressed query | [8,192, 1,536] | 12,582,912 |
self_attn.indexer.wk.weightone indexer key per token, cached | [128, 7,168] | 917,504 |
self_attn.indexer.k_norm.weightLayerNorm | [128] | 128 |
self_attn.indexer.k_norm.bias | [128] | 128 |
self_attn.indexer.weights_proj.weighthow much each indexer head counts | [64, 7,168] | 458,752 |
mlp.gate.weightthe router: one score per expert | [256, 7,168] | 1,835,008 |
mlp.gate.e_score_correction_biasrouting only | [256] | 256 |
mlp.experts.{0…255}.gate_proj.weight | 256 × [2,048, 7,168] | 3,758,096,384 |
mlp.experts.{0…255}.up_proj.weight | 256 × [2,048, 7,168] | 3,758,096,384 |
mlp.experts.{0…255}.down_proj.weight | 256 × [7,168, 2,048] | 3,758,096,384 |
mlp.shared_experts.gate_proj.weightshared expert: runs for every token | [2,048, 7,168] | 14,680,064 |
mlp.shared_experts.up_proj.weightshared expert: runs for every token | [2,048, 7,168] | 14,680,064 |
mlp.shared_experts.down_proj.weightshared expert: runs for every token | [7,168, 2,048] | 14,680,064 |
input_layernorm.weight | [7,168] | 7,168 |
post_attention_layernorm.weight | [7,168] | 7,168 |
| After the last block | ||
model.norm.weightfinal norm | [7,168] | 7,168 |
lm_head.weightscores every token in the vocabulary | [129,280, 7,168] | 926,679,040 |
The parameter count, step by step
Each line gives the formula, the numbers from config.json, and the subtotal. The symbols:
- V
- vocabulary 129,280
- d
- hidden size 7,168
- L
- layers 61
- H
- attention heads 128
- h_n
- query/key size without RoPE 128
- h_r
- RoPE part of query/key 64
- h_v
- value size per head 128
- r_kv
- KV latent rank 512
- r_q
- query latent rank 1,536
- f
- FFN hidden size 18,432
- E
- routed experts 256
- k
- experts per token 8
- f_e
- expert FFN size 2,048
1. Embedding
One row of d numbers for each of the V tokens in the vocabulary.
2. Dense blocks with an indexer (layers 0–2), ×3
3. MoE blocks with an indexer (layers 3–60), ×58
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 44,040,192 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.
Hugging Face counts 685,355,329,792 parameters in the deepseek-ai/DeepSeek-V3.2-Exp-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 × 38,403,822,336 = 76.8 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 | 76.8 GFLOPs | 20.5 GFLOPs | 97.3 GFLOPs |
| 32K | 76.8 GFLOPs | 163.7 GFLOPs | 240.6 GFLOPs |
| 128K | 76.8 GFLOPs | 655.0 GFLOPs | 731.8 GFLOPs |
| 160K | 76.8 GFLOPs | 818.7 GFLOPs | 895.5 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
DeepSeek-V3.2 vs Inkling · DeepSeek-V3.2 vs GLM-5.2 · Compare with any model →
Close in size: DeepSeek-V3 671B · DeepSeek-R1 671B · DeepSeek-V3.1 671B · GLM-5.2 743B · Nemotron 3 Ultra 550B-A55B 549B
Source
Read from deepseek-ai/DeepSeek-V3.2-Exp-Base, fetched 2026-12-03. Read from the V3.2-Exp base model; DeepSeek-V3.2 (December 2025) has the same shapes. It is V3.1 plus DeepSeek Sparse Attention's indexer in every layer.