Speculative decoding vs MTP, the short answer: MTP is not a rival to speculative decoding, it is one way to do it, and when your model ships MTP heads it is usually the fastest drafter to try first because there is nothing extra to download or match. Speculative decoding is the general trick: something fast guesses the next few tokens, and the big model checks all of the guesses in a single pass, keeping the ones it agrees with. MTP (multitoken prediction) is a training technique that gives a model extra heads to predict tokens further ahead. When a model ships with those heads, they can serve as a built in drafter, so you get speculative decoding without downloading a separate draft model. Either way, done correctly, the output is the same as the big model would have produced on its own; only the speed changes.

Why generation is slow, and why guessing helps

A language model writes one token at a time, and each token needs a full pass through the model. On a single GPU or a Mac, that pass is limited mostly by how fast the weights can be read from memory, not by raw compute. Checking several tokens at once costs about the same as generating one, because the weights only have to be read once. The llama.cpp speculative decoding docs put it simply: computing several tokens in a batch is more efficient than computing them one after another.

So if a cheap drafter can guess the next four tokens and the big model agrees with three of them, you get three or four tokens for roughly the price of one pass. If the guesses are wrong, the big model discards them and you lose a little time.

Is speculative decoding lossless?

Yes, when implemented as designed. The original paper, Fast Inference from Transformers via Speculative Decoding from 2022, describes it as sampling from large models faster "without any changes to the outputs," and reports a 2 to 3 times speedup on T5-XXL. DeepMind's parallel work on speculative sampling uses a modified rejection sampling step that preserves the target model's distribution, and reports a 2 to 2.5 times speedup on a 70 billion parameter model. With greedy decoding, the final text is identical; with sampling, the statistics are the same.

Some servers offer optional "relaxed" acceptance thresholds that trade exactness for speed. Leave those at their defaults if you want truly lossless output.

The drafting methods compared

MethodWhere the guesses come fromExtra downloadNotes
Draft modelA smaller model with the same vocabulary, such as a 1B siblingYesSimplest to understand; widely supported
EAGLE-3A one layer drafter that reads the big model's hidden statesYes, trained per target modelHigher acceptance than a plain draft model of the same size
MTPExtra prediction heads trained into the model itselfNo, if the model ships themOnly for models trained with MTP
DFlash and DSparkA small block diffusion drafter that proposes a whole block at onceYes, trained per target modelNewest approach; drafting is parallel rather than token by token
N-gram or suffix matchingRepeated patterns already in the prompt or outputNoGreat for code edits and summarising documents you pasted in

How MTP works

Meta's 2024 paper Better and Faster Large Language Models via Multitoken Prediction trained models to predict several future tokens at once, using independent output heads on a shared trunk. The authors found it improved sample efficiency, especially for code, and noted that models trained with four token prediction were up to three times faster at inference when the extra heads were used for self speculative decoding.

DeepSeek-V3 made the idea mainstream. Its technical report describes MTP modules used mainly to improve training, which can be discarded at inference or "repurposed" for speculative decoding. DeepSeek reported that the second predicted token was accepted 85 to 90 percent of the time, giving about 1.8 times the tokens per second.

Several open weight families now ship MTP layers. You can see them in each model's config.json on Hugging Face: DeepSeek-V3, GLM-4.5 and Xiaomi's MiMo list num_nextn_predict_layers, and recent Qwen 3.5 models list mtp_num_hidden_layers. Note that GGUF conversions and quantized uploads do not always keep these layers, so check the model card. GLM 5.3 Flash is one that does: its Unsloth GGUFs keep the MTP layer, and our GLM 5.3 Flash local guide shows the llama.cpp flags.

MTP vs draft model: which to use

This is the practical version of the question. A classic draft model is a separate small model (for example a 1B sibling) with its own weights and its own KV cache. MTP heads were trained together with the main model, read its internal state and can share its cache, so there is no second model to download, load and keep in sync. The line has blurred in 2026: Gemma 4 ships small separate "assistant" checkpoints that act as MTP drafters, and vLLM's MTP docs list them for the E2B, E4B, 12B, 26B-A4B and 31B instruction models and wire them to share the target's KV cache.

ItemDraft modelMTP
Extra downloadYes, a full small modelNo, or a small assistant file (Gemma 4)
Must matchVocabulary and tokenizerThe exact model it was trained with
Extra memoryWeights plus a second KV cacheSmall; shares the main cache
Works with any modelAny model with a small siblingOnly models trained with MTP

Rule of thumb: if MTP exists for your model and runtime, start there; fall back to a draft model or n-gram matching when it does not.

Multitoken prediction in Gemma 4

Gemma 4 is the biggest reason MTP moved from servers to laptops this year:

  • Ollama. Version 0.31 turned on MTP for Gemma 4 on Apple Silicon by default (June 29, 2026). Ollama reports Gemma 4 12B (NVFP4) on an M5 Max going from 50.2 to 95.0 tokens per second on the Aider polyglot coding benchmark, its own measurement. It picks the draft length automatically and drops back to normal decoding when guesses stop being accepted. Re pull the model (ollama pull gemma4:12b-mlx) if you downloaded it before the update.
  • llama.cpp. The pull request "llama : add Gemma4 MTP" was merged on June 7, 2026, so a recent build can use a Gemma 4 MTP drafter with --spec-type draft-mtp.
  • LM Studio. Version 0.4.14 (May 22, 2026) made MTP speculative decoding stable for models with built in MTP heads, and 0.4.22 (August 28) added DFlash, DSpark and MTP assistant drafters with llama.cpp engine 2.29.1 or newer.

Our guide to running Gemma 4 locally covers sizes and memory.

How DFlash fits in

The rising query "mtp vs dflash" comes from a 2026 paper, DFlash: Block Diffusion for Flash Speculative Decoding, from UC San Diego researchers. Instead of drafting one token at a time, a small diffusion model proposes a whole block in a single pass, conditioned on the big model's hidden features. The authors report over six times lossless acceleration and up to 2.5 times the speedup of EAGLE-3 on their tests; treat those as the authors' figures. The tradeoff is that you need a DFlash drafter trained for your exact model, while MTP needs nothing extra if your model already has it. llama.cpp also supports DSpark, which adds a small head to DFlash style drafting so each block keeps some left to right signal; its docs say only Qwen3 based DSpark drafters work for now, with Gemma 4 planned.

How to turn it on

llama.cpp

llama.cpp's server selects methods with --spec-type, and you can combine a model based method with an n-gram one:

# Use the model's own MTP heads
llama-server -m model.gguf --spec-type draft-mtp

# Use a separate small draft model
llama-server -m big.gguf -md small.gguf --spec-type draft-simple

# No extra model: n-gram matching, useful for code refactoring
llama-server -m model.gguf --spec-type ngram-simple

Other types include draft-eagle3, draft-dflash, draft-dspark and a newer ngram-mod, which shares one n-gram pool across all server slots and suits reasoning models that repeat their thinking in the answer. The number of drafted tokens is set with --spec-draft-n-max, which defaults to 3, and a separate draft model can get its own quantized cache with -ctkd and -ctvd. If a draft model is combined with an n-gram method, the n-gram method takes precedence. A small draft model can sit at a low GGUF quant such as Q4_K_M without changing the final output, since the main model verifies every token (only the share of accepted drafts moves); GGUF quantization explained compares the types.

vLLM and SGLang

vLLM takes a JSON --speculative-config. For a model with native MTP, its speculative decoding docs show:

vllm serve XiaomiMiMo/MiMo-7B-Base --speculative-config '{"method":"mtp","num_speculative_tokens":1}'

vLLM's documentation rates EAGLE, MTP, draft models and its parallel draft method (PARD) as high gain at low traffic, and n-gram and suffix decoding as low to medium gain; its MTP examples use one speculative token. SGLang uses --speculative-algorithm with options including EAGLE, EAGLE3, NEXTN (its name for MTP), STANDALONE and NGRAM.

LM Studio

LM Studio supports the draft model approach in its chat sidebar. Its documentation explains that the draft model must share the main model's vocabulary, and suggests pairings such as Llama 3.1 8B with Llama 3.2 1B.

When it helps and when it does not

  • Helps most: one user at a time, memory bound hardware, predictable text such as code, structured output, or rewriting a document you supplied.
  • Helps less: creative writing at high temperature, where guesses are rejected more often, and busy servers with large batches, where the GPU is already doing useful parallel work.
  • Costs memory: a separate drafter needs its own weights and KV cache; see our VRAM guide and KV cache quantization for ways to make room.
  • On a Mac: MLX based runtimes now support MTP too, so the format choice in MLX vs GGUF on Mac matters less than whether your runtime turns MTP on.

Pros and cons

  • Pros: faster output with identical results; no retraining needed for draft model or n-gram methods; MTP adds speed with no extra download.
  • Cons: gains vary a lot by prompt and model; drafters must match the target's vocabulary or be trained for it; extra memory; less useful at high batch sizes.

Which should you use?

  1. Your model ships MTP layers and your runtime supports them: start with MTP.
  2. An EAGLE-3 or DFlash drafter exists for your exact model: try it, and measure.
  3. Your model has a small sibling with the same tokenizer: use the draft model approach.
  4. You mostly edit code or long documents: add n-gram drafting; it is nearly free.

For choosing the runtime itself, see Ollama vs llama.cpp vs LM Studio, Ollama vs vLLM and vLLM vs llama.cpp. On NVIDIA's DGX Spark, SGLang vs vLLM on DGX Spark covers the published EAGLE3 setup, where LMSYS reported up to a 2x speedup.

Who this is for

People running open weight models locally who want faster responses, and engineers tuning a serving stack for latency.

FAQ

What is the difference between speculative decoding and MTP?

Speculative decoding is the general method of drafting tokens cheaply and verifying them with the main model. MTP is a way of training a model with extra heads that predict tokens further ahead; those heads can act as the drafter, making MTP one form of speculative decoding.

Does speculative decoding change the model's answers?

No, not with standard settings. The verification step keeps only tokens the main model would have produced, so greedy output is identical and sampled output has the same distribution.

How much faster is speculative decoding?

It depends on how often the guesses are accepted. Papers report around 2 to 3 times on their test setups, and DeepSeek reported about 1.8 times the tokens per second from MTP on DeepSeek-V3. Measure on your own prompts.

Which models support MTP?

Models trained with MTP layers, including DeepSeek-V3, GLM-4.5, Xiaomi MiMo, recent Qwen 3.5 and Qwen 3.8 releases and Gemma 4 (through its assistant checkpoints). Check the model's config file and your runtime's documentation, because support varies.

What is DFlash?

DFlash is a 2026 speculative decoding method that uses a small block diffusion model to draft a whole block of tokens in one pass. It needs a drafter trained for the specific target model, and it is supported in llama.cpp and SGLang.

Is MTP better than a draft model?

Usually, when your model has it. MTP heads were trained with the model and can share its cache, so they cost less memory and need no separate model that matches your tokenizer. Measure acceptance on your own prompts either way. A draft model works with any model that has a small sibling using the same tokenizer, and runs on CPUs and Macs as well as GPUs.