Context extension
×YaRN extends the context from 4K to 128K in 1,000 steps at 32K.
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.
Next-token prediction continues from pre-training; whether the balance losses do too, the paper does not say.
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
- ≈ 18.9Bderived
- Steps, sequence, batch
- 1,000 steps; 32K tokens; batch 576
Not disclosed Learning rate
Architecture at this stageThe model as drawn, the published DeepSeek-V2.
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
- DeepSeek-V2-2405.04434v5.pdf, p. 13Method, Steps, sequence, batch, Tokens, Context read
- config.json, lines 38–46Method