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
- The draft model generates a sequence of \(k\) tokens.
- The target model calculates probabilities for each token.
- Tokens are accepted as long as their probability in the target model is higher than in the draft model.
- 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}\).