Training

Pinned sources GLM‑5 report (arXiv 2602.15763v2) · no training code is published

  1. Start of training
  2. Pre‑training, generalweb data18T4KNTPMTPWhat trains: all3 shared MTP layers
  3. Pre‑training, code and reasoningcode, mathematics, science9T4KNTPMTPWhat trains: all
  4. Mid‑training 32Klong code and reasoning1T32KNTPWhat trains: all
  5. Mid‑training 128Klong context and agent data500B128KNTPWhat trains: all
  6. Mid‑training 200Kthe longest documents50B200KNTPWhat trains: all
  7. Base model, dense attention
  8. DSA warm‑up1,000 steps≈ 2.8B202,752KLto main attentionWhat trains: indexer+ indexer
  9. Sparse adaptationmid-training’s data20B200KLMKLselected positionsWhat trains: allsparse
  10. GLM-5 base model
  11. SFTchat, reasoning, agentsnot stated202,752SFTnot statednot stated: tokens, what trains
  12. Reasoning RLfour domainsnot statednot statedGRPO+ IcePopWhat trains: not indexernot stated: tokens, context
  13. Agentic RLasynchronousnot statednot statedGRPOWhat trains: not indexernot stated: tokens, context
  14. General RLhuman-style alignmentnot statednot statedGRPOWhat trains: not indexernot stated: tokens, context
  15. On‑policy distillationacross stagesnot statednot statedOPDnot statednot stated: tokens, context, what trains
  16. GLM-5
  • tokens, log scale
  • derived: computed from stated numbers
  • NTPdashed: concluded, no source names it
  • not stated by the sources
  • the architecture changes
  • checkpoint
  • checkpoint, weights published

Mid-training 128K

×

The context goes to 128K on 500B tokens, long documents and synthetic agent trajectories up-sampled.

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 shared MTP layers train in mid-training too, the report does not say.

Tokens
500B
Context
128K

Not disclosed Batch · Steps

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