Multi-token prediction (MTP): learning to look further ahead
Each column learns to predict one token. Would asking it to look one step further change what it learns, or how fast it writes?
In Why the last column predicts, one run trained on all of “the hare sat on the grass” at once. Every column predicted the token after it.
One answer per column
Each column only ever has to see one step ahead. “hare” learns that “sat” comes next, but nothing asks whether it can see “on the grass” coming.
Good text is limited, and every run through the model costs time. Could the same run teach more?
Ask for the token after next
Keep the model as it is, and give its output a second head. The first still predicts the next token; the second predicts the one after that.
The same run now gives nine answers instead of five, and each column has to plan a little further. This is multi-token prediction.
It pays off. A 13-billion-parameter model trained this way solved 12% more of the HumanEval coding problems, and 17% more of MBPP’s, than one trained on the next token alone.
Tell the second guess what came next
A head that predicts two ahead also has to guess the token in between. If “hare” might be followed by “sat” or “ran”, its guess for two ahead must cover both.
DeepSeek-V3 gives that second guess the real next word. A small extra module combines the column’s final vector with the embedding of the token that actually came next, runs one more transformer block, and predicts with the same output head.
In training, the real next word is always there in the text, so the extra module never has to guess it.
Use the guess to write faster
After training, the extra module can be dropped. But it can also help the model write.
When it writes, every pass adds one token: the last column predicts it, we append it, and run again. With the module kept, each pass can also guess the token after that. Append the guess too.
On the next pass, the column before the guess predicts what belongs there anyway. If it agrees, the guess stays.
A right guess gives two tokens for one pass. A wrong one is simply replaced. DeepSeek-V3’s guesses were right 85–90% of the time, so it wrote about 1.8 times as fast.
Guessing ahead and checking is a technique of its own: speculative decoding.
Sources and assumptions
- Better & Faster Large Language Models via Multi-token Prediction, Gloeckle and colleagues at Meta, 2024: several independent output heads on a shared model, each predicting a further token. Their 13B model solved 12% more HumanEval and 17% more MBPP problems than a comparable next-token model, and 4-token models were up to 3 times faster at inference.
- DeepSeek-V3 report, §2.2 and §5.4.3: sequential modules that keep the causal chain, each combining the previous depth’s representation with the embedding of the next token through a projection and one transformer block, with the embedding table and output head shared. Depth 1; loss weight 0.3 for the first 10T tokens and 0.1 for the remaining 4.8T. The modules can be discarded at inference; used for speculative decoding, the second token was accepted 85–90% of the time, for 1.8 times the tokens per second.
- An earlier form of predicting several future tokens appeared in ProphetNet (Qi and colleagues, 2020) for sequence-to-sequence models.
The module figure follows DeepSeek-V3’s equations: RMSNorm on both inputs, concatenation, then a learned projection back to the model’s width; its cell colours are illustrative. The answers figures count training targets for one sentence; the last column has no next token, and the last two none for two ahead. The writing figure follows the scheme above with illustrative guesses, one of them wrong: every pass writes one token and guesses the next, and a guess the next pass agrees with is kept. With guesses right a share p of the time, that averages 1 + p tokens per pass; real speed-ups are a little lower because checking and guessing add work.