Training

Pinned sources DeepSeek‑V2 paper (arXiv 2405.04434v5) · no training code is published

  1. Random initialisation
  2. Pre‑training8.1T4KNTPBalanceα₁ 0.003, α₂ 0.05, α₃ 0.02What trains: all
  3. Context extension≈ 18.9B32KNTPWhat trains: allYaRN, s = 40
  4. DeepSeek-V2
  • tokens, log scale
  • derived: computed from stated numbers
  • NTPdashed: concluded, no source names it
  • the architecture changes
  • checkpoint
  • checkpoint, weights published

Pre-training

×

Training from scratch on 8.1T tokens at 4K context, with three balance losses and device-limited routing.

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.

  • Balance loss. Three auxiliary losses, for expert-level, device-level and communication balance, with α1=0.003\alpha_1=0.003, α2=0.05\alpha_2=0.05, α3=0.02\alpha_3=0.02.
Data
8.1T tokens
Context
4K
Learning rate
2.4×10⁻⁴, ×0.316 twice
Batch
2,304 → 9,216
Compute
≈ 1.4M H800 GPU hoursderived

Not disclosed Data mixture proportions

All settings9
Data
8.1T tokens; the DeepSeek 67B pipeline with more data and better filtering; more Chinese, about 12% more Chinese tokens than English
Objective
Next-token predictionderivedThe paper does not name the pre-training objective; the loss of the code shipped with the checkpoint is the next-token cross-entropy.
Load balancing
Expert-, device- and communication-level balance losses, α₁ = 0.003, α₂ = 0.05, α₃ = 0.02; device-limited routing to at most 3 of 8 devices; device-level token dropping in training, none in evaluation
Optimiser
AdamW, β₁ = 0.9, β₂ = 0.95, weight decay 0.1; gradient clipping at 1.0
Learning rate
0 → 2.4×10⁻⁴ over the first 2K steps; multiplied by 0.316 after about 60% of the tokens and again after about 90%
Context
4K
Batch
2,304 → 9,216 over the first 225B tokens, then 9,216; the paper gives no unit
Compute
≈ 1.4M H800 GPU hoursderived172.8K GPU hours per trillion tokens, the paper’s rate, times 8.1T tokens.
Trainable
All parameters, randomly initialised
Sources5