Skip to content

Speculative Decoding Verification

Overview

Speculative Decoding Verification is a critical component of speculative generation responsible for verifying tokens generated by a draft model with a target model. It allows for faster inference without compromising quality.

Verification Process

  1. The draft model generates a sequence of \(k\) tokens.
  2. The target model calculates probabilities for each token.
  3. Tokens are accepted as long as their probability in the target model is higher than in the draft model.
  4. Generation stops and is corrected upon the first mismatch.

Acceptance Algorithm

For position \(i\), the token is accepted if:

\[ p_{target}(x_i) > p_{draft}(x_i) \]

Otherwise, the token is resampled with probability \(1 - p_{target}/p_{draft}\).

See Also

← All Terms