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
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.
: the token at position ; : the probability the model, reading the tokens before it, gave that token; : 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 .
Next-token prediction as drawn for DeepSeek‑V3.2‑Exp →That plate also draws multi-token prediction, fill-in-the-middle and DeepSeek-V3’s sequence-wise balance loss.
- 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
Architecture at this stageThe model as drawn but with dense MLA attention, no indexer; three MTP layers sharing parameters train beside it.
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
- GLM5-2602.15763v2.pdf, p. 4Tokens, Context, Trainable
- GLM5-2602.15763v2.pdf, p. 3Tokens
- GLM5-2602.15763v2.pdf, p. 8Data
- GLM5-2602.15763v2.pdf, p. 5Objective, Optimizer
- GLM5-2602.15763v2.pdf, p. 36Learning rate, Optimizer