Speculative Execution
Definition
Speculative Execution — a method for accelerating text generation in which a small fast model (drafter) generates several hypothetical tokens, and a larger model (verifier) checks them in parallel. Accepted tokens are output without re-generation.
Process
- Drafter generates K hypothetical tokens.
- Verifier computes probabilities for all K tokens in parallel.
- Tokens matching the verifier distribution are accepted.
- Generation continues from the first mismatch.
Comparison
| Parameter | Normal Generation | Speculative Execution |
|---|---|---|
| Speed | 1 token per step | Up to K tokens per step |
| Quality | Benchmark | Identical to benchmark |
| Computational Costs | High | Higher, but faster |