Training

Pinned sources DeepSeek‑V4 report (arXiv 2606.19348v1) · model card (deepseek‑ai/DeepSeek‑V4‑Flash @ 60d8d70) · no training code is published

  1. Start of training
  2. Pre‑training 4Kdense attention4KNTPFIMMTPλ 0.3, then 0.1Balanceweight 0.0001What trains: alldense, MTP module
  3. Pre‑training 16Kdense attention16KNTPFIMMTPλ 0.3, then 0.1Balanceweight 0.0001What trains: all
  4. Indexer warm‑upa short stagenot statedKLto main attentionWhat trains: indexerindexernot stated: context
  5. Pre‑training 64Ksparse attention64KNTPFIMMTPλ 0.3, then 0.1Balanceweight 0.0001What trains: allsparse, top 512
  6. Pre‑training 1Msparse attention1MNTPFIMMTPλ 0.3, then 0.1Balanceweight 0.0001What trains: all
  7. DeepSeek-V4-Flash-Base
  8. Specialists: SFTone model per domainnot statedSFTnot statedMXFP4 expertsnot stated: context, what trains
  9. Specialists: RLone model per domainnot statedGRPOnot statednot stated: context, what trains
  10. Domain specialists
  11. Where the student starts: not stated
  12. On‑policy distillationmore than ten teachersnot statedOPDreverse KL, full vocabularynot statednot stated: context, what trains
  13. DeepSeek V4-Flash

Not stated for any stage: tokens.

  • NTPdashed: concluded, no source names it
  • not stated by the sources
  • the architecture changes
  • checkpoint
  • checkpoint, weights published
  • a join the sources leave unexplained

Pre-training 16K

×

The sequence length grows to 16K, still with dense attention.

Next-token prediction

L=−1T∑i=2T+1log⁡Pi[ti]\mathcal L=-\frac1T\sum_{i=2}^{T+1}\log P_i[t_i]
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.

tit_i: the token at position ii; Pi[ti]P_i[t_i]: the probability the model, reading the tokens before it, gave that token; TT: the sequence length.

  • Fill-in-the-middle. Inherited from DeepSeek-V3; the V4 report gives no rate.
  • Multi-token prediction. Depth 1 (D=1D=1); λ\lambda is 0.3 for most of training and 0.1 once the learning rate starts to decay.
  • Balance loss. Only a complement here, with α=0.0001\alpha=0.0001: the load is balanced mainly with no loss, by biases moved at a speed of 0.001.
Context
16K
Attention
dense
Tokens, all pre-training
32T

Not disclosed Tokens · Steps

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
16K, the first extension
Attention
Dense: the model is warmed up with dense attention for the first 1T tokens, and sparse attention comes in at a sequence length of 64K
Sources5