AI engineering glossary · Inference serving optimisation

What is speculative decoding?

Speculative decoding (also called Speculative sampling): A way to speed up text generation without changing the output distribution. A small, fast draft model proposes several next tokens and the large model checks them all in one pass, keeping the correct ones. When the draft is often right, several tokens are produced for the price of one large-model step.

Level: intermediateTopic: Inference serving optimisation

Speculative decoding: an example

A 1B draft model proposes 4 tokens; the 70B model accepts 3 of them in one verification pass, so 4 tokens emerge from a single big-model step.

Related terms

More Inference serving optimisation terms

Where you learn it

Speculative decoding is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.