Pre-training 1M
×The sequence length reaches 1M; after pre-training the model supports a context of 1M natively.
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. Inherited from DeepSeek-V3; the V4 report gives no rate.
- Multi-token prediction. Depth 1 (); is 0.3 for most of training and 0.1 once the learning rate starts to decay.
- Balance loss. Only a complement here, with : the load is balanced mainly with no loss, by biases moved at a speed of 0.001.
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.
- Context
- 1M
- Attention
- sparse
- Tokens, all pre-training
- 32T
Not disclosed Tokens · Steps
Architecture at this stageThe model as drawn, at a sequence length of 1M.
All settings12
- Tokens, all pre-training
- 32T tokens, from a corpus of more than 32T tokens
- Data
- DeepSeek-V3’s pre-training data, refined: auto-generated and templated web content filtered out; mathematics and code; a larger multilingual corpus; long documents such as scientific papers and technical reports; agentic data added in a mid-training phase the report does not place
- Packing
- Documents from different sources packed to minimize truncation, with sample-level attention masking; DeepSeek-V3’s tokenizer and vocabulary of 128K with a few special tokens added; its token-splitting and fill-in-the-middle kept
- Objective
- Next-token prediction with multi-token prediction of depth 1 (loss weight 0.3 for most of training, 0.1 once the learning rate decays) and fill-in-the-middle, as in DeepSeek-V3
- Load balancing
- Auxiliary-loss-free, bias update speed 0.001; a sequence-level balance loss of weight 0.0001
- Optimizer
- Muon for most parameters (momentum 0.95, weight decay 0.1, update RMS rescaled to 0.18); AdamW for the embedding, the prediction head and the RMSNorm weights (β₁ 0.9, β₂ 0.95, ε 10⁻²⁰, weight decay 0.1)
- Learning rate
- Linear warm-up over the first 2,000 steps to 2.7 × 10⁻⁴, held for most of training, then a cosine decay to 2.7 × 10⁻⁵ near the end
- Batch
- Scheduled up from a small size to 75.5M tokens, then 75.5M for most of training, as in DeepSeek-V3
- Stability
- SwiGLU clamped throughout, its linear part to [−10, 10] and its gate to at most 10; on a loss spike, a short rollback and Anticipatory Routing, routing indices computed from earlier parameters, for a while
- Trainable
- Every parameter
- Context
- 1M, the last extension; after pre-training the model supports 1M-length contexts natively
- Attention
- Sparse, kept for the rest of training
Sources5
- DeepSeek-V4-2606.19348v1.pdf, p. 5Tokens, all pre-training, Context
- DeepSeek-V4-2606.19348v1.pdf, p. 24Tokens, all pre-training, Data, Packing, Objective, Attention
- DeepSeek-V4-2606.19348v1.pdf, p. 25Tokens, all pre-training, Objective, Load balancing, Optimizer, Learning rate, Batch, Trainable, Context, Attention
- DeepSeek-V4-2606.19348v1.pdf, p. 4Objective
- DeepSeek-V4-2606.19348v1.pdf, p. 26Stability