Skip to content
inference.academy

glossary/serving/speculative-decoding

Speculative decoding

also speculative sampling, draft model

Having a small draft model guess several tokens ahead, then checking all of them with the large model in one forward pass. Accepted tokens are free; the first rejected one is replaced by what the large model would have said, so the output distribution is unchanged. It works because a decode step is bound by reading the weights, so verifying five tokens costs about the same as producing one. The gain is the acceptance rate.


2 to 3x

Typical decode speedup reported at batch 1, where memory bandwidth is idle and the extra arithmetic is free.


See it happen


Related