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

On-policy distillation

×

The final stage recovers what earlier stages taught: the final checkpoints of SFT, Reasoning RL and General RL are teachers, and the model learns from their gap to its own tokens.

On-policy distillation

The model being trained writes its own response and a teacher scores each of its tokens: a token the teacher finds more probable than the student does is rewarded, one it finds less probable is penalized.

rt=clip⁡(sg⁡(log⁡(pT/pS)),−Rmax⁡, Rmax⁡)\begin{aligned}r_t=\operatorname{clip}\big(&\operatorname{sg}(\log(p_T/p_S)),\\&-R_{\max},\ R_{\max}\big)\end{aligned}

Kimi K3 report, eq. 15, in the atlas’s letters

What the letters mean

pTp_T, pSp_S: the teacher’s and the student’s probability of token tt of the student’s response; sg⁡\operatorname{sg}: no gradient flows through it; Rmax⁡R_{\max}: a clipping bound. A per-token reward, not a loss: it enters a reinforcement-learning update.

The GLM-5 report writes it as eq. 1 with the advantage replaced by sg⁡[log⁡(πteacher/πθ)]\operatorname{sg}\big[\log(\pi_{\text{teacher}}/\pi_\theta)\big] per token (eq. 2), with no clip on it.

Hyper-parameters
group 1, batch 1,024

Not disclosed Steps · Learning rate · Trainable

Why

Optimizing distinct objectives one after another erodes what earlier stages taught; a final distillation from the checkpoints of SFT, Reasoning RL and General RL recovers those skills. GLM-5 report §3.5, p. 13

What the terms meanSFT
SFT
The model is trained on examples of the answers wanted, prompts with their responses, by the cross-entropy of next-token prediction on the responses.
All settings3
Teachers
The final checkpoints of the preceding stages, SFT, Reasoning RL and General RL; the prompts sampled from the teachers’ RL training sets
Objective
Eq. 1 with the advantage replaced by the stopped log-ratio of the teacher’s to the student’s probability of each token (eq. 2)
Hyper-parameters
A group size of 1 and a batch size of 1,024
Sources3