Sparse adaptation
×Sparse attention switched on for 20B tokens of mid-training’s data.
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.
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.
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
- 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
Architecture at this stageThe model as drawn: each query attends to the positions its indexer selects.
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
- GLM5-2602.15763v2.pdf, p. 6Tokens, Method, Data and settings, Outcome
- GLM5-2602.15763v2.pdf, p. 4Tokens, Context
- GLM5-2602.15763v2.pdf, p. 5Method, Outcome
- GLM5-2602.15763v2.pdf, p. 36Learning rate