Speculative decoding speedup

Inference · Formula · Not yet linked from a lesson

E[tokens per step]=1−αk+11−α\mathbb{E}[\text{tokens per step}] = \frac{1 - \alpha^{k+1}}{1 - \alpha}

A small draft model proposes k tokens and the large model verifies them all in one pass. The expected yield depends almost entirely on the acceptance rate, so a draft that agrees often beats a draft that is merely fast.

Symbols

α\alpha
The probability the target model accepts a drafted token.
kk
How many tokens the draft model proposes per step.
Esc
↑↓ navigate↵ open? shortcuts

Keyboard shortcuts

Press Esc to close

Anywhere

⌘K
Search and commands
/
Search
?
This sheet
Esc
Close

Reading a lesson

J
Next lesson
K
Previous lesson
B
Bookmark