Graph
Speculative Decoding

⚡Speculative Decoding

NEW

Also known as: Draft-and-Verify Decoding, Speculative Sampling

An acceleration technique where a small draft model proposes tokens that a larger target model quickly verifies or rejects.

DESCRIPTION

Speculative decoding speeds LLM generation by using a fast draft model to propose multiple tokens, then verifying them with the large model in fewer forward passes. Accepted tokens are committed; rejected ones trigger fallback steps. This reduces latency without changing the target model’s output distribution when implemented correctly. It benefits scenarios with stringent latency or cost constraints. Practical implementations must balance draft accuracy, batch sizes, and verification overhead.

ALTERNATIVE DEFINITIONS

arXiv

We introduce speculative sampling, which accelerates generation by proposing tokens using a smaller model and verifying them with the target model.

Defines the draft-and-verify algorithmic pattern.

Source

NVIDIA Developer

Speculative decoding uses a lightweight draft model to generate candidate tokens that are quickly validated by the main model, reducing end-to-end latency.

Focuses on latency reduction and practical deployment.

Source

LLM Inference Caching Medusa Beam Search Top-k Sampling Nucleus Sampling KV Cache Latency Optimization Distillation

COMPETING TERMS

Medusa Decoding Parallel Decoding

RELATIONS

KNOWLEDGE AREAS

AI Data Engineering Infrastructure

TARGET AUDIENCE

AI Engineer MLOps Engineer Cloud Architect Software Developer

EXTERNAL SOURCES

  • Wikipedia - Language model#Decoding
  • arXiv - Speculative sampling paper
  • NVIDIA - Engineering guide and benchmarks

TOP QUESTIONS

When should I use Speculative Decoding?

Use it when latency or throughput constraints exist and a smaller, accurate draft model is available.

Category: Relevancy

Does Speculative Decoding change output quality?

When implemented with proper verification, it preserves the target model’s output distribution.

Category: Misunderstanding

What draft model works best for Speculative Decoding?

A distilled or narrower model closely matching the target’s distribution maximizes acceptance rates.

Category: Requirements

How much speedup can Speculative Decoding provide?

Reported speedups often range from 1.5× to 3×, depending on acceptance rates and hardware.

Category: Example

What are risks of Speculative Decoding?

Low draft accuracy hurts acceptance, negating gains; implementation complexity can introduce bugs.

Category: Risk

Can Speculative Decoding be combined with batching?

Yes, batching across requests and speculative steps can further improve throughput.

Category: BestPractice

How do you tune acceptance rate in Speculative Decoding?

Adjust draft depth, temperature, and alignment to the target; monitor verification rejects.

Category: Management

Does Speculative Decoding require model changes?

No changes to the target model; it’s an inference-time orchestration method.

Category: Misunderstanding

Is Speculative Decoding useful for small models?

Benefits diminish when the target model is already fast; overhead can dominate.

Category: Opinion