Speculative Decoding Explained: a 30% Wrong Guesser Never Changes the Output

anbarth · x · 2026-10-26

Antje Barth walks through the core guarantee of speculative decoding in a code-backed GitHub post: even a deliberately bad guesser (30% of guesses thrown out) cannot change the target model's output — only speed differs. The key is Leviathan, Kalman & Matias' 2022 rule: with guesser distribution q and target distribution p, keep a sampled token with probability min(1, p/q), otherwise resample from p − q; that one subtraction makes the output exactly the target's for any guesser. Context: vLLM's docs (updated Oct 23) now list the lossy FLy Verification beside the exact checker, and SGLang exposes thresholds that accept more aggressively. Includes working code.

Related event: AWS Explains Why Speculative decoding Never Changes LLM Output(2 posts)→

Original post →

More from Infra

Infra channel →