GLM-5.3-FLASH

Two Tokens Per Step

chapter 5 of 8 · about 5 minutes

Text generation normally proceeds one token at a time. A token is a small unit of text, such as a word fragment, a short word, or punctuation. The model chooses one token, adds it to the context, then chooses the next. A forward pass is one run through all 45 layers of the network that produces the next-token distribution. Because each choice changes the context for the following choice, a 1,000-token answer usually requires 1,000 sequential forward passes. A graphics processor can perform much of the arithmetic inside one pass in parallel, but it cannot decide the second output token until the first token has joined the context. That sequential dependency is why generation can feel slow even when the model has substantial raw compute capacity. In the model name, GLM stands for General Language Model.

At the end of each pass, Flash assigns a probability to every item in its 154,880-token vocabulary. A vocabulary is the fixed set of token pieces the model can emit. Those probabilities answer one question only: which token should come next? They do not also settle the token after that, because the second choice depends on the first one. Normal decoding therefore runs the network again after every emitted token, even when the continuation is predictable. A sampling rule may choose the highest-probability item or draw from several plausible items, but either way the model must first evaluate the context that includes its previous choice. The ordinary next-token distribution is useful evidence about the immediate future, not a free prediction of an entire continuation.

Multi-token prediction (MTP) trains a small extra draft head to propose several future tokens at once. The draft head is a lightweight layer stored in the checkpoint, the saved model weights and configuration. The full network then verifies the proposed run in a single forward pass. If several proposed tokens pass verification, one expensive pass delivers several output tokens. If a proposal fails, the full model supplies the next token instead. With a correct speculative-decoding procedure, no unverified token reaches the output and the final distribution matches ordinary decoding. The main model evaluates the proposal at each proposed position, but acceptance proceeds from left to right. Once a draft token fails, later guesses were conditioned on the wrong continuation and cannot be kept. The useful quantity is therefore the accepted prefix, the consecutive run from the beginning that the main model approves. The diagram shows one verification round:

one forward pass, four tokens, here is the trick 1. draft head guessescheap, one small layercatguess 1satguess 2onguess 3theguess 42. big model checksall 4 in ONE passit asks: what would I have said after each token?3. keep the longest agreeing run:thecatsatonwrong guess thrown away3 tokens shipped for the priceof one full forward pass.
This arrangement is called speculative decoding. The draft head makes a cheap proposal, and the main model verifies it. The saving depends on accepted-prefix length: the number of consecutive draft tokens that survive verification. More accepted tokens mean fewer sequential forward passes. Rejected draft tokens do not become part of the answer. A longer proposal is not automatically better. It creates more cheap draft work, and its benefit disappears if the first disagreement arrives early. Serving systems choose a draft length that balances this overhead against the likely number of accepted tokens.

What does GLM train jointly?

GLM-5 trains its parameter-shared MTP component alongside the model, rather than attaching a completely separate draft model after training. The report measures an average accepted length of 2.76 tokens for GLM-5 against 2.55 for DeepSeek-V3.2 at the same four speculative steps, about an 8% difference. That is a result from the report's evaluation setup, not a promise for every prompt or server. Flash ships one draft layer in its configuration, num_nextn_predict_layers: 1, and the published serving recipe runs it with five speculative tokens. Choose one to four extra draft tokens below, press generate the sentence, then reroll to see how the accepted prefix changes. The game shows why an average is more useful than a single perfect run: some proposals stop early, while others move several tokens forward. It illustrates the control flow, not the report's benchmark result.

Compare speculative decoding

Choose a draft length, then click Generate to see accepted and rejected guesses.

draft head proposes:extra tokens per pass
Click Generate to compare forward passes with delivered tokens.

Speculative decoding still verifies every output token with the larger model. Rejected guesses require only a cheaper draft pass. The GLM-5 report measures acceptance lengths of2.76 versus 2.55 for DeepSeek-V3.2 with the same 4 speculative steps (Table 2). Flash includes one in-weights draft layer, and vLLM's recipe uses 5 speculative tokens. The goal is fewer costly forward passes without sending unverified text.

Speculation helps most when a graphics processing unit (GPU) has unused compute capacity, such as with one user or a small batch. In a large data-center batch, the verification pass may already be filled with tokens from other requests, leaving less unused capacity to exploit. MTP can reduce sequential steps for a lightly loaded request, while large batches can lower the cost per token at high utilization. The GLM-5 report credits MTP with raising neural processing unit (NPU) computation density on Chinese hardware (§5), meaning more useful tokens per memory cycle. The two benefits are different. Batching helps a server keep its processors busy across many requests. Speculation helps one request advance through its dependency chain in fewer target-model passes. A deployment can use both, but the gain from one does not guarantee the same gain from the other.
receipts, every claim in this chapter, checked 2026-08-31