What is speculative decoding in LLMs?
Speculative decoding can speed up a language model by verifying drafted proposals; the exact version leaves the target model's output distribution unchanged.
Speculative decoding is a technique that can speed up a language model's text generation by checking several proposals at once. In the classic form, a small model called the draft proposes a short sequence of tokens (fragments of text). The main model, called the target, evaluates all the proposals in one pass and keeps the ones it accepts; at the first rejection, the procedure generates a correction. Verification follows a sampling rule, which picks among alternatives according to their probabilities: in the exact version, answers follow the same probability distribution as the target running alone, up to numerical precision. That does not mean each sampled answer will be identical to the one from another run. The benefit depends on the draft's cost, how many proposals are accepted, and the available resources. The technique applies to the generation phase of inference (using a model to answer requests), not to training.
See also: InferenceAI inference applies a trained model to new data to produce predictions or responses; latency and cost depend on the workload and the infrastructure behind it.
Why quality does not change
In the method described by Chen and colleagues, the target scores proposed continuations in parallel. An acceptance and correction rule preserves the target's probabilities: a rejected proposal is not simply replaced by a fresh sample from the original distribution. The guarantee applies to that exact procedure, not to every implementation labeled speculative decoding.
The speedup is not automatic. If drafting costs too much or proposals are often discarded, verification may not pay for its overhead. Leviathan and colleagues report generation two to three times faster on T5-XXL than with the T5X implementation used in their study: an experimental result that may not hold for every service.
An enterprise example
A company runs a customer-support assistant and wants users to wait less while the assistant answers. It can compare the same target model with and without a draft, using representative requests and identical settings, and measure time to first token, generation speed after that, and cost per request, both under light load and at peak traffic. The entry on prefill and decode explains the difference between processing the request and generating the rest. Faster generation alone does not show that the initial wait got shorter too.
Why it matters for decision makers
When comparing vendors, ask which model drafts, which verifies, and what guarantee holds for the settings actually offered. Also ask for measured acceptance rates, latency, and cost on the expected workload, including the extra model's memory and operational overhead. Some approaches need no separate model: in one study, self-speculative decoding drafts by skipping some model layers and verifies with the full model. Multi-token prediction is another approach that can generate proposals internally. The choice depends on the available model and what its serving system supports.
Frequently asked questions
Related terms
- InferenceAI inference applies a trained model to new data to produce predictions or responses; latency and cost depend on the workload and the infrastructure behind it.
- Multi-token predictionA technique that adds multi-token prediction heads to an LLM, originally built for training and reused to speed up inference.
- Prefill, decode, TTFT and ITLPrefill and decode are the phases that process the prompt and generate the answer; TTFT and ITL measure the initial wait and the gaps between streamed outputs.
- SLMAn SLM is a compact language model, general-purpose or specialized, best chosen by weighing task quality, resource requirements, and deployment constraints.
- Diffusion language modelA model that generates text by refining an entire masked sequence in parallel, instead of producing it one token at a time.