Training

Pinned sources GLM‑5.1 model card (zai‑org/GLM‑5.1 @ 26e1bd6) · 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.1 continues GLM-5: not stated
  19. GLM-5.1’s start
  20. Training, not describednot statednot statednot statednot statednot stated: tokens, context, objective, what trains
  21. GLM-5.1
  • 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

Sparse adaptation

×

Stage · GLM-5

Sparse attention switched on for 20B tokens of mid-training’s data.

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.

The report follows DeepSeek-V3.2-Exp’s two stages. In DeepSeek’s recipe the warm-up trains only the indexer, by KL to the main attention, and the sparse stage trains every parameter; the report’s own small run on GLM-4.7-Flash (p. 7) trains only the indexer in the warm-up and the whole model after it, and names no loss.

  • KL to a target distribution. One part of the model learns to imitate a distribution another part produces: the loss is the KL divergence of that target from the learner’s distribution.
Tokens
20B
Learning rate
1×10⁻⁵
Data and settings
Mid-training’s data and hyper-parameters
Outcome
close to the dense model

Not disclosed Objective · Trainable · Steps

Why

DSA was brought in by continued training from a dense base model, which avoided the cost of training from scratch. GLM-5 report §2.1.1, p. 5

20B tokens were enough to match the dense model, against DeepSeek-V3.2’s 943.7B. GLM-5 report §2.1.1, p. 6

What the terms meanSparse attention
Sparse attention
Each query attends only to a subset of the earlier positions, picked by an indexer, which keeps attention over a long context affordable.
All settings6
Tokens
20B
Context
200K
Method
DeepSeek Sparse Attention brought in by continued training from the dense base model, in DeepSeek-V3.2-Exp’s two stages, “dense warm-up and sparse training adaptation”
Data and settings
Mid-training’s data and hyper-parameters
Learning rate
Constant, 1×10⁻⁵
Outcome
Long-context benchmarks close to the dense model’s (Table 3); the dense and sparse models fine-tuned on the same SFT data tie in loss and benchmarks
Sources4