Speculative decode is an inferencing optimization that was mentioned a few times at #GTC26. I'd heard of it but didn't know how it worked, so I spent some time figuring it out. Some notes (and toy code that illustrates its benefits!) are here: https://glennklockwood.com/garden/speculative-decode

#AI

speculative decode

Speculative decode is an inferencing optimization where you use a small draft model to generate a sequence of output tokens, then run those draft output tokens through a full-sized model as a single multi-token decode to determine whether the draft model’s output tokens are correct.

Glenn's Digital Garden
Speculative Speculative Decoding

Autoregressive decoding is bottlenecked by its sequential nature. Speculative decoding has become a standard way to accelerate inference by using a fast draft model to predict upcoming tokens from a slower target model, and then verifying them in parallel with a single target model forward pass. However, speculative decoding itself relies on a sequential dependence between speculation and verification. We introduce speculative speculative decoding (SSD) to parallelize these operations. While a verification is ongoing, the draft model predicts likely verification outcomes and prepares speculations pre-emptively for them. If the actual verification outcome is then in the predicted set, a speculation can be returned immediately, eliminating drafting overhead entirely. We identify three key challenges presented by speculative speculative decoding, and suggest principled methods to solve each. The result is Saguaro, an optimized SSD algorithm. Our implementation is up to 2x faster than optimized speculative decoding baselines and up to 5x faster than autoregressive decoding with open source inference engines.

arXiv.org
@mattpd Man it’s just turtles all the way down
@glennklockwood BTW, these findings look interesting: https://specdecode-bench.github.io/
Speculative Decoding: Performance or Illusion? | SpecDecode-Bench

The first systematic study of speculative decoding on a production-grade inference engine (vLLM), covering multiple SD variants across diverse workloads, model scales, and batch sizes.