Home Knowledge Base Speculative Decoding

Speculative Decoding is an LLM inference acceleration technique that uses a small draft model to propose multiple tokens simultaneously, verified in parallel by the target model — achieving 2-4x speedup without changing model quality.

The Core Problem

How Speculative Decoding Works

1. Draft Phase: A small model (3B, 7B) generates K candidate tokens autoregressively. 2. Verify Phase: The large target model processes all K tokens in ONE forward pass (parallel). 3. Accept/Reject: Accept tokens where target model agrees with draft; reject the first disagreement. 4. Correction: Sample from the corrected distribution at the first rejection point. 5. Result: On average, 3-4 tokens accepted per target model forward pass.

Why It Works

Variants

Typical Speedups

TaskSpeedup
Code generation2.5-4x
Mathematical reasoning2-3x
Open-ended chat1.5-2.5x

Speculative decoding is a near-free inference speedup — widely adopted in production LLM serving systems including vLLM, TGI, and Google's production inference.

speculative decodingtoken draftinference accelerationdraft modelspeculative sampling

Explore 500+ Semiconductor & AI Topics

From EUV lithography to CUDA optimization — search the full knowledge base or chat with our AI assistant.