Speculative Decoding

Speculative decoding is an inference acceleration technique that reduces the latency of large language models (LLMs) by using a smaller, faster “draft” model to propose candidate tokens, which are then verified in parallel by the larger “target” model. This approach significantly increases throughput without compromising the output distribution of the target model.

Core Mechanism

  • Drafting: A lightweight model generates a sequence of tokens in parallel.
  • Verification: The target model evaluates the draft tokens against its own probability distribution.
  • Acceptance: Accepted tokens are kept; rejected tokens trigger a re-generation step from the last accepted token.
  • Efficiency: Gains are realized when the draft model’s predictions align closely with the target model’s likely outputs.

References