IN THIS BREAKDOWN · 10 SECTIONS
You can read 22% of this breakdown.
The paper in one minute
A large language model generates text one token at a time, and for big models at small batch sizes each step mostly waits on reading weights from memory. Scoring several tokens in one pass costs about as much as generating one. DeepMind's speculative sampling uses that slack: a small draft model writes a short continuation of K tokens, the large target model scores all K positions in a single call, and a rejection-sampling rule decides how many draft tokens to keep. The authors note that this was developed independently of, and at the same time as, Leviathan et al.'s speculative decoding at Google; the core algorithm is the same.
The acceptance rule keeps each draft token with probability min(1, q/p), where q is the target's probability for that token and p the draft's. At the first rejection, a replacement is sampled from the normalized positive part of q − p and the rest of the draft is discarded. If all K survive, the target's last set of logits gives one more token for free. The output then follows the target model's distribution exactly, up to numerical precision, for nucleus sampling, top-k and temperature as well as greedy decoding.
This paper's contribution is making it work for a large model served across many chips. The obvious draft, a smaller model in the same family, is fastest on fewer chips than the target; a 7B model is fastest on 4 TPU v4s and gets slower on 16. So DeepMind trained a wide, shallow draft: 4 billion parameters in only 8 layers, which runs at 1.8 ms per token on the same 16 chips that serve Chinchilla 70B at 14.1 ms per token. With four draft tokens per step, decoding was 1.9 to 2.5 times faster, and the samples scored the same on summarization and code benchmarks.
Research notes: the problem, approach and results
faster decoding on HumanEval (100-shot) for Chinchilla 70B, 14.1 to 5.73 ms per token (Table 1)
per token for the 4B, 8-layer draft model on the same 16 TPU v4s (Results)
draft length that minimized latency on XSum with nucleus sampling; larger K plateaued and raised variance (Figure 1)
Large models generate one token per forward pass, and each pass is limited by memory bandwidth and, when the model is sharded across chips, by communication. For a 70B model on 16 TPU v4s, that floor was 14.1 ms per token at batch size 1.
Let a cheap draft model propose K tokens, score them all with the target in one call, and accept them left to right with a modified rejection sampling rule that preserves the target's distribution. Make the draft a wide, shallow 4B model so it samples quickly on the same distributed hardware the target uses.
With Chinchilla 70B and a 4B, 8-layer draft (1.8 ms per token), K = 4 cut mean token time from 14.1 ms to 7.52 ms on XSum with nucleus sampling, 7.00 ms with greedy decoding, and 5.73 ms on HumanEval (2.46x), with benchmark scores unchanged within noise.
Why it matters to an FDE
Speculative sampling is one of the few latency optimizations that cannot change answers, and this paper adds two practical lessons that the original speculative decoding paper does not.
Pick the draft for the serving topology. A small model in the same family can be a poor draft if the target runs across many GPUs: the small model is fastest on fewer devices and wastes the rest. A wider model with fewer layers needs less communication per step. When a customer serves a large model with tensor parallelism, ask whether the draft was chosen for that layout.
More draft tokens is not free. Latency per token plateaued or got worse past three or four draft tokens, and the spread of time per response grew with K. For products with a P90 or P99 latency target, choose K for the tail, not only the mean.
Gains depend on the content. Code (HumanEval) sped up more than summarization, because code has predictable runs a draft can guess. Measure acceptance on the customer's real traffic before promising a speedup.
Understand the mechanism. Try it on a real problem.
Unlock this breakdown and 290 more papers.
Premium opens every paper in full, plus every answer, concept, course and guide on the site. One payment for six months of access.
6 months · One payment · No auto-renewal
- ◇1 architecture diagram
- </>1 runnable code experiment
- ▦2 results tables
- ?5 interview questions with answers
- 03Key takeaways
Why scoring is cheap, the acceptance rule, draft design, choosing K and two misreadings
Free account - 04How it works
The algorithm, why parallel scoring is cheap at scale, the acceptance rule and the draft model
Premium - 05The numbers that matter
Table 1, the K trade-off and the memory-bandwidth claim
Premium - 06Try it yourself
Recheck Table 1, infer acceptance from timings, find the best K, and test the bandwidth claim
Premium - 07Where it breaks
Batch size, draft training cost, domain dependence, one target model and slips
Premium - 08Using it on a deployment
Choosing the draft and K, measuring acceptance, and protecting tail latency
Premium - 09Interview angles
Five questions this paper prepares you for, with answer hints
Premium - 10Read next
Where to go from here on this site
Premium
