DeepSeek · DeepSeek

DeepSeek-V3

DeepSeek-V3 from DeepSeek has 671,026,419,200 parameters, of which about 37.6B 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 70.3 KB of KV cache (2.3 GB at 32K tokens).

671Bparameters
37.6Bactive per token
1.34 TBBF16 weights
336 GB4-bit weights
70.3 KBKV per token

Part of the DeepSeek family: 15.7B · 671B · 671B

Architecture · VRAM · KV cache · Tensor shapes · Parameter count · FLOPs

Architecture

ArchitectureDeepseekV3ForCausalLM
Layers (L)61
Hidden size (d)7,168
AttentionMLA (multi-head latent attention)
Heads128 (query/key 128+64, value 128); KV compressed to rank 512
Feed-forward256 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 embeddingsno: separate output head
Biasesnone
Extra normspre-norm (RMSNorm before attention and FFN)
Max context163,840 tokens
Weights in the releaseFP8 (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:

PrecisionBytes per parameterWeights
FP3242.68 TB2499.77 GiB
BF16 / FP1621.34 TB1249.88 GiB
INT8 / FP81671 GB624.94 GiB
INT40.5336 GB312.47 GiB
As released (whole checkpoint)1 (FP8)688 GB641.13 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.

Memory calculator

On common GPUs

Whether the weights plus a 8K-token KV cache fit in 90% of the card (how this is worked out):

GPU memoryBF168-bit4-bit
8 GB–––
12 GB–––
16 GB–––
24 GB–––
48 GB–––
80 GB–––

KV cache

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) × 2 bytes = 61 × (512 + 64) × 2 = 70,272 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.

ContextKV cache, BF168-bit KVWeights + KV, BF16
4K288 MB144 MB1.34 TB
32K2.3 GB1.2 GB1.34 TB
128K9.2 GB4.6 GB1.35 TB
160K (max)11.5 GB5.8 GB1.35 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).

TensorShapeParameters
Embedding
model.embed_tokens.weight[129,280, 7,168]926,679,040
Dense blocks (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
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 (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
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.weight256 × [2,048, 7,168]3,758,096,384
mlp.experts.{0…255}.up_proj.weight256 × [2,048, 7,168]3,758,096,384
mlp.experts.{0…255}.down_proj.weight256 × [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.

Embedding
V × d
129,280 × 7,168
= 926,679,040

2. Dense blocks (layers 0–2), ×3

Attention (MLA)
r_q × d + r_q + H·(h_n+h_r) × r_q + (r_kv+h_r) × d + r_kv + H·(h_n+h_v) × r_kv + d × H·h_v
1,536 × 7,168 + 1,536 + 24,576 × 1,536 + 576 × 7,168 + 512 + 32,768 × 512 + 7,168 × 16,384
= 187,107,328
Feed-forward (SwiGLU)
2 × (f × d) + d × f
2 × (18,432 × 7,168) + 7,168 × 18,432
= 396,361,728
Norms
2 × d
2 × 7,168
= 14,336
One block
attention + feed-forward + norms
187,107,328 + 396,361,728 + 14,336
= 583,483,392
3 blocks
3 × block
3 × 583,483,392
= 1,750,450,176

3. MoE blocks (layers 3–60), ×58

Attention (MLA)
r_q × d + r_q + H·(h_n+h_r) × r_q + (r_kv+h_r) × d + r_kv + H·(h_n+h_v) × r_kv + d × H·h_v
1,536 × 7,168 + 1,536 + 24,576 × 1,536 + 576 × 7,168 + 512 + 32,768 × 512 + 7,168 × 16,384
= 187,107,328
Mixture of experts (256 experts, 8 per token)
E × d + E + 2 × (E × (f_e × d)) + E × (d × f_e) + 2 × (f_e × d) + d × f_e
256 × 7,168 + 256 + 2 × (256 × (2,048 × 7,168)) + 256 × (7,168 × 2,048) + 2 × (2,048 × 7,168) + 7,168 × 2,048
= 11,320,164,608
Norms
2 × d
2 × 7,168
= 14,336
One block
attention + mixture of experts + norms
187,107,328 + 11,320,164,608 + 14,336
= 11,507,286,272
58 blocks
58 × block
58 × 11,507,286,272
= 667,422,603,776

4. Final norm and output head

Final norm + head
d + V × d
7,168 + 129,280 × 7,168
= 926,686,208

5. Total

Total
embedding + blocks + final
926,679,040 + 1,750,450,176 + 667,422,603,776 + 926,686,208
= 671,026,419,200

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.

Active
total − MoE blocks × (E − k) × expert
671,026,419,200 − 58 × 248 × 44,040,192
= 37,552,297,472

7. Multi-token prediction

The checkpoint also ships 1 multi-token-prediction module, trained to guess a further token 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.

MTP module 1 (layer 61): its own pieces
2 × (V × d) + 3 × d + d × 2d
2 × (129,280 × 7,168) + 3 × 7,168 + 7,168 × 14,336
= 1,956,140,032
MTP module 1: a transformer block
one block, as in MoE blocks
11,507,286,272
= 11,507,286,272
In the checkpoint
language model + MTP
671,026,419,200 + 13,463,426,304
= 684,489,845,504

Hugging Face counts 684,489,845,504 parameters in the deepseek-ai/DeepSeek-V3 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 × 37,552,297,472 = 75.1 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 T2NAttentionTotal per token
4K75.1 GFLOPs20.5 GFLOPs95.6 GFLOPs
32K75.1 GFLOPs163.7 GFLOPs238.9 GFLOPs
128K75.1 GFLOPs655.0 GFLOPs730.1 GFLOPs
160K75.1 GFLOPs818.7 GFLOPs893.8 GFLOPs

Training costs about three times the forward pass per token (6N): the backward pass does roughly twice the forward work.

Compare

DeepSeek-V3 vs Llama 3.1 70B · DeepSeek-V3 vs Qwen3 235B-A22B · DeepSeek-V3 vs Llama 4 Maverick (17B-128E) · Compare with any model →

Close in size: DeepSeek-R1 671B · Llama 3.1 405B 406B · Llama 4 Maverick (17B-128E) 401B · Qwen3 235B-A22B 235B · Mixtral 8x22B 141B

Source

Read from deepseek-ai/DeepSeek-V3, fetched 2026-12-02.