Training

Pinned sources GLM‑5.2 model card (zai‑org/GLM‑5.2 @ cf457fa) · GLM‑5.3 model card (zai‑org/GLM‑5.3 @ ba32f8c), for the base model · for GLM‑5, its report (arXiv 2602.15763v2) · no training code is published

  1. GLM-5, February 2026, earlier release 12 stages
  2. Start of training
  3. Pre‑training, generalweb data18T4KNTPMTPWhat trains: all3 shared MTP layers
  4. Pre‑training, code and reasoningcode, mathematics, science9T4KNTPMTPWhat trains: all
  5. Mid‑training 32Klong code and reasoning1T32KNTPWhat trains: all
  6. Mid‑training 128Klong context and agent data500B128KNTPWhat trains: all
  7. Mid‑training 200Kthe longest documents50B200KNTPWhat trains: all
  8. Base model, dense attention
  9. DSA warm‑up1,000 steps≈ 2.8B202,752KLto main attentionWhat trains: indexer+ indexer
  10. Sparse adaptationmid-training’s data20B200KLMKLselected positionsWhat trains: allsparse
  11. GLM-5 base model
  12. SFTchat, reasoning, agentsnot stated202,752SFTnot statednot stated: tokens, what trains
  13. Reasoning RLfour domainsnot statednot statedGRPO+ IcePopWhat trains: not indexernot stated: tokens, context
  14. Agentic RLasynchronousnot statednot statedGRPOWhat trains: not indexernot stated: tokens, context
  15. General RLhuman-style alignmentnot statednot statedGRPOWhat trains: not indexernot stated: tokens, context
  16. On‑policy distillationacross stagesnot statednot statedOPDnot statednot stated: tokens, context, what trains
  17. GLM-5
  18. Whether GLM-5.2’s base continues GLM-5: not stated
  19. GLM-5.2’s base model
  20. Training, not describednot statednot statednot statednot statednot stated: tokens, context, objective, what trains
  21. GLM-5.2
  • 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
  • a join the sources leave unexplained

SFT

×

Stage · GLM-5

Supervised fine-tuning on general chat, reasoning, and coding and agent data, at a context of 202,752, with interleaved, preserved and turn-level thinking.

Supervised fine-tuning

LSFT=−∑t∈ylog⁡P(yt∣x,y<t)\mathcal L_{\mathrm{SFT}}=-\sum_{t\in y}\log P(y_t\mid x,y_{<t})
In words

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.

xx: the prompt; yy: the response; the prompt’s tokens are left out of the loss.

Number format
INT4 QAT

Not disclosed Tokens · Learning rate · Epochs · Trainable

Why

Erroneous segments are kept but masked out of the loss, so the model learns to correct errors without being trained toward the wrong actions. GLM-5 report §3.1, p. 11

What the terms meanQuantization-aware training
Quantization-aware training
Training with the numbers the model will store or compute in low precision, its weights, activations or attention cache, rounded to that format in the forward pass, so that the model learns to work despite the rounding.
All settings5
Data
General chat (question answering, writing, role-play, translation, dialogue); reasoning (mathematics, programming, science); coding and agents (front- and back-end code, tool calls, coding and search agents), from many execution environments and improved with expert RL and rejection sampling
Context
Up to 202,752 tokens
Loss mask
Erroneous segments of agent trajectories are kept and masked out of the loss
Thinking
Interleaved thinking before every response and tool call; preserved thinking across turns of coding agents; thinking switched on or off per turn
Number format
INT4 quantization-aware training, with a kernel bitwise identical in training and inference
Sources2