Speculative Decoding is a parallel inference strategy where a lightweight draft model proposes k future tokens, and a large target model verifies them in a single forward pass. By accepting matching tokens and rejecting mismatches, it preserves the exact output distribution of the target model while dramatically reducing the number of sequential decoding steps.
Glossary
Speculative Decoding

What is Speculative Decoding?
A latency-reduction technique for autoregressive text generation that uses a small, fast draft model to predict multiple future tokens, which are then verified in parallel by a larger target model.
This technique exploits the observation that most next-token predictions are computationally cheap for a small model but expensive for a large one. The target model processes the draft tokens in parallel using a modified attention mask, accepting a prefix of correct predictions. Rejected tokens trigger a single correction step, ensuring zero quality degradation.
Key Characteristics of Speculative Decoding
Speculative decoding is a pivotal inference optimization technique that accelerates autoregressive text generation by leveraging a lightweight draft model to propose multiple future tokens, which are then verified in parallel by the primary target model.
Draft-Target Model Architecture
The core mechanism relies on a dual-model setup: a small, fast draft model (often 10-50x smaller) generates a sequence of K candidate tokens sequentially. The larger target model then processes these K tokens in a single parallel forward pass to verify their correctness against its own probability distribution. This replaces the standard sequential token-by-token generation of the large model, converting a memory-bandwidth-bound process into a compute-bound one.
Rejection Sampling Mechanism
Verification uses rejection sampling to guarantee the output distribution is identical to the target model's. The target model computes probabilities for each draft token. A token is accepted if its draft probability exceeds the target probability, or via a random acceptance criterion when the target probability is higher. Upon the first rejection, the target model generates a corrected token, and all subsequent draft tokens are discarded. This ensures zero statistical degradation in output quality.
Memory-Bandwidth Wall Mitigation
Standard autoregressive decoding is memory-bandwidth-bound: each token generation requires loading the full model weights from GPU HBM to SRAM, but performs minimal computation. Speculative decoding amortizes this cost by performing a single weight load for K tokens. This directly addresses the primary bottleneck in LLM inference, achieving speedups of 2x-3x in typical deployments without any model compression or quantization.
Draft Model Selection Criteria
Optimal draft models balance three factors:
- High acceptance rates: The draft must closely approximate the target's distribution. Models from the same family (e.g., a 0.5B parameter draft for a 7B target) work best.
- Low inference latency: The draft must generate K tokens faster than the target would generate 1 token.
- Speculative lookahead (K): Typical K values range from 3-8 tokens. Larger K increases potential speedup but reduces acceptance probability for later tokens.
Tree Attention for Multi-Candidate Speculation
Advanced implementations extend beyond linear speculation using tree attention. Instead of a single sequence of K tokens, the draft model proposes a tree of multiple candidate continuations at each step. The target model verifies all branches simultaneously using a specialized attention mask that prevents cross-branch contamination. This increases the expected number of accepted tokens per forward pass, pushing speedups beyond 3.5x.
KV Cache Management During Verification
Efficient KV cache handling is critical. During verification, the target model computes keys and values for all K draft tokens in parallel. Accepted tokens' KV entries are appended to the persistent cache. Rejected tokens' entries are discarded. PagedAttention implementations like vLLM integrate speculative decoding natively, managing memory at the block level to avoid fragmentation from the frequent cache extensions and truncations inherent in the rejection sampling process.
Frequently Asked Questions
Clear answers to common questions about how speculative decoding accelerates large language model inference by using a draft model to predict tokens that are verified in parallel.
Speculative decoding is a latency-reduction technique for autoregressive text generation where a small, fast draft model predicts multiple future tokens that are then verified in parallel by a larger, more accurate target model. The process works in three phases: first, the draft model efficiently generates a sequence of K candidate tokens. Next, the target model processes this entire candidate sequence in a single forward pass, computing the probability distribution for each position. Finally, a rejection sampling mechanism compares the draft tokens against the target model's distributions, accepting matching tokens and discarding divergences. Because the target model's single forward pass verifies multiple tokens simultaneously rather than generating them one-by-one, the wall-clock time per generated token drops significantly while maintaining the exact output distribution of the target model.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Speculative Decoding vs. Other Latency Reduction Techniques
A feature-level comparison of speculative decoding against other common inference acceleration methods for autoregressive text generation.
| Feature | Speculative Decoding | Quantization | Knowledge Distillation |
|---|---|---|---|
Primary Mechanism | Draft-then-verify parallelism using a small draft model | Reduced numerical precision of weights and activations | Training a compact student model to mimic a large teacher |
Output Distribution Preservation | |||
Requires Model Retraining | |||
Hardware-Agnostic Speedup | |||
Memory Footprint Reduction | |||
Typical Throughput Gain | 2x-3x | 2x-4x | 5x-10x |
Risk of Quality Degradation | None (lossless) | Low to moderate | Moderate to high |
Compatible with Continuous Batching |
Related Terms
Speculative decoding is part of a broader toolkit for minimizing inference latency. These related concepts form the foundation of high-performance model serving.
Draft Model
A small, fast language model that generates candidate token sequences for verification. The draft model must be significantly smaller than the target model—typically 10-100x fewer parameters—to provide a net speedup. Common choices include distilled models or shallow transformer variants trained on the same tokenizer. The draft model's predictions don't need to be perfectly accurate; even modest acceptance rates yield substantial wall-clock improvements because verification is parallelized.
Target Model
The large, high-quality model that verifies draft tokens in a single forward pass. Unlike autoregressive generation where each token requires a separate pass, the target model processes all draft tokens simultaneously using masked self-attention. It computes log probabilities for each position and compares them against the draft's predictions using a strict acceptance criterion—typically rejecting tokens where the target's probability diverges from the draft's.
Acceptance Rate
The fraction of draft tokens that survive verification by the target model. A higher acceptance rate directly correlates with greater speedup. Key factors influencing acceptance:
- Distributional alignment between draft and target models
- Temperature settings during sampling (lower temperatures increase acceptance)
- Draft length K—longer drafts risk more rejections Typical acceptance rates range from 60-85% in production deployments, yielding 2-3x latency reductions.
KV Cache Management
Speculative decoding introduces complexity to key-value cache handling. The draft model maintains its own KV cache during autoregressive generation, but upon verification, only the accepted tokens' KV entries are transferred to the target model's cache. Rejected tokens require cache rollback—discarding invalidated entries. Efficient implementations use tree-structured attention masks to verify multiple candidate sequences simultaneously without duplicating KV storage.
Medusa Heads
An alternative to using a separate draft model. Medusa attaches multiple lightweight prediction heads directly to the target model's final hidden states, enabling parallel prediction of several future tokens in a single forward pass. Unlike traditional speculative decoding, Medusa requires no separate draft model, simplifying deployment. The technique uses tree attention to verify multiple candidate continuations simultaneously, achieving comparable speedups with reduced architectural complexity.
Lookahead Decoding
A parallel decoding strategy that generates multiple tokens per step using Jacobi iteration rather than a draft model. The method exploits the observation that transformer outputs converge to fixed points under repeated application. By feeding model outputs back as inputs and extracting converged tokens, lookahead decoding achieves 1.5-2x speedups without training auxiliary models. It integrates naturally with existing sampling strategies and requires no architectural changes.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us