No items found.
Start Building
Technical

Speculative Decoding Explained: Draft Models and 2-3x Faster Inference

A small draft model guesses ahead, the big model checks its work in one pass. Here is why that is lossless, what makes it fast, and how to set it up in vLLM.

Author photo
packet.ai Team
August 6, 2026

Speculative decoding speeds up text generation by letting a smaller model guess a few tokens ahead while the larger model verifies them in one pass. If the guesses are accepted, generation moves forward several tokens at once instead of one at a time. The important part: the final output doesn't change. vLLM supports several ways to generate those guesses, from a separate draft model to n-gram matching to EAGLE-style feature-level drafting.

Key takeaways

  • Speculative decoding is lossless: the target model verifies every draft token, and the final output matches what it would have generated alone, up to hardware floating-point precision
  • The speedup comes from turning many small, memory-bound decode steps into fewer, larger, more GPU-efficient verification passes, not from skipping computation
  • How well it works depends entirely on the draft model's acceptance rate: how often the target model agrees with what the draft proposed. A fast draft model that gets rejected constantly saves nothing
  • EAGLE-style methods draft at the feature level (before the token is chosen) rather than the token level, which is why they reach meaningfully higher acceptance rates than older approaches like Medusa
  • vLLM configures this through a single speculative_config dictionary, with a method key selecting between a standalone draft model, n-gram matching, or EAGLE-style drafting

"Speculative decoding" describes a family of techniques, not one specific method, and the differences between them matter more than the shared name suggests. This post covers speculative decoding LLM inference from first principles: the core draft-and-verify mechanism, why it's mathematically lossless rather than a quality tradeoff, how the major variants (EAGLE, Medusa, n-gram, lookahead) actually differ from each other, and how to configure it in vLLM. This is part of the packet.ai LLM serving frameworks cluster; for the memory-management side of vLLM's internals, see the vLLM Docker deployment guide, and for the scheduling side, see Continuous Batching Explained.

How Speculative Decoding Actually Works

Autoregressive generation is memory-bound, not compute-bound: producing one token means one full forward pass through the entire model, and each pass mostly waits on memory bandwidth rather than saturating GPU compute. Producing 100 tokens means doing this 100 times, sequentially, each one dependent on the last. The GPU spends most of that time under-utilized.

Speculative decoding restructures this. Instead of generating one token per forward pass, it runs a loop: a small draft model proposes several tokens ahead (commonly 3-8), then the large target model checks all of those proposed tokens in a single forward pass, the same cost as generating just one token normally. The target model accepts the longest prefix of draft tokens it agrees with, then generates one further token itself to keep the sequence moving forward. Whatever the draft model got wrong is simply discarded, and the process repeats from the point of disagreement.

The technique traces to Stern et al. (2018), who first proposed the draft-then-verify pattern, later formalized into speculative sampling by Leviathan et al. (2023) and Chen et al. (2023) at DeepMind. The core guarantee those papers established, and the reason this isn't a quality-for-speed tradeoff: the target model verifies every draft token against its own probability distribution, and the sampling procedure is constructed so the output distribution is provably identical to sampling from the target model alone.

Speculative decoding propose and verify cycle The draft model proposes several tokens ahead. The target model verifies all of them in one pass. Accepted tokens continue the sequence; the first rejected token is discarded and the target model generates in its place, then the cycle repeats from there. Draft model proposes guesses several tokens ahead Target model verifies checks all guesses in one pass Hel lo my nam xyz accepted accepted accepted rejected not checked Target generates in its place then the cycle repeats from here

In this example, the draft model proposes five tokens continuing "Hel-lo-my-nam-xyz." The target model checks all five in that single pass: it agrees with the first three, disagrees at the fourth, and never bothers checking the fifth since everything after a rejection gets discarded anyway. The target model then generates the correct token in that fourth position itself, and the draft model starts proposing again from there. Three tokens' worth of progress came from one expensive forward pass instead of three.

2-3x

Typical speedup with a well-matched draft model

2018

Year the draft-then-verify pattern was first proposed

0.60

Typical Medusa acceptance rate on general tasks

~0.85

EAGLE-3 acceptance rate on coding and instruction tasks

Why Acceptance Rate Is the Number That Actually Matters

The entire speedup depends on one thing: how often the target model agrees with what the draft model proposed. If the draft and target models make similar predictions most of the time, the target model accepts long runs of draft tokens per verification pass, and each expensive forward pass produces many tokens' worth of progress. If the draft model's guesses are frequently wrong, the target model accepts only one or two tokens before rejecting the rest, and the draft model's extra compute was wasted.

This is why "just pick any smaller model as the draft" is the wrong instinct. A draft model that's fast but poorly aligned with the target model's behavior can end up slower than not using speculative decoding at all, since you're now paying for both the draft model's forward passes and a target model verification pass that only accepts a token or two each time. The draft model needs to actually predict what the target model would say, not just be small.

⚡ Note

Acceptance rate also varies by task, not just by method. The same draft/target pair can show a high acceptance rate on code completion, where continuations are more predictable, and a much lower one on open-ended creative writing. Benchmark on traffic that resembles what you'll actually run, not a generic prompt set.

EAGLE, Medusa, and the Other Ways to Generate Draft Tokens

The original formulation of speculative decoding used a genuinely separate, smaller language model as the draft model, an actual second model with its own weights, run independently. That still works, but most of the practical innovation since 2023 has been in finding faster or more accurate ways to generate draft tokens without the overhead of a full second model.

EAGLE (and EAGLE-2, EAGLE-3). Rather than drafting at the token level, EAGLE drafts at the feature level, autoregressing on the target model's internal hidden states before they're converted into token probabilities. Features carry more information than a token ID alone, which is why this approach reaches meaningfully higher acceptance rates than earlier methods. EAGLE-2 adds a dynamic draft tree that adjusts its shape using the draft model's own confidence scores. EAGLE-3 goes further, fusing hidden states from multiple layers of the target model rather than just the last one, which pushes acceptance rates to roughly 0.80-0.88 on coding and instruction-following tasks in published benchmarks, meaningfully above EAGLE-2 on the same hardware.

Medusa. Adds multiple lightweight MLP heads on top of the target model's last hidden state, each head trained to predict a different future token position directly. It's a simpler design than EAGLE's feature-level autoregression, doesn't require its own separate forward pass structure, but tends to land around 0.6 acceptance on general tasks, noticeably behind EAGLE-3.

N-gram speculative decoding (prompt lookup). No draft model at all. The engine matches recent output against n-grams already seen in the prompt or generation so far, and speculates that a previously-seen sequence will repeat. This works surprisingly well for tasks with a lot of verbatim repetition, summarization, code editing, retrieval-heavy generation, and costs essentially nothing to run since there's no second model.

Lookahead decoding. Uses Jacobi-iteration-style parallel decoding combined with n-gram caching, also without a separate draft model. Generally shows a lower acceptance rate than EAGLE or Medusa in published comparisons, but like n-gram matching, it avoids the cost and complexity of training or hosting a dedicated draft model.

The practical pattern: EAGLE-3 is the strongest general-purpose choice when you can use a compatible draft checkpoint, Medusa is simpler to reason about but leaves acceptance rate on the table, and n-gram or lookahead approaches are worth trying first if your workload has heavy repetition and you'd rather not manage a second model at all.

Configuring vLLM Speculative Decoding

vLLM speculative decoding is configured through a single speculative_config dictionary rather than a scattered set of flags. The method key selects the drafting strategy; everything else follows from that choice.

# Separate draft model
from vllm import LLM, SamplingParams

llm = LLM(
    model="meta-llama/Llama-3.1-70B-Instruct",
    tensor_parallel_size=4,
    speculative_config={
        "model": "meta-llama/Llama-3.1-8B-Instruct",
        "num_speculative_tokens": 5,
    },
)

# N-gram speculation: no draft model needed
llm = LLM(
    model="meta-llama/Llama-3.1-70B-Instruct",
    speculative_config={
        "method": "ngram",
        "num_speculative_tokens": 5,
        "prompt_lookup_max": 4,
    },
)

# EAGLE-style, feature-level drafting
llm = LLM(
    model="meta-llama/Llama-3.1-8B-Instruct",
    tensor_parallel_size=4,
    speculative_config={
        "model": "yuhuili/EAGLE-LLaMA3-Instruct-8B",
        "method": "eagle",
        "num_speculative_tokens": 2,
        "draft_tensor_parallel_size": 1,
    },
)

One constraint worth knowing before you configure this: EAGLE-based draft models must run without tensor parallelism of their own, draft_tensor_parallel_size stays at 1, even when the target model is sharded across multiple GPUs with a higher tensor-parallel-size. The draft head is small enough that splitting it across GPUs adds coordination overhead without a meaningful memory benefit.

Two things to check before committing to a configuration in production:

Memory headroom. A separate draft model, even a small one, still needs VRAM. If your target model already uses most of your GPU's memory, adding a draft model can reduce how many concurrent requests you can serve, which may cost you more in throughput than speculative decoding gains back. This tradeoff is worth testing under real concurrent load, not just single-request latency.

Batch size sensitivity. Speculative decoding's advantage shrinks as batch size grows. At low concurrency, the GPU has idle capacity for the extra verification work to fill. At high concurrency, that idle capacity is already being used by continuous batching, and the acceptance-rate math starts working against you: you're now paying for two forward passes' worth of work per step instead of one, without a proportional gain. Benchmark speculative decoding at the concurrency levels you actually expect in production, not just batch size 1.

Running This on packet.ai

Speculative decoding's payoff depends heavily on GPU memory headroom and batch size, both of which are easier to experiment with when the hardware itself isn't a fixed commitment. packet.ai's Dynamic tier bills hourly rather than requiring a fixed allocation, which makes it a reasonable place to actually test a draft/target pairing, or compare EAGLE against Medusa against no speculation at all, across a range of concurrency levels before deciding what belongs in production. H100 and B200 instances both have the memory headroom to run a 70B target model alongside a small draft model without immediately hitting the concurrency tradeoff described above. Once you've confirmed which configuration actually helps your traffic, moving to a Dedicated instance locks in that setup without scheduler variance.

Frequently asked questions

Speculative decoding is a technique that speeds up LLM text generation by pairing a small, fast draft model with the large target model. The draft model proposes several tokens ahead; the target model verifies all of them in a single parallel forward pass and keeps whichever ones it agrees with. The output is mathematically identical to running the target model alone, just produced faster.
No. Speculative decoding is designed to be lossless: the target model verifies every draft token against its own probability distribution, and the sampling procedure guarantees the output distribution matches what the target model would produce running alone, up to hardware floating-point precision. Minor output variation between runs can occur for other reasons (batch size effects, numerical stability), but not because speculative decoding itself lowers quality.
EAGLE decoding drafts at the feature level, autoregressing on the target model's internal hidden states before they become token probabilities, which carries more information than drafting at the token level. Medusa decoding instead adds multiple independent MLP heads on the target model's last hidden state, each predicting a different future position. EAGLE-3 reaches roughly 0.80-0.88 acceptance rate on coding and instruction tasks in published benchmarks, versus around 0.6 for Medusa on general tasks.
vLLM uses a single speculative_config dictionary passed to the LLM constructor or server launch. Set method to select the strategy ("eagle", "eagle3", "ngram", or omit it for a standalone draft model), num_speculative_tokens to control how many tokens the draft proposes per step, and model to point at a draft model or EAGLE checkpoint where applicable. EAGLE-based drafts must set draft_tensor_parallel_size to 1 regardless of the target model's own tensor-parallel-size.
Less than at low concurrency. Speculative decoding's advantage comes partly from filling GPU idle capacity that continuous batching already fills at high request volume, so the benefit shrinks as batch size grows. At very high concurrency, the extra verification work can cost more than it saves. Benchmark at the concurrency levels you actually expect in production rather than assuming single-request results carry over.

Last reviewed: August 6, 2026. For the memory-management side of vLLM's internals, see the vLLM Docker deployment guide. For the scheduling side, see Continuous Batching Explained.

Waste less compute.

Same models. Same API. Fraction of the cost. Start free — no credit card required.

Start Building →

More from the blog