Pre-training
×Stage · DeepSeek-V3
Next-token prediction on 14.8T tokens at 4K context, with multi-token prediction and auxiliary-loss-free load balancing.
Next-token prediction
In words
At every position the model gives each token of the vocabulary a probability of coming next; the loss is the negative logarithm of the probability it gave the token that does come next, averaged over the sequence.
: the token at position ; : the probability the model, reading the tokens before it, gave that token; : the sequence length.
- Fill-in-the-middle. A tenth of the documents are rearranged so that next-token prediction learns to write a middle from both sides.
- Multi-token prediction. One module (); is 0.3 for the first 10T tokens, then 0.1.
- Balance loss. Only a complement here, with : the load is balanced mainly with no loss, auxiliary-loss-free.
Next-token prediction as drawn for DeepSeek‑V3.2‑Exp →That plate also draws multi-token prediction, fill-in-the-middle and DeepSeek-V3’s sequence-wise balance loss.
- Tokens
- 14.8T
- Context
- 4K
- Learning rate
- 2.2×10⁻⁴, down to 7.3×10⁻⁶
- Batch
- 3,072 → 15,360 sequences
- Compute
- 2,664K H800 GPU hours
Not disclosed Data mixture proportions
Architecture at this stageDeepSeek-V3’s architecture: no lightning indexer, dense attention; one MTP module trains beside it.
A multi-token prediction module of depth 1 trains alongside the model in pre-training; no source says whether later stages keep it. The report says inference can discard it or reuse it for speculative decoding (p. 11); the pinned inference code builds none (model.py 881–886).
What the terms meanMTP, multi-token prediction · Auxiliary-loss-free balancing
- MTP, multi-token prediction
- Extra modules predict tokens further ahead than the next one, and their cross-entropy, times a weight λ, is added to the loss.
- Auxiliary-loss-free balancing
- Load balancing of the MoE experts with no loss: each expert has a bias on its routing score, used only to choose experts, moved after each step so that over-used experts are chosen less and under-used ones more.
All settings11
- Data
- 14.8T tokens; more mathematics and code than DeepSeek-V2; multilingual beyond English and Chinese; documents packed without cross-sample masking
- Objective
- Next-token prediction; Fill-in-Middle (prefix–suffix–middle) at rate 0.1; multi-token prediction of depth 1, weight 0.3 for the first 10T tokens, then 0.1
- Load balancing
- Auxiliary-loss-free bias, update speed 0.001 for the first 14.3T tokens, then 0; sequence-wise balance loss α = 0.0001
- Optimiser
- AdamW, β₁ = 0.9, β₂ = 0.95, weight decay 0.1; gradient clipping at 1.0
- Learning rate
- 0 → 2.2×10⁻⁴ over the first 2K steps; constant until 10T tokens; cosine down to 2.2×10⁻⁵ over 4.3T; 2.2×10⁻⁵ for 333B; 7.3×10⁻⁶ for the last 167B
- Context
- 4K
- Batch
- 3,072 → 15,360 sequences over the first 469B tokens, then 15,360
- Tokens
- 10T + 4.3T + 0.5T = 14.8TderivedThe learning-rate phases add up to the reported total.
- Compute
- 2,664K H800 GPU hours
- Number format
- FP8 mixed-precision training
- Trainable
- All parameters, randomly initialised
Sources6
- DeepSeek-V3 report, pp. 21–22Data
- DeepSeek-V3 report, pp. 22–23Objective, Optimiser, Learning rate, Tokens
- DeepSeek-V3 report, p. 23Load balancing, Batch
- DeepSeek-V3 report, p. 22Context, Trainable
- DeepSeek-V3 report, p. 5Compute
- DeepSeek-V3 report, pp. 4–5Number format