the.ai

Inference / Decoding

verified

Speculative Decoding

Generating one token at a time wastes most of an accelerator: the model is enormous, the work per token is tiny, and the hardware sits idle waiting on memory. Speculative decoding has a small fast model guess several tokens ahead, then checks all the guesses in a single pass of the big one. Right guesses are kept, the first wrong one is corrected, and the run moves several tokens for the price of one.

Viz primitive · budget-splitdraft-tokens = 4

draft-tokens holds 50% of the budget; rest holds the remaining 50%.

Share of a step spent drafting against verifying. Drag the draft length to watch verification amortise over more tokens until the acceptance rate stops keeping up.

4

Reviewed by opendroid · 2026-08-04

  • arXiv:2211.17192 — Fast Inference from Transformers via Speculative Decoding
  • arXiv:2302.01318 — Accelerating Large Language Model Decoding with Speculative Sampling