Skip to content

Speculative Decoding

A technique that accelerates the inference of large models: a small 'draft' model quickly proposes several next tokens, and a large model checks them in one pass.

How It Works

  1. The small model generates a hypothesis: 3–5 probable tokens.
  2. The large model processes them in a batch and checks if it agrees.
  3. Accepted tokens remain, rejected ones are discarded and regenerated.

The result is the same as with regular generation, but with fewer heavy passes of the large model.

Why It Is Beneficial

Large models are limited by the speed of reading weights from memory. Checking several tokens in one pass is faster than generating them one by one. The acceleration is several times faster without a loss in quality.

See Also

← All Terms