Mid-training 128K
×Stage · GLM-5
The context goes to 128K on 500B tokens, long documents and synthetic agent trajectories up-sampled.
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
- 500B
- Context
- 128K
Not disclosed Batch · Steps
Architecture at this stageThe model as drawn but with dense MLA attention, no indexer.
What the terms meanTrajectory · MTP, multi-token prediction
- Trajectory
- The record of a model working through a task: its reasoning, its tool calls and what the tools returned, turn by turn.
- 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
- 500B
- Context
- 128K
- Data
- Long-context and agent data: natural long documents (books, papers) filtered and up-sampled toward knowledge-intensive domains, and synthetic sequences that pack similar texts together to build long-range dependencies; long documents and synthetic agent trajectories up-sampled in the later stagesThe 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. 9Data
- GLM5-2602.15763v2.pdf, p. 36Learning rate