Mid-training 32K
×The context goes to 32K on 1T tokens of long code and reasoning data, among them repository-level sequences built around 10 million issue–PR pairs.
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 shared MTP layers train in mid-training too, the report 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
- 1T
- Context
- 32K
- Data
- repository-level code, about 10 million issue–PR pairs
- Learning rate
- 4×10⁻⁵ to 1×10⁻⁵ over mid-training
Not disclosed Batch · Steps
Architecture at this stageThe model as drawn but with dense MLA attention, no indexer.
What the terms meanMTP, multi-token prediction
- MTP, multi-token prediction
- Extra modules predict tokens further ahead than the next one, and their cross-entropy, times a weight λ, is added to the loss.
All settings6
- Tokens
- 1T
- Context
- 32K
- Data
- Long code and reasoning data; repository files, commit diffs, issues, pull requests and related files concatenated into one sequence, about 10 million issue–PR pairs, 160B unique tokens after filteringThe report describes this data without naming its stage; it is placed here by the corpus names of Figure 5 (p. 4).
- Learning rate
- Down linearly from 4×10⁻⁵ to 1×10⁻⁵ over mid-training
- Objective
- Next-token prediction
- Trainable
- Every parameter
Sources3
- GLM5-2602.15763v2.pdf, p. 8Tokens, Context, Data, Objective, Trainable
- GLM5-2602.15763v2.pdf, p. 4Tokens, Data
- GLM5-2602.15763v2.pdf, p. 36Learning rate