What Is Speculative Decoding

Speculative decoding is a way to generate multiple tokens per expensive decode step instead of just one, by letting a small, cheap "draft" model guess ahead and having the large model check its guesses in a single batched pass. Every earlier entry in this series established the same bottleneck: decode generates exactly one token at a time, and each of those steps is memory-bandwidth-bound because it has to re-read the model's weights and the growing KV cache from scratch. Speculative decoding doesn't shrink what has to be read — that's what quantization and grouped-query attention were for — instead it changes the math so one expensive read can verify several tokens' worth of work at once, which is a fundamentally different lever on the same throughput problem.

The trick works because verifying a guess is cheap relative to generating it, and checking many guesses at once is barely more expensive than checking one. A small draft model — trained on the same kind of data, often a distilled or scaled-down version of the target model — proposes a short run of several candidate next tokens, generated quickly because it's small. The large model then processes that entire candidate sequence in one parallel pass, exactly like the compute-heavy prefill phase covered earlier, checking whether each guessed token matches what the large model itself would have produced. Any tokens that match are accepted immediately at essentially the cost of one large-model pass; the moment a guess is wrong, everything after that point is discarded and the large model's own correct token is used instead, then drafting resumes from there.

Speculative Decoding — Guess Fast, Verify Once a small draft model proposes several tokens; the large model checks them all in one pass Small draft model guesses 4 tokens fast g1 g2 g3 g4 Large model verifies all 4 in parallel accept accept correct discard Same output distribution as the large model alone multiple tokens per big-model pass Verification is parallel and cheap; only rejected guesses cost a redo, so throughput rises without changing outputs.
Speculative Decoding: Small Model Guesses, Large Model Verifies in Bulk A diagram showing a small draft model proposing several candidate tokens sequentially and cheaply, then the large target model verifying all of them in one parallel batched pass, accepting matched tokens and discarding tokens after the first mismatch. SPECULATIVE DECODING: GUESS CHEAPLY, VERIFY IN ONE BATCH STEP 1: SMALL DRAFT MODEL GUESSES AHEAD (cheap, sequential) guess 1 guess 2 guess 3 guess 4 Small model is fast enough that generating 4 guesses costs far less than one large-model decode step STEP 2: LARGE MODEL VERIFIES ALL GUESSES IN ONE PARALLEL PASS match match mismatch discarded Guesses 1-2 accepted for free; guess 3 replaced with the large model's real token; guess 4 thrown away NET RESULT 3 real tokens produced (2 accepted + 1 corrected) for roughly the memory cost of ONE large-model decode step Output is mathematically identical to always running the large model alone — nothing is approximated

The crucial guarantee is that speculative decoding never changes what the large model would have said — only how cheaply it gets said. Because every accepted token is exactly what the large model's own verification pass confirmed, and any wrong guess is replaced with the large model's actual correct token, the final output is identical to running the large model alone, token by token, the slow way. This is what separates speculative decoding from quantization or attention-sharing: those techniques trade a small amount of accuracy for memory savings, while speculative decoding trades none — it's a pure throughput optimization that works by restructuring how the expensive memory reads are scheduled, not by reading less or reading approximately.

ApproachWhat It ReducesAccuracy CostHow It Helps Decode
QuantizationBytes per weight/cache entrySmall, tunableLess data moved per read
Grouped/Multi-Query AttentionNumber of separate KV sets storedSmall, tunableSmaller cache to read per step
Speculative DecodingNumber of large-model passes neededNone — output is exactMore tokens produced per expensive pass
Decode needs the next token(s) in the sequence
Small draft model quickly proposes several candidate next tokens
Large model processes all candidates in one parallel batched pass
Compare each candidate against what the large model itself would produce
Accept every candidate up to the first mismatch; use the large model's token there instead
Discard any candidates proposed after that first mismatch
Multiple verified tokens appended to the sequence for the cost of one large-model pass

How much this actually speeds things up depends entirely on how often the draft model guesses right, which is why draft-model choice is its own engineering problem. Easy, predictable continuations — common phrases, boilerplate code, repeated structure — let the draft model guess long correct runs, multiplying decode throughput several times over; unpredictable or highly technical continuations cause frequent mismatches, shrinking the benefit toward zero extra cost versus running the large model alone. Because the technique adds compute (running a second small model) in exchange for saving memory-bandwidth-bound decode steps, it's a natural complement to everything else in this series: an accelerator with ample compute headroom but a memory-bandwidth ceiling — exactly the profile decode creates — is precisely the situation where trading a little extra compute for fewer expensive memory-bound steps pays off.

Take what is speculative decoding further

Ask the copilot about this term, or have our engineers assess it against your process.