Back to Blog
November 15, 2026

The short version: Partly. Speculative decoding speeds up the decode phase only, so it does nothing for the long prefill that sets time to first token on a 100K-token prompt. Decode at long context is limited by reading the KV cache, and research such as MagicDec and TriForce shows speculation can help more there, even at large batch sizes. Those papers get their gains from drafts that read a sparse KV cache, which vLLM does not list as a method, so measure on your own traffic before you count on it.

What does speculative decoding actually speed up?

A normal decoder makes one token per forward pass of the large model. Speculative decoding adds a cheap proposer that guesses several tokens ahead. The large model then checks all the guesses in one pass and keeps the longest correct prefix. Leviathan, Kalman and Matias showed this on T5-XXL and reported a "2X-3X acceleration compared to the standard T5X implementation" with identical outputs. Chen et al. at DeepMind reported "a 2-2.5x decoding speedup in a distributed setup" on the 70B Chinchilla model.

The method is lossless by design. Chen et al. describe a rejection sampling scheme that "preserves the distribution of the target model within hardware numerics." The vLLM docs use almost the same words: "theoretically lossless up to the precision limits of hardware numerics." They also warn that vLLM "does not currently guarantee stable token log probabilities," so pipelines that score logprobs should test before and after.

All of this happens after the first token. Prefill already processes every prompt token in parallel, so there is nothing to speculate. Our post on prefill vs decode explains why the two phases behave so differently.

Why would a long context make speculation more useful?

Each decode step must stream the model weights and the whole KV cache for every request in the batch. At short context the weights dominate. At long context the cache takes over. The MagicDec paper puts it plainly: "the KV cache outgrows the memory footprint of the model parameter and continues to increase with batch size." Our guide to KV cache VRAM for a 128K context gives the sizes, for example 16 GiB per 128K sequence for Llama 3.1 8B in BF16.

That shift changes the cost of verification. Checking five draft tokens costs little more than producing one, because the step is waiting on memory, not arithmetic. MagicDec says that at long lengths "SD becomes effective again because the computational overhead of verification becomes less significant." It also finds speculation "consistently outperforms autoregressive decoding except when batch size is large and sequence length is short." This is the opposite of the usual rule that speculation only pays at batch size one.

The reported numbers come with specific setups. MagicDec reports "up to 2.51x speedup for Llama3.1-8B when serving batch sizes ranging from 32 to 256." The paper traces the 2.51x figure to 8xH100, a 100,000-token prefill, batch size 41, and SnapKV-based drafting. TriForce reports up to 2.31x for Llama2-7B-128K on one A100, and 7.78x in an offloading setup on two RTX 4090 GPUs.

Does vLLM implement the long-context methods from those papers?

Not directly, based on the current docs. MagicDec drafts with the target model itself and a compressed KV cache (StreamingLLM or SnapKV style). TriForce drafts with the original weights and a sparse KV cache retrieved on demand, plus a small model on top. In both, the draft is cheap because it avoids reading the full cache.

The vLLM speculative decoding page lists EAGLE (including eagle3), MTP, draft models, n-gram, and suffix decoding, plus options such as Dynamic Speculative Decoding and Adaptive Verification. It does not list a sparse-KV self-drafter of the MagicDec or TriForce kind. So the long-context results above tell you the physics favor speculation. They do not tell you what a stock vLLM install will deliver.

vLLM frames its own target narrowly. The docs say speculation is meant to "reduce inter-token latency under medium-to-low QPS (queries per second), memory-bound workloads." Model-based methods give "the best latency reduction," while n-gram and suffix decoding give "modest speedups without increasing workload during peak traffic." They add that "Real gains depend on your model family, traffic pattern, hardware, and sampling settings."

Which vLLM method should you try first for long prompts?

Start with n-gram. The n-gram page says its proposals come from "matching n-grams in the prompt," so it needs no extra model and no extra VRAM. A long prompt gives it more text to match against. That suits outputs that copy from the input, such as extraction, quoting, or code edits, though the docs do not promise gains for any workload. A launch looks like this:

vllm serve <model> --speculative-config '{"method": "ngram", "num_speculative_tokens": 4, "prompt_lookup_min": 2, "prompt_lookup_max": 5}'

Move to EAGLE-3 if a trained draft head exists for your model. EAGLE-3 reports a speedup ratio "up to 6.5x" over plain decoding and a 1.38x throughput gain at batch size 64 in SGLang. Those figures come from chat and reasoning benchmarks, not 100K-token prompts. A small draft model also works, but its KV cache grows with the same prompt, so it eats into the memory you need for the target model's cache.

How do you decide whether to turn it on?

  1. Find where your latency goes. Split time to first token from inter-token latency. If a request is a 100K-token prompt with a 200-token answer, prefill dominates and speculation cannot help much.
  2. Check your load. vLLM targets medium-to-low QPS. At peak traffic a model-based drafter adds work, while n-gram and suffix decoding do not.
  3. Read the acceptance rate. vLLM exposes per-request acceptance metrics. If most drafts get rejected, you pay for verification and gain little.
  4. Check compatibility. The docs say pipeline parallelism "is not composable with speculative decoding" as of vllm<=0.15.0. Use draft_tensor_parallel_size for the draft model, not tensor_parallel_size.
  5. Check logprob needs. If you score or filter on token logprobs, confirm they stay stable enough with speculation on.
  6. Benchmark at your real context and batch. MagicDec shows the answer flips with sequence length and batch size, so a short-prompt test can mislead you in either direction.

If you run an RLM with a local vLLM backend, as in our RLM-Qwen3-8B vLLM guide, apply the same test to the root model and the sub-call model separately. They see different prompt lengths and output lengths.

The bottom line

Speculative decoding in vLLM can cut inter-token latency on long-context requests, but it never touches prefill. Research shows long contexts make decode memory-bound in a way that favors speculation, with gains like MagicDec's 2.51x and TriForce's 2.31x. Those results depend on sparse-KV drafting that vLLM does not ship as a listed method. Try n-gram first, move to EAGLE-3 if a head exists, and judge it by measured inter-token latency and acceptance rate at your real context length.

References & Further Reading

  1. Leviathan, Kalman, Matias. "Fast Inference from Transformers via Speculative Decoding." ICML 2023, arXiv:2211.17192. Original method; 2X-3X on T5-XXL with identical outputs. arxiv.org/abs/2211.17192
  2. Chen, Borgeaud, Irving, Lespiau, Sifre, Jumper. "Accelerating Large Language Model Decoding with Speculative Sampling." arXiv:2302.01318, February 2023. Distribution-preserving rejection sampling; 2-2.5x on Chinchilla 70B. arxiv.org/abs/2302.01318
  3. Sadhukhan et al. "MagicDec: Breaking the Latency-Throughput Tradeoff for Long Context Generation with Speculative Decoding." arXiv:2408.11049, v5 April 2025. KV cache bottleneck at long context; up to 2.51x for Llama3.1-8B at batch 32 to 256; setup details. arxiv.org/html/2408.11049v5
  4. Sun, Chen, Yang, Tian, Chen. "TriForce: Lossless Acceleration of Long Sequence Generation with Hierarchical Speculative Decoding." COLM 2024, arXiv:2404.11912. Sparse-KV hierarchical drafting; up to 2.31x for Llama2-7B-128K on an A100. arxiv.org/abs/2404.11912
  5. Li, Wei, Zhang, Zhang. "EAGLE-3: Scaling up Inference Acceleration of Large Language Models via Training-Time Test." arXiv:2503.01840, March 2025. Up to 6.5x speedup; 1.38x throughput at batch 64 in SGLang. arxiv.org/abs/2503.01840
  6. vLLM project. "Speculative Decoding." vLLM documentation (latest), accessed November 2026. Supported methods, medium-to-low QPS target, lossless and logprob notes, pipeline parallel caveat, config syntax. docs.vllm.ai/en/latest/features/speculative_decoding
  7. vLLM project. "N-Gram." vLLM documentation (latest), accessed November 2026. Proposals from matching n-grams in the prompt; example config. docs.vllm.ai/en/latest/features/speculative_decoding/n_gram
FAQ

Frequently asked questions

Does speculative decoding change the model's output?

No, not in distribution. The rejection sampling step keeps the target model's output distribution within hardware numerics, per Chen et al. and the vLLM docs. vLLM does warn that token logprobs are not guaranteed to be stable.

Will speculative decoding reduce time to first token?

No. Time to first token comes from prefill, which already processes the whole prompt in parallel. Speculation only starts after the first token is produced.

Does speculative decoding help at large batch sizes?

Usually less at short context, but MagicDec found it can help at large batches when sequences are long. The paper says speculation outperforms plain decoding except when batch size is large and sequence length is short. vLLM itself targets medium-to-low QPS.

Does n-gram speculation need a second model?

No. vLLM's n-gram method proposes tokens by matching n-grams in the prompt. It needs no draft model and no extra GPU memory for weights.

Can I use speculative decoding with pipeline parallelism in vLLM?

Not as of vllm 0.15.0 and earlier, according to the vLLM docs. Tensor parallelism is supported, and the draft model uses its own draft_tensor_parallel_size setting.