Speculative decoding explained: faster local models with a draft model
ExplainerBy Lucas Matías García TorresUpdated Data checked 5 min read
Reviewed on . How we work.

Short answer
Speculative decoding lets a small draft model guess the next tokens while the main model checks them in one pass, so answers come faster with the same output. The original papers measured 1.7x to 3.4x speed-ups on datacenter hardware, with smaller draft models and lower temperatures doing best. llama.cpp, LM Studio and Ollama document how to use it; the draft must share the main model's vocabulary, and a draft that is too slow or too often wrong can make generation slower.
Prices and limits change often: check the vendor's page before you pay. How we make money.
Speculative decoding makes a local model answer faster without changing what it says. A small, fast draft model guesses the next few tokens, and the large model you actually want checks all of them in a single pass, keeping the ones it agrees with. The method comes from a 2022 paper by Yaniv Leviathan, Matan Kalman and Yossi Matias and a 2023 DeepMind paper by Charlie Chen and colleagues, and today llama.cpp, LM Studio and Ollama all document a way to use it. This guide explains how speculative decoding works, what speed-ups the papers measured, how to turn it on and when it does not help. We checked every source on October 28, 2026. We have not run our own benchmark, so the speed-ups below are the ones published by the authors, measured on datacenter hardware.
How speculative decoding works
A language model writes one token at a time, and each token needs a full pass through the model. The llama.cpp documentation explains why there is room to speed this up: computing several tokens in one batch, as the model already does when it reads your prompt, is more efficient than computing them one after another. Speculative decoding uses that spare capacity in three steps:
- The draft model guesses. A much smaller model quickly proposes the next few tokens.
- The main model checks them all at once. It scores every guessed token in a single pass.
- It keeps what it agrees with. The main model accepts the guesses that match what it would have generated, and after the last accepted one it always adds one token of its own, as LM Studio's documentation describes.
Because the main model has the final say on every token, the output does not change. Leviathan and his co-authors describe their method as sampling faster without any changes to the outputs, and Chen's team says theirs preserves the main model's distribution within hardware numerics. It also works with normal sampling, not only with the most likely token, although guesses are accepted more often at low temperature, the setting our guide to LLM temperature explains.
What the papers measured
Table: speed-ups reported in the two original papers (batch size 1, datacenter hardware)
| Paper | Main model | Draft model | Task | Speed-up |
|---|---|---|---|---|
| Leviathan et al. | T5-XXL, 11B | T5-small, 77M | English to German translation | 3.4x at temperature 0, 2.6x at temperature 1 |
| Leviathan et al. | T5-XXL, 11B | T5-small, 77M | Summarisation | 3.1x at temperature 0, 2.3x at temperature 1 |
| Leviathan et al. | T5-XXL, 11B | T5-large, 800M | English to German translation, temperature 0 | 1.7x |
| Chen et al. | Chinchilla, 70B | A 4B model trained for the job | Summarisation | 1.92x to 2.01x |
| Chen et al. | Chinchilla, 70B | The same 4B model | Code generation | 2.46x |
Two lessons carry over to a home computer. First, a bigger draft model is not always better: T5-large had its guesses accepted more often than T5-small, 82% against 75%, yet gave 1.7x instead of 3.4x, because each guess cost more. Second, less randomness means more speed, since the same setups ran faster at temperature 0 than at temperature 1. Leviathan's team measured on a single TPU v4 and Chen's on 16, so your own gains will differ.
How to turn it on
llama.cpp. The server takes a draft model with -md and a speculative type with --spec-type. With your own file names, a pairing that LM Studio's documentation suggests looks like this:
llama-server -m Llama-3.1-8B-Instruct-Q4_K_M.gguf -md Llama-3.2-1B-Instruct-Q4_K_M.gguf --spec-type draft-simple --spec-draft-n-max 8
The --spec-draft-n-max option sets how many tokens the draft proposes each time (the default is 3), and -ngld sets how many of the draft model's layers go to the graphics card. llama.cpp prints statistics that include a draft acceptance rate, the number to watch while you tune. It can also speculate without a draft model: the n-gram types reuse sequences that already appear in the context, which the documentation recommends for rewriting code, summaries and reasoning models that repeat their thinking in the final answer, and --spec-default turns one of them on. Some models also ship with their own prediction heads, which llama.cpp uses with --spec-type draft-mtp. Our comparison of Ollama vs llama.cpp covers when to use llama.cpp directly.
LM Studio. In Power User mode or higher, load a model and pick a draft model in the Speculative Decoding section of the chat sidebar. Our guide to Ollama vs LM Studio explains the two apps.
Ollama. The Modelfile reference documents a draft_num_predict parameter: the maximum number of draft tokens per step when a draft model is available, 4 by default for separate draft models, while models with built-in prediction heads need it set. Setting it to 0 turns drafting off.
How to pick a draft model
The draft model must share the main model's vocabulary, so the easy choice is a smaller model from the same family. LM Studio's documentation gives these pairings as examples.
Table: example main and draft model pairs from LM Studio's documentation (checked October 28, 2026)
| Main model | Draft model |
|---|---|
| Llama 3.1 8B Instruct | Llama 3.2 1B Instruct |
| Qwen 2.5 14B Instruct | Qwen 2.5 0.5B Instruct |
| DeepSeek R1 Distill Qwen 32B | DeepSeek R1 Distill Qwen 1.5B |
LM Studio's rule of thumb for the largest draft that should still give a speed-up is 1B for a main model of 3B to 7B, 3B for a 14B model and 7B for a 32B model: the bigger the size gap, the bigger the gain. The draft model needs its own memory next to the main one, so check that both fit, as our guide to how much VRAM you need explains.
When it does not help
- The draft is too slow or too wrong. LM Studio warns that running a draft model takes more computation and resources than the main model alone, and that if the draft is not fast or good enough, generation will not speed up and may slow down.
- The prompt is open-ended. LM Studio's example is a story that could continue in hundreds of valid ways, where the small model's guesses are rejected more often than for a maths formula both models know by heart.
- The temperature is high. Both papers' tables show smaller gains with more random sampling.
The only reliable test is your own: time the same prompts with and without a draft model, in tokens per second, on your machine.
How we checked
On October 28, 2026 we read the papers by Leviathan, Kalman and Matias (arXiv 2211.17192) and by Chen and colleagues (arXiv 2302.01318), the speculative decoding page of the llama.cpp documentation, LM Studio's speculative decoding guide and Ollama's Modelfile reference. We have not measured speculative decoding on our own hardware; all the speed-ups here are as published by the authors.
What we checked
- Leviathan, Kalman and Matias introduce speculative decoding to sample from autoregressive models faster without any changes to the outputs; on T5-XXL (11B), at batch size 1 on a single TPU v4, T5-small (77M) as approximation model gave 3.4x at temperature 0 and 2.6x at temperature 1 on English to German translation and 3.1x and 2.3x on summarization, while T5-large (800M) gave 1.7x on translation at temperature 0 with an acceptance rate of 0.82 against 0.75 for T5-small; acceptance and walltime improvement were higher at temperature 0. (arXiv, )
- Chen and colleagues report that speculative sampling preserves the distribution of the target model within hardware numerics and, with a 4 billion parameter draft model, speeds up Chinchilla 70B at batch size 1 on 16 TPU v4s by 1.92x (XSum, nucleus), 2.01x (XSum, greedy) and 2.46x (HumanEval, nucleus). (arXiv, )
- The llama.cpp documentation says computing n tokens in a batch is more efficient than computing them sequentially; llama-server takes a draft model with -md and a type with --spec-type (including draft-simple, draft-eagle3, draft-mtp for multi-token prediction heads and several n-gram types); --spec-draft-n-max defaults to 3; -ngld sets the draft model layers in VRAM; --spec-default enables ngram-mod; n-gram methods are suggested for iterating over code, summarization and reasoning models; each implementation prints statistics including the draft acceptance rate. (ggml-org / llama.cpp, )
- LM Studio's documentation says the main model only accepts draft tokens that match what it would have generated and always generates one more token after the last accepted one; the draft model must have the same vocabulary; it is enabled in Power User mode or higher from the Speculative Decoding section of the chat sidebar; example pairs are Llama 3.1 8B Instruct with Llama 3.2 1B Instruct, Qwen 2.5 14B Instruct with Qwen 2.5 0.5B Instruct and DeepSeek R1 Distill Qwen 32B with DeepSeek R1 Distill Qwen 1.5B; the maximum draft size to expect speed-ups is 1B for 3B to 7B main models, 3B for 14B and 7B for 32B; a draft that is not fast or good enough can leave generation as slow or slower, and creative prompts get more rejections than factual ones. (LM Studio, )
- Ollama's Modelfile reference documents draft_num_predict, the maximum number of speculative draft tokens to predict per step when a draft model is available; separate draft models default to 4, embedded MTP tensors require setting it, and 0 disables speculative drafting. (Ollama, )
What may change
- llama.cpp, LM Studio and Ollama add and rename speculative decoding options between releases. This page is reviewed every quarter.
Frequently asked questions
Does speculative decoding change the model's answers?
No. The main model checks every token the draft model proposes and only keeps the ones it would have generated itself, so both original papers report the same output distribution as normal decoding, within hardware numerics.
How much faster is speculative decoding?
The original papers measured 1.7x to 3.4x on datacenter hardware, depending on the draft model, the task and the temperature. At home the gain depends on your hardware and prompts, and LM Studio warns it can even slow generation down.
Which draft model should I use?
A much smaller model with the same vocabulary, usually from the same family. LM Studio pairs Llama 3.1 8B Instruct with Llama 3.2 1B Instruct and suggests at most a 1B draft for 3B to 7B models, 3B for 14B and 7B for 32B.
Can I use speculative decoding without a draft model?
In llama.cpp, yes. Its n-gram methods reuse token sequences already in the context, which suits rewriting code and summaries, and some models ship with built-in prediction heads that llama.cpp can use instead of a separate draft.
Why is generation slower with a draft model?
Usually because the draft is too big or too slow, or because its guesses are rejected too often, as happens with open-ended prompts and high temperatures. Check the draft acceptance rate that llama.cpp prints and try a smaller draft.
Sources
- Fast Inference from Transformers via Speculative Decoding (Leviathan, Kalman and Matias, arXiv 2211.17192), arXiv. Accessed October 28, 2026.
- Accelerating Large Language Model Decoding with Speculative Sampling (Chen et al., DeepMind, arXiv 2302.01318), arXiv. Accessed October 28, 2026.
- llama.cpp documentation: speculative decoding (draft models, EAGLE-3, MTP, n-gram methods, options and statistics), ggml-org / llama.cpp. Accessed October 28, 2026.
- LM Studio documentation: speculative decoding (draft model pairs, size guidelines and prompt dependence), LM Studio. Accessed October 28, 2026.
- Ollama Modelfile reference: parameters, including draft_num_predict for speculative drafting, Ollama. Accessed October 28, 2026.
Spotted an error or an outdated price? Tell us and we will fix it.
Change history
- : First published. Checked against the papers by Leviathan, Kalman and Matias and by Chen and colleagues, and the documentation of llama.cpp, LM Studio and Ollama, on October 28, 2026.
Next review: .
Part of our Local Models & Hardware guide.
Keep reading
- Ollama vs llama.cpp: the same engine underneath, different control on top
Ollama vs llama.cpp from their own docs: how they relate, install, API and ports, default context and parallel settings, speed claims, and when to use vLLM.
- Ollama vs LM Studio: which one should you use?
Ollama or LM Studio for running LLMs locally? Compare license terms, platforms, interface, local APIs and server use, from each project's own docs.
- How much VRAM do you need to run an LLM locally?
Work out how much GPU memory a local LLM needs from its size, quantization and context length. Our formula is checked against 13 real model files.
- LLM temperature: what it does and why the newest models ignore it
What LLM temperature, top_p and top_k do, which APIs still accept them in 2026, why temperature 0 is not deterministic and what to use instead.
- Model distillation explained: how a small model learns from a large one
Model distillation trains a small model to copy a large one. How it works, results from Hinton, Gemma 2, Llama 3.2 and DeepSeek-R1, and its limits.
- Electricity cost of a local model: the price per million tokens, worked out
Work out what a local LLM costs in electricity per million tokens, with NVIDIA's rated power, the EU average price and a comparison with API prices.
Other topics

Assistants & Chatbots
21 guides

LLM APIs & Costs
16 guides

Agents & Automation
13 guides

Language Models Explained
18 guides