AI CompendiumA public chart of the language
Home / Training & Inference / Speculative Decoding
Training & Inference

Speculative Decoding

A small model guesses ahead; the big model checks the guesses.

Definition

A decoding optimisation where a small draft model proposes several tokens and the large model verifies them in a single pass, accepting the ones it agrees with. The output distribution matches the large model while fewer expensive forward passes are needed.

It is one of the few inference optimisations that is close to free in quality terms, because verification guarantees the same distribution rather than approximating it. The win depends on how often the draft model guesses correctly, which is why it helps most on predictable text.

The quality story is what makes it attractive: verification preserves the target model’s output distribution rather than approximating it, so this is not a quality-for-speed trade like quantisation or a smaller model. The speed-up depends on how predictable the text is.

How people use it
Cutting latency without changing the model.
"Enable speculative decoding rather than dropping to a smaller model. Same answers, materially faster on the boring parts."
Worked example

Where it helps and where it does not

Enabling speculative decoding on two workloads.

On structured, formulaic output the draft model predicts well and the gain is large. On creative, high-entropy text the draft is rejected constantly and you have added overhead. Measure both before making it a global setting.

Sources
  • paperFast inference from Transformers via speculative decoding ↗Google (arXiv) · 2022

    A small draft model proposes several tokens and the large model verifies them in one pass, preserving the target distribution while cutting the number of expensive forward passes.

  • docsLatency optimisation ↗OpenAI API docs · 2026

    The four levers that matter: fewer output tokens, fewer requests, parallel independent work, and streaming. Also defines throughput in tokens per second.

Related terms