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

Context extension

×

YaRN extends the context from 4K to 128K in 1,000 steps at 32K.

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.

Next-token prediction continues from pre-training; whether the balance losses do too, the paper does not say.

Tokens
≈ 18.9Bderived
Steps, sequence, batch
1,000 steps; 32K tokens; batch 576

Not disclosed Learning rate

YaRN rescales the rotary key from here on (scale 40).

What the terms meanYaRN
YaRN
A way to lengthen the context of rotary position embeddings: the slow-turning frequencies are divided by a factor s, the fast ones kept and those between blended, and attention scores are rescaled slightly, so that positions past the trained length look like positions the model has seen.
All settings4
Method
YaRN on the decoupled shared key only: s = 40, α = 1, β = 32, target length 160K; scaling factor √t = 0.0707 ln s + 1
Steps, sequence, batch
1,000 steps; 32K tokens; batch 576
Tokens
1,000 × 576 × 32,768 ≈ 18.9BderivedSteps × sequences × sequence length.
Context read
128K, though trained at 32K
Sources2