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

Pre-training, general

×

The general pre-training corpus, 18T tokens at a 4K context: refined web data, with classifiers for quality and for long-tail world knowledge.

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.

  • Multi-token prediction. Three MTP layers that share one set of parameters, so that the draft model at inference costs as much memory as DeepSeek-V3’s one layer; the report gives no weight λ\lambda.
Tokens
18T
Context
4K
Learning rate
warm-up to 2×10⁻⁴, decay to 4×10⁻⁵
Optimizer
Muon Split

Not disclosed Batch · Steps

Why

With Muon, MLA’s 576-dimensional latent cache fell short of grouped-query attention with 8 groups. Orthogonalizing the up-projections head by head lets each head’s weights update at its own scale, and closes the gap (Table 1). GLM-5 report §2.1, p. 5

What the terms meanMTP, multi-token prediction · Speculative decoding · Muon
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.
Speculative decoding
A small draft model proposes the next few tokens and the large model checks them all in one pass, accepting them so that its own output distribution is unchanged; each accepted token is a forward pass saved.
Muon
An optimizer for weight matrices: it keeps a momentum of the gradients and replaces each matrix’s momentum by its nearest orthogonal matrix (a few Newton–Schulz iterations), so every direction of the matrix is updated by a similar amount.
All settings7
Tokens
18T, the general pre-training corpus; 27T with the code and reasoning corpus
Context
4K
Data
Web data through GLM-4.5’s pipeline, with a second DCLM classifier on sentence embeddings and a World Knowledge classifier that recovers long-tail knowledge from medium- and low-quality pagesThe report describes this data without naming its stage; it is placed here by the corpus names of Figure 5 (p. 4).
Objective
Next-token prediction, with multi-token prediction: three MTP layers that share their parameters during training
Learning rate
Warm-up from 0 to 2×10⁻⁴, then decay to 4×10⁻⁵ by the end of pre-training; cosine decay and a batch-size warm-up as for GLM-4.5
Optimizer
Muon, as for GLM-4.5, with “Muon Split”: the up-projections of queries, keys and values are orthogonalized head by head; attention logits stay stable with no clipping
Trainable
Every parameter
Sources5