Speculative decoding is a lossless acceleration algorithm for large language model inference. It leverages a lightweight draft model to generate a sequence of k candidate tokens quickly. The larger target model then processes these candidates in a single parallel forward pass, evaluating their correctness against its own probability distribution. This shifts the bottleneck from sequential memory bandwidth to parallel compute, achieving a 2x–3x speedup in tokens-per-second without altering the target model's output distribution.
Glossary
Speculative Decoding

What is Speculative Decoding?
Speculative decoding is an inference optimization technique that accelerates autoregressive text generation from a large target model by using a smaller, faster draft model to propose multiple candidate tokens, which are then verified in parallel by the target model.
The core mechanism relies on rejection sampling to guarantee statistical equivalence to the target model's standard autoregressive output. If a draft token's probability diverges from the target's, it is rejected, and the target model resamples from an adjusted distribution. This ensures zero quality degradation. The technique is particularly effective for memory-bound workloads on modern accelerators, where the cost of running the draft model is negligible compared to the latency saved by parallel verification.
Key Characteristics of Speculative Decoding
Speculative decoding is a lossless acceleration technique that leverages a lightweight draft model to propose multiple candidate tokens, which a larger target model then verifies in parallel. This approach maintains identical output distributions while dramatically reducing latency.
Draft-Target Model Architecture
Speculative decoding relies on a dual-model setup where a small, fast draft model (often 10-100x smaller than the target) generates k candidate tokens autoregressively. The large target model then processes these candidates in a single parallel forward pass, accepting or rejecting each token based on its own probability distribution. This shifts the workload from sequential to parallel computation, exploiting the fact that verifying multiple tokens is nearly as fast as generating one on modern accelerators.
Rejection Sampling for Lossless Quality
The verification step uses modified rejection sampling to guarantee that the output distribution exactly matches what the target model would have produced on its own. For each draft token, the target computes its probability and compares it to the draft's probability. If the draft token is too improbable under the target distribution, it is rejected and the target resamples from an adjusted distribution. This ensures zero degradation in output quality while still achieving speedups.
Wall-Clock Speedup Factors
Practical speedups range from 2x to 3x in typical deployments, with theoretical maximums determined by the acceptance rate of the draft model. Key factors influencing performance include:
- Draft model alignment: Higher agreement between draft and target distributions yields higher acceptance rates
- Draft latency ratio: The draft must generate tokens significantly faster than the target's per-token latency
- Speculation length (k): More candidate tokens increase potential speedup but risk wasted computation on rejected sequences
Tree Attention for Multi-Candidate Verification
Advanced implementations use tree-structured speculation where the draft model proposes multiple branching sequences simultaneously. The target model verifies all branches in parallel using a specialized tree attention mask that prevents cross-branch contamination. This increases the expected acceptance length by exploring alternative token paths, particularly useful at decision points where the draft model has low confidence.
Self-Speculative Decoding Variants
Some architectures eliminate the need for a separate draft model by skipping layers of the target model itself. Early layers act as the draft, generating candidates using a subset of the full computation, while all layers participate in verification. This approach simplifies deployment by removing the need to maintain and align two distinct models, though it typically yields more modest speedups than a dedicated draft model.
Integration with Continuous Batching
Speculative decoding composes effectively with continuous batching in production serving systems. While one request undergoes draft generation, other requests can utilize the GPU for verification or their own draft phases. This overlapping of draft latency with useful computation from other sequences maximizes overall throughput. Serving frameworks like vLLM have begun incorporating speculative decoding into their scheduling algorithms.
Frequently Asked Questions
Clear, technically precise answers to the most common questions about speculative decoding, the draft-target inference acceleration paradigm.
Speculative decoding is an inference acceleration technique that uses a smaller, faster draft model to generate multiple candidate tokens autoregressively, which are then verified in a single parallel forward pass by the larger, more accurate target model. The target model computes the probability distribution for each candidate token position simultaneously. If a candidate token matches the target model's distribution (typically via rejection sampling), it is accepted; if rejected, the target model's own token is used instead, and the process repeats. This converts the inherently sequential token-by-token generation into a parallelizable verification step, achieving 2-3x wall-clock speedups without altering the target model's output distribution.
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.
Related Terms
Speculative decoding is one of several critical techniques for reducing the latency of large language model inference. These related concepts form the broader optimization toolkit.
Draft Model
A lightweight, low-latency language model that generates candidate token sequences rapidly. In speculative decoding, the draft model proposes multiple tokens autoregressively, which are then verified in parallel by the larger target model. The draft model is typically 10-100x smaller than the target model, often using the same tokenizer.
- Key property: High acceptance rate by the target model
- Common choices: A shallower version of the target model or a distilled n-gram model
- Trade-off: Faster proposals vs. lower acceptance rates
KV Cache
A memory buffer that stores the computed Key and Value tensors from all previous tokens during autoregressive generation. Without caching, each new token would require recomputing attention over the entire sequence. Speculative decoding leverages the KV cache to verify multiple draft tokens in a single forward pass.
- Eliminates quadratic recomputation of attention
- Memory footprint grows linearly with sequence length
- PagedAttention optimizes KV cache memory management
Continuous Batching
A serving technique that dynamically appends new generation requests to a running batch rather than waiting for all sequences in the batch to complete. This maximizes GPU utilization by filling idle compute capacity. When combined with speculative decoding, continuous batching ensures the verifier model's parallel forward passes are efficiently packed.
- Eliminates static batch granularity
- Reduces Time To First Token (TTFT) under load
- Implemented in serving engines like vLLM
Target Model
The large, high-quality language model that performs verification in speculative decoding. It evaluates all draft tokens in a single parallel forward pass, accepting those that match its own distribution and rejecting the first divergent token. The target model guarantees that the final output distribution is identical to standard autoregressive decoding.
- No approximation in output quality
- Forward pass processes multiple draft tokens simultaneously
- Typically a dense transformer with full precision weights
Acceptance Rate
The fraction of draft tokens that the target model accepts during verification. A higher acceptance rate directly translates to greater speedup. Acceptance rates depend on the alignment between the draft and target model distributions.
- Typical range: 70-90% for well-matched draft models
- Rejection mechanism: The first divergent token is resampled from the target's corrected distribution
- Tree-based verification can increase acceptance by exploring multiple candidate sequences
Medusa Heads
An alternative to using a separate draft model. Medusa attaches multiple lightweight prediction heads directly to the frozen target model, each predicting a token at a future position. This eliminates the need for a second model while enabling parallel candidate generation.
- No separate draft model required
- Heads are fine-tuned while the base model remains frozen
- Can be combined with tree attention for multi-candidate verification

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