Speculative decoding

Speculative decoding is an inference acceleration technique for Autoregressive generation models that reduces latency by using a smaller Draft model to propose tokens, verified in parallel by a larger Target model.

Core Mechanism

  • Drafting: A computationally cheap model generates a sequence of candidate tokens.
  • Parallel Verification: The target model processes all candidates in a single forward pass, evaluating likelihoods simultaneously.
  • Acceptance/Rejection: Tokens are accepted if the target distribution matches sufficiently; rejection triggers sampling from the target at the first discrepancy.
  • Compute Trade-off: Minimizes total compute by leveraging the speed of the draft model against the accuracy of the target model.

Recent Developments: DeepSeek DSpark

References