All lessons in AI Engineering: From Foundation Models to Evaluated Applications
Measure Speculative Decoding Correctly
Account for proposal and verification work and calculate when accepted tokens repay their cost.
90 minutes · Members lesson · preview
What you will learn
- Explain proposal and target verification without confusing speculation with an unverified model substitution.
- Calculate effective time per emitted token including rejected work and overhead.
- Design a comparison that distinguishes algorithmic distribution claims from measured implementation behavior.
Autoregressive generation repeatedly waits for another target-model step. Speculative decoding attempts to produce useful output with fewer sequential target invocations by proposing several tokens and verifying them. This phase tests when that extra proposal machinery repays its own cost.
Budget 90 minutes: 20 for the mechanism and arithmetic, 45 for a cycle-log analysis or bounded experiment, and 25 for task and timing checks. Use the same request manifest as the other serving lessons. A replay of invented cycle logs is an analysis exercise, not proof of a real engine speedup.