Artificial Ignorance

llama.cpp MTP Explained: Faster Local LLMs with Multi-Token Prediction

MTP (multi-token prediction) is a free speed-up for models that were trained with it, and llama.cpp has supported it since 16 May 2026. Some models, such as Qwen 3.6, Qwen4, Gemma 4 31B, GLM, DeepSeek and Nemotron, ship with an extra small layer that guesses the next few tokens. llama.cpp uses that layer as a built-in “draft model”: it guesses one to three tokens ahead, then the main model checks all of them in a single pass and keeps the ones it agrees with. The output is exactly what the model would have written anyway, only faster. You turn it on with --spec-type draft-mtp, usually with --spec-draft-n-max 2. In llama.cpp’s own tests, dense models such as Qwen 3.6 27B and Gemma 4 31B finished about 2.4 times faster. Mixture-of-experts models such as Qwen4-35B-A3B usually gain 1.1 to 1.5 times. When most of the model runs from system RAM the gain can drop to almost nothing.

Below I explain how MTP works in plain terms and how it compares with draft models, EAGLE-3 and n-gram drafting. I list every model family llama.cpp supports, with the date support arrived. Then come the exact commands, what each flag does, how to pick the draft length, every measured result I could find, the memory cost, and when MTP is not worth it. I also show how to measure the gain on your own PC and fix the common problems. Everything comes from llama.cpp’s speculative decoding documentation, its server README and the merged pull requests that added MTP, all checked on 6 December 2026. Where a number comes from a third party or from my own calculation, I say so.

llama.cpp MTP: multi-token prediction for faster local LLMsTwo tokens written by the main model, followed by three dashed draft tokens from the model's own MTP head, each confirmed with a tick in a single check.LOCAL AI GUIDEllama.cppMTP, explainedMulti-token prediction, step by stepThe model guesses its next few tokens,then checks all of them in one pass.--spec-type draft-mtpup to 2.4xmain modelMTP head drafts 3 tokensdefadd(a,✓b):✓return✓One verification pass3 drafts accepted + 1 bonus token= 4 tokens from a single checkartificialignorance.net
01

What MTP is, in one minute

A normal language model writes one token at a time. Each token needs a full pass through the whole model, and on a home PC that pass is limited mostly by how fast the weights can be read from memory, not by how much maths the GPU can do. So the GPU often sits partly idle while it waits for data.

Multi-token prediction attacks that waste. During training, some model makers add one extra small layer (sometimes called the MTP head, the NextN layer or the MTP module) next to the normal output. It learns to predict the token after the next one, using the model’s own internal state. DeepSeek used it in DeepSeek-V3, and Qwen, Google (Gemma 4), Zhipu (GLM), Xiaomi (MiMo), NVIDIA (Nemotron) and others now ship it too. The main purpose in training is a slightly better model. The useful side effect for us is that the layer can guess ahead.

llama.cpp turns those guesses into speed with a method called speculative decoding. The MTP layer drafts a few tokens, the main model checks them all at once, and every correct guess is a token you did not have to wait a full pass for. Because the head is part of the same model and already sees the model’s internal state, its guesses are often right, usually 60 to 90 percent of the time for one or two tokens ahead.

What you get

More tokens per second while the model writes. The answer is the same as without MTP: with greedy sampling it is identical, and with normal sampling it follows the same probabilities.

What it costs

A little extra memory for the MTP layer and its own small cache, a slightly slower start on long prompts, and nothing at all if your model file does not contain the layer.

What you need

A llama.cpp build from 16 May 2026 or later (later for some families), and a GGUF that includes the MTP layer or comes with a separate MTP file.

MTP is not the same as Qwen4’s n-gram table. Qwen4 also has a 20-billion-parameter n-gram embedding, which Unsloth calls the engram. That is part of the model itself and is read from your SSD. The MTP head is a separate, small layer used only for drafting. My Qwen4 guide covers the n-gram table.

02

How speculative decoding with MTP works

Speculative decoding relies on one simple fact. Checking several tokens in one batch costs almost the same as writing one token, because the expensive part, reading the weights, happens once either way. The llama.cpp documentation puts it this way: computing n tokens in a batch, as in prompt processing, is more efficient than computing n tokens one after another.

How one MTP speculative decoding step works in llama.cppStep 1, the main model writes a token. Step 2, the MTP head drafts the next one to three tokens. Step 3, the main model checks all drafts in one batch. Step 4, matching drafts are kept plus one token from the main model. Example: after 'The cat sat on', drafts 'the', 'mat' are accepted, 'today' is rejected and replaced by a full stop.HOW ONE MTP STEP WORKS1Main model runsIt writes the next token andkeeps its last hidden state.2MTP head draftsThe small built-in headguesses the next 1 to 3 tokensfrom that hidden state.3One checkThe main model reads alldrafts in a single batch, likea short prompt.4Keep what matchesCorrect drafts are kept, plusone token the main modelwrites itself.onthe✓mat✓today✗.+1“The cat sat”“today” is rejected, so themain model’s own choice “.” is used.3 new tokens from one check instead of 1.
One MTP step: draft, check in one batch, keep the matching part, and always gain at least one token from the main model.

Here is what happens at each step:

  1. The main model writes a token.This is the normal, full pass. It also produces a hidden state, the model’s internal summary of everything so far.
  2. The MTP head drafts.From that hidden state, the small MTP layer guesses the next token, then the one after, up to the limit you set with --spec-draft-n-max. Each guess is a tiny pass through one layer, so it is cheap.
  3. The main model verifies.All the drafts go back into the main model as one batch, exactly like a short prompt. The model works out what it would have written at every position.
  4. Accept and correct.Drafts are compared one by one. The first mismatch ends the run: everything before it is kept, the rest is thrown away, and the main model’s own token for that position is added. So every step yields at least one token and at most n-max + 1.

Why the output does not change

With greedy sampling (temperature 0, always the top token), a draft is accepted only if it is exactly the token the main model would have picked. The final text is therefore identical to a normal run. With temperature above 0, llama.cpp uses rejection sampling for MTP and draft models since October 2026 (PR #27694). The pull request says the output distribution “is preserved exactly”. The MTP pull request also re-ran the AIME 2026 maths benchmark with MTP on and matched the score Qwen reported. In short, MTP is a speed feature, not a quality trade.

The maths of the gain

Suppose each draft token is right with probability p and you draft k tokens. The expected number of tokens from one verification pass is 1 + p + p² + … + pk. With p = 0.8:

Drafts (n-max)Expected tokens per passExtra cost per pass
11.8one MTP pass + checking 2 tokens
22.44two MTP passes + checking 3 tokens
32.95three MTP passes + checking 4 tokens
43.36four MTP passes + checking 5 tokens

Each extra draft adds less than the one before, while the cost of drafting and checking keeps rising. That is why the best setting is usually 2 or 3, not 8. In the main MTP pull request, Qwen 3.6 27B at --spec-draft-n-max 3 accepted 72 percent of drafts. By my calculation that is about 3.2 tokens per pass, and the measured wall-clock time fell from 201 to 84 seconds, 2.4 times faster. So each pass cost about 1.3 times a normal one.

03

MTP vs draft models, EAGLE-3 and n-gram drafting

llama.cpp has several ways to produce the drafts. They all use the same verify-and-accept step, so the output is never worse. They differ in where the guesses come from.

Draft model, EAGLE-3, MTP and n-gram speculative decoding comparedA draft model is a second smaller model with its own file and memory. EAGLE-3 is a small head trained afterwards that reads hidden states. MTP is a head trained together with the model and stored in the same GGUF. N-gram methods use no model and copy repeated text.FOUR WAYS TO DRAFT TOKENS IN LLAMA.CPPDraft modeldraft-simpleA second, smaller modelSeparate file and VRAMMust share the tokenizerWorks with almost any familyEAGLE-3draft-eagle3Tiny head trained laterReads hidden statesSeparate small fileOnly for listed modelsMTPdraft-mtpHead trained with the modelInside the same GGUFSmallest extra memoryOnly if the model has itn-gramngram-mod and othersNo model at allCopies repeated textAlmost freeGreat for edits, weak fornew text
All four methods are verified the same way. They differ in where the drafts come from and what they cost.
MethodFlagExtra fileTypical acceptanceBest for
MTPdraft-mtpNo (or one small MTP file)60 to 90%Any model that ships with an MTP layer
Draft modeldraft-simple with -mdYes, a whole small model50 to 70%Families with a tiny sibling model, such as Qwen 3.5 0.8B
EAGLE-3draft-eagle3Yes, a small headHigher than a draft model of the same sizeModels someone has trained an EAGLE-3 head for
DFlash, DSpark and relateddraft-dflash etc.YesVariesModels with those drafters (newer, more specialised)
n-gramngram-mod, ngram-simple and othersNoHigh on repeated text, low on new textEditing code, rewriting documents, long repeated output

The acceptance figures are my summary of the llama.cpp pull requests and documentation, not an official table. The interesting result from the MTP pull request is that a separate draft model is not automatically worse. On Qwen 3.6 27B, Qwen 3.5 0.8B as a draft model at 16 tokens finished in 81 seconds against 84 for MTP. But it needs a second download, its own VRAM and a tokenizer match, and many models have no small sibling at all. MTP is simply the easiest option when your model has it: no second file, no matching, one flag.

You can also combine MTP with n-gram drafting, which I cover in section 13.

04

Which models support MTP in llama.cpp

There is no single official list, so I built this one from the merged pull requests. The date is when support landed on llama.cpp’s main branch. Any release made after that date includes it. Your GGUF must also contain the MTP layer, which section 5 explains.

Model familyMergedPull requestNotes
Qwen 3.6 27B and 35B-A3B (and models on the same architecture)16 May 2026#22673The first MTP support. Ready-made files: 27B, 35B-A3B
Gemma 4 31B and 26B-A4B7 June 2026#23398Not the small E4B/E2B models at first; later fixes mention E4B
MiMo 2 (Xiaomi)30 July 2026#26228
GLM-5.2 (GLM_DSA)29 July 2026#25980
DeepSeek V42 August 2026#25784Together with DSpark drafting
Qwen3-Next 80B-A3B3 August 2026#25589
DeepSeek V3.23 August 2026#26457
GLM-4.7-Flash3 August 2026#24868MTP files: GLM-4.7-Flash-MTP-GGUF
Nemotron (NVIDIA)10 August 2026#26725Extended on 17 September (#29018)
GLM-4.5-Air and GLM-4.523 August 2026#26534Separate MTP file: GLM-4.5-Air-MTP-GGUF
Qwen3.8-Flash-Next (qwen4exp)1 October 2026#29761Further fixes in early December
GLM5Next7 October 2026#29928
Mellum 2.116 October 2026#30612
Qwen4-35B-A3BWorks with Unsloth’s GGUFsUnsloth guideThe MTP head is inside every Unsloth Qwen4 GGUF

Two warnings. First, the family must be supported and your exact file must contain the layer. Many GGUFs made before support arrived, or converted with --no-mtp, leave it out. Second, a model on this list is not guaranteed to get faster on your hardware. Section 9 shows that results vary a lot.

Llama, Mistral, Phi and most older models were never trained with an MTP head, so MTP cannot help them. For those, use a draft model or n-gram drafting instead.

05

What you need before you start

  • A recent llama.cpp. Use a release from after the date in section 4 for your model family. I recommend the newest release anyway, because many MTP fixes landed later: memory fitting (#26177, #26605), automatic type detection (#27005), CUDA graphs for the draft (#28549) and rejection sampling (#27694).
  • A GGUF with the MTP layer. Either a combined file (the usual case: one GGUF with the MTP layer inside) or a normal file plus a small separate MTP-only GGUF.
  • A little spare memory. Roughly 0.5 to 2GB for the MTP layer plus a small cache. See section 10.
  • llama-server from llama.cpp itself. Apps built on llama.cpp may not expose the option yet. Section 15 explains what to do.

How to tell whether a GGUF contains the MTP layer

The easiest sign is the name or the model card. ggml-org’s Qwen 3.6 files say MTP in the repository name, and Unsloth’s Qwen4 guide says every Qwen4 GGUF includes the head. For a file you already have, open its metadata. Hugging Face shows it when you click a GGUF file, and the gguf-dump tool from the gguf Python package prints it locally. For most families, look for a key ending in nextn_predict_layers with a value of 1 or more, and for tensors with nextn in their names. If both are missing, the file has no MTP layer and --spec-type draft-mtp has nothing to use.

What about the Qwen 3.6 files I already have?

Qwen 3.6 came out in April 2026, a month before llama.cpp could run MTP. As far as I can tell, most of the GGUFs from that time do not contain the layer. ggml-org later published Qwen3.6-27B-MTP-GGUF and Qwen3.6-35B-A3B-MTP-GGUF with it. If your Qwen 3.6 file does not show the MTP metadata, download one of those or a newer re-upload that mentions MTP. My Qwen 3.6 guide covers the rest of the setup.

Converting a model yourself

If you convert from Hugging Face weights with convert_hf_to_gguf.py, supported models get the MTP layer in the same file by default. The --no-mtp option leaves it out, and --mtp writes a separate MTP-only file (PR #25641). Check python convert_hf_to_gguf.py --help on your copy, because the options were refactored in July 2026. Quantise as usual afterwards.

06

How to turn MTP on: the commands

All examples use llama-server. Add your usual options for GPU layers, context and so on. The MTP part is just one or two flags.

The basic command

llama-server -m Qwen3.6-27B-MTP-Q4_K_M.gguf -ngl 99 -c 32768 --spec-type draft-mtp --spec-draft-n-max 2

--spec-type draft-mtp tells llama.cpp to use the model’s own MTP layer as the drafter. --spec-draft-n-max 2 lets it guess up to two tokens ahead. The default is 3, which suits fast GPUs and code. I start everyone on 2 because it rarely makes things slower.

Straight from Hugging Face

llama-server -hf ggml-org/Qwen3.6-27B-MTP-GGUF --spec-type draft-mtp --spec-draft-n-max 2

If you do not need image input, add --no-mmproj. With -hf, llama.cpp otherwise downloads and loads the vision projector too, which costs VRAM you may want for the MTP layer. MTP itself works with image input: the original pull request says it is compatible with vision, and PR #30257 improved it in October.

Qwen4-35B-A3B on an 8GB to 16GB card

llama-server -m Qwen4-35B-A3B-UD-Q4_K_XL.gguf -ngl 99 --n-cpu-moe 30 -c 32768 -fa on --jinja --spec-type draft-mtp --spec-draft-n-max 2

The --n-cpu-moe number depends on your card. My Qwen4 guide has the right value for 8GB, 12GB and 16GB. Unsloth recommends a draft length of 2 for Qwen4. When most experts sit in system RAM, try 1 as well and keep whichever is faster.

A model with a separate MTP file

llama-server -m GLM-4.5-Air-trunk-only-Q4_K_M.gguf -md GLM-4.5-Air-MTP-Q4_K_M.gguf --spec-type draft-mtp --spec-draft-n-max 1

Some uploads keep the MTP layer in its own small GGUF. Load it as the draft model with -md. Since August 2026, llama.cpp detects that a draft file is an MTP layer by itself (PR #27005), but writing --spec-type draft-mtp explicitly does no harm. If you keep models in one folder for the router mode, files named mtp-*.gguf are now recognised as companions, like mmproj files (PR #24431).

MTP plus n-gram drafting

llama-server -m model-with-mtp.gguf --spec-default --spec-type draft-mtp --spec-draft-n-max 3

--spec-default switches on the ngram-mod drafter as well. The documentation says that when a draft model and a draftless method are combined, “the draftless decoding has higher precedence”. So when the text repeats something already in the context, the n-gram drafter can propose a long run, and otherwise MTP takes over. Section 13 explains when this helps.

Using environment variables

Every flag also has an environment variable, which is handy for Docker or service files: LLAMA_ARG_SPEC_TYPE=draft-mtp and LLAMA_ARG_SPEC_DRAFT_N_MAX=2.

Old guides use flags that no longer exist. --draft, --draft-max and --draft-min were replaced by the --spec-draft-* family. If you see “invalid argument”, check the flag names against the current README.

07

Every MTP flag explained

These are the options that matter for MTP, taken from the current llama.cpp server README and speculative decoding guide. Most people only ever change the first two.

FlagDefaultWhat it does
--spec-type draft-mtpnoneTurns MTP drafting on. Accepts a comma-separated list to combine methods.
--spec-draft-n-max N3The most tokens to draft per step. The most important setting (section 8).
--spec-draft-n-min N0The fewest tokens to draft. Leave at 0 so llama.cpp can draft less when unsure.
--spec-draft-p-min P0.00Stops a draft early when the drafter’s confidence in the next token falls below P. Try 0.6 for mixed or creative text.
--spec-draft-p-split P0.10The split probability used by speculative decoding. I leave it alone.
--spec-draft-samplinggreedySet to probabilistic so the drafter samples too, which helps acceptance at temperature above 0 (newer builds).
--spec-draft-backend-samplingenabledRuns draft sampling on the GPU. Turn off with --no-spec-draft-backend-sampling only for debugging.
--spec-draft-n-ubatch N0 (same as -ub)A smaller physical batch for the draft context, to spare VRAM.
-ctkd / -ctvd TYPEf16Cache type for the draft’s key and value cache, for example q8_0, to save memory.
--spec-draft-deviceautoWhich GPU runs the draft. Useful with several GPUs and -sm layer.
-ngld NautoDraft layers to keep in VRAM. Mainly for separate draft files.
--spec-defaultoffEnables the default draftless drafter (ngram-mod). Combine with --spec-type draft-mtp.
--spec-synth-len / --spec-synth-ratesoffBenchmarking only: fake acceptance. The output is not valid model output.

Two of these are worth a closer look. --spec-draft-p-min cuts a draft short when the drafter is unsure, so you do not waste verification on guesses that will probably fail. In the Qwen3-Next pull request, adding --spec-draft-p-min 0.6 with n-max 2 raised acceptance from about 83 percent to over 95 percent. Creative writing sped up from 78 to 98 tokens per second, because fewer doomed guesses were checked. --spec-draft-sampling probabilistic came with the rejection-sampling work in October 2026. If you chat at temperature 0.7 or 1.0, test it against the default.

08

How to choose the draft length (n-max)

The draft length is a trade-off. Longer drafts can win more tokens per pass, but each extra position is less likely to be right and makes every pass more expensive. When too many guesses fail, MTP becomes slower than no MTP at all.

Acceptance rate and speed-up at different MTP draft lengthsFor Qwen4-35B-A3B the share of accepted draft tokens falls from 89 percent at one draft token to 68 percent at two and about 50 percent at three. In llama.cpp pull request tests GLM-4.5-Air ran 1.19 times faster at one draft token, 1.12 at two and 0.97 at three; GLM-4.7-Flash ran 1.18, 1.14 and 1.03 times faster.MORE DRAFT TOKENS IS NOT ALWAYS FASTERAcceptance rate, Qwen4-35B-A3B (Unsloth)Speed-up vs no MTP, two GLM models (PR tests)89%n-max 168%n-max 250%n-max 31.0x1.1x1.2xGLM-4.5-Air Q4, 4x RTX 3090GLM-4.7-Flash Q8_0n-max 1n-max 2n-max 3below this line MTP is slower
Left: acceptance falls quickly as drafts get longer. Right: in two GLM tests, one draft token was fastest and three was slower than or equal to no MTP.
Model and hardwaren-max 1n-max 2n-max 3Source
Qwen4-35B-A3B, acceptance0.890.680.48 to 0.51Unsloth
Qwen 3.6 27B Q8_0, DGX Spark, wall time—90.4 s (2.22x)83.8 s (2.40x)#22673
GLM-4.7-Flash Q8_0, mean speed-up1.18x1.14x1.03x#24868
GLM-4.5-Air Q4_K_M, 4x RTX 30901.19x1.12x0.97x#26534
GLM-4.5-Air Q8_0, partly on CPU1.10x1.06x0.95x#26534
Qwen4-35B-A3B, RTX 5090, code1.28x—1.27xUnsloth
Qwen4-35B-A3B, RTX 5090, prose1.22x—1.04xUnsloth

My rules, based on these results:

  • Start with 2. It was close to the best setting in every test above, and Unsloth recommends it for Qwen4.
  • Try 3 for a dense model that fits fully in VRAM, especially for code. Qwen 3.6 27B was faster at 3 than at 2, and the Gemma 4 31B test used 4.
  • Try 1 for mixture-of-experts models, especially with experts in system RAM or with creative writing. Every GLM test was fastest at 1.
  • Never go above 4 for MTP. Most models ship a single MTP layer, which llama.cpp runs again for each extra position, so accuracy falls fast. Long drafts like 16 or 64 make sense for draft models and n-gram methods, not MTP.
  • Add --spec-draft-p-min 0.6 if your work is mixed. It lets the drafter stop early on hard text and keep going on easy text.

Why the type of text matters so much

Acceptance depends on how predictable the next tokens are. In the Qwen 3.6 27B test at n-max 3, Python code reached 0.91 acceptance, creative writing 0.62 and translation 0.54. In the Qwen3-Next test, step-by-step maths hit 0.99. Code, maths, JSON, summaries and factual answers are full of predictable tokens: brackets, keywords, names repeated from the prompt. Stories and poems are designed to surprise, so the guesses fail more often. If you mainly write fiction, expect the low end of every range in this article.

09

Real speed-ups: every measured result I could find

These are the results published in the llama.cpp pull requests and in Unsloth’s Qwen4 guide. They were measured by the developers on their own machines, so treat them as examples, not promises. All are single-user (-np 1) generation speed. Most use greedy sampling.

Measured MTP speed-ups for nine models in llama.cppDense Gemma 4 31B and Qwen 3.6 27B on a DGX Spark ran 2.4 times faster. Mixture-of-experts models gained less: Qwen3.8-Flash-Next 1.55 times, Qwen4-35B-A3B on an RTX 5090 1.28 times for code, GLM-4.5-Air 1.19, GLM-4.7-Flash 1.18, Qwen3-Next 80B on an M5 Max 1.17, GLM-4.5 with CPU offload 1.07, and Gemma 4 26B-A4B showed no speed-up on its author's system.MEASURED MTP SPEED-UPS IN LLAMA.CPPdense modelmixture of experts (MoE)Gemma 4 31B (dense), DGX Spark, n-max 42.40xQwen 3.6 27B Q8_0 (dense), DGX Spark, n-max 32.40xQwen3.8-Flash-Next IQ4_XS, DGX Spark, n-max 31.55xQwen4-35B-A3B, RTX 5090, coding, n-max 11.28xGLM-4.5-Air Q4, 4x RTX 3090, n-max 11.19xGLM-4.7-Flash Q8_0, n-max 11.18xQwen3-Next 80B-A3B Q4, M5 Max, n-max 31.17xGLM-4.5 with --n-cpu-moe 30, n-max 11.07xGemma 4 26B-A4B (MoE), author's system1.00x1.0x = no gain
Dense models gain far more from MTP than mixture-of-experts models. Data from the llama.cpp pull requests and Unsloth’s Qwen4 guide.
ModelHardwaren-maxResultSpeed-upSource
Gemma 4 31B (dense)DGX Spark4290 s to 121 s wall, about 6 to 11-19 tok/s2.40x#23398
Qwen 3.6 27B Q8_0 (dense)DGX Spark3201 s to 84 s wall, 7 to 14-22 tok/s2.40x#22673
Qwen3.8-Flash-Next IQ4_XS (MoE)DGX Spark328.4 to 43.9 tok/s1.55x#29761
Qwen4-35B-A3B UD-Q4_K_XL (MoE)RTX 50901174.9 to 224.0 tok/s (code)1.28xUnsloth
Qwen4-35B-A3B UD-Q4_K_XL (MoE)Mac M5 Max2code 1.40x, prose 1.21x1.21-1.40xUnsloth
Qwen4-35B-A3B UD-Q4_K_XL (MoE)RTX Spark362.8 to 84.9 tok/s (code)1.35xUnsloth
GLM-4.5-Air Q4_K_M (MoE)4x RTX 3090174.6 to 88.7 tok/s1.19x#26534
GLM-4.7-Flash Q8_0 (MoE)not stated1111.3 to 131.1 tok/s1.18x#24868
Qwen3-Next 80B-A3B Q4_K_M (MoE)Mac M5 Max318.1 s to 15.5 s wall1.17x#25589
GLM-4.5 full, --n-cpu-moe 30 (MoE)not stated1speed-up only1.07x#26534
Gemma 4 26B-A4B (MoE)author’s system—“I don’t observe a speed-up”about 1.0x#23398

Why dense models gain more than MoE models

The pattern is clear: big dense models gain about 2.4 times, while mixture-of-experts models gain 1.1 to 1.5 times. The usual explanation, which matches these numbers, comes down to which weights each pass reads. A dense 27B or 31B model reads all of its weights for every pass. Checking three extra tokens reads them only once, so the check is almost free, and slow dense models are exactly where the gain is largest. A mixture-of-experts model picks different experts for each token. When it checks four tokens at once, it may need four different sets of experts, so the check reads much more data than a single token would. The bigger the model and the slower your memory, the less this costs in relative terms. That is why the DGX Spark tests look so good: its memory is slow compared with a desktop GPU, so the dense baseline was slow.

When experts sit in system RAM (--n-cpu-moe), the problem grows. Each extra expert read during verification comes over the slower RAM path. The full GLM-4.5 test with --n-cpu-moe 30 gained only 7 percent. If you run Qwen4 or Qwen 3.6 35B-A3B on an 8GB card with most experts on the CPU, expect something closer to 1.0 to 1.2 times than to the RTX 5090 figures. Test it with section 12.

10

How much memory MTP uses

MTP adds two things to memory: the MTP layer itself, and a small key and value cache for it. In llama.cpp, the MTP layer loads as a separate small model from the same GGUF, with its own context and cache. That is how the original pull request describes it.

Qwen4 GGUFMTP head stored asHead size
Up to Q3Q4_K0.49GB
IQ4 and Q4Q5_K0.59GB
Q5Q6_K0.71GB
Q6Q8_00.92GB
Q8_K_XLBF161.72GB

These sizes come from Unsloth’s Qwen4 guide. They show the head is small, about 2 to 3 percent of a 35B model. The extra cache is the size of one more layer of the main model’s cache, which by my own calculation is small next to the main cache: for a model like Qwen 3.6 27B, up to about half a gigabyte at a 128K context in f16, and much less at normal lengths. Plan on 0.5 to 2GB of extra VRAM in total.

Ways to make it fit

  • Update llama.cpp. Before late July 2026, --fit did not count the MTP layers. It offloaded one layer too few and left layer 0 on the CPU, which on Qwen 3.6 also disabled a fast fused kernel. Fixing that gave about 10 percent more speed (#26177, #26605).
  • Quantise the draft cache with -ctkd q8_0 -ctvd q8_0. The default is f16.
  • Shrink the draft batch with --spec-draft-n-ubatch 256 or lower, to spare VRAM.
  • Drop the vision projector with --no-mmproj if you only use text.
  • Move one more expert layer to the CPU (--n-cpu-moe plus 1) if the MTP layer pushes you out of VRAM. Then compare speed with and without MTP, because on small cards the trade can go either way.

When MTP is off, you pay nothing. Since July 2026, llama.cpp only loads the MTP tensors if you ask for --spec-type draft-mtp (PR #26296). A file with an MTP layer is therefore not a memory penalty on its own.

For the much larger main cache, see my guide to how much RAM and VRAM a 1M-token context needs.

11

When MTP does not help, or makes things slower

Four questions that decide whether MTP will speed up your setupIf your GGUF has no MTP layers, MTP cannot run. Dense models or MoE models fully on the GPU gain the most; heavy CPU offload gains little. Code, maths, summaries and question answering get the highest acceptance. With one user at a time, turn it on with n-max 2.SHOULD YOU TURN MTP ON?IF NOTIF YESDoes your GGUF include MTP layers (or comewith an MTP file)?No: MTP cannot run. Use ngram-mod or adraft modelYes: go onIs it a dense model, or a big MoE that fitsfully on the GPU?Heavy CPU offload: expect 1.0x to 1.1x;try n-max 1Yes: expect 1.2x to 2.4xIs most of your work code, maths, summaries orQ&A?Mostly creative writing at hightemperature: smaller gainYes: these get the highest acceptanceDo you serve one user at a time (-np 1)?Many parallel users: test it first, gainsshrinkYes: turn it on with n-max 2
Four quick checks. If you end up in the right-hand column every time, MTP is very likely worth it.
Prompt processing gets slower

The MTP pull request warns that prompt processing “typically takes a negative hit”, mainly because hidden states are copied from GPU to CPU. If you paste 50,000-token documents and want short answers, the slower start can eat the gain.

Many users at once

Parallel decoding with MTP works but, in the words of the pull request, is “not fully optimized yet”. With -np 4 or more the GPU is already busy, so there is less idle time for drafts to fill.

Heavy CPU offload

When most of the model runs from system RAM, verifying several tokens needs more expert weights over the slow path. Gains of 1.0 to 1.1 times are typical, and sometimes it is slower.

Some MoE models

On Gemma 4 26B-A4B the MTP author saw no speed-up on their system, while the dense 31B more than doubled.

Creative or random text

High temperature and fiction mean fewer correct guesses. At n-max 3, Qwen4 prose gained only 4 percent on an RTX 5090.

Models without a head

Llama, Mistral, Phi and most older models have no MTP layer. Use a draft model or n-gram drafting instead.

None of these makes the answers worse. At worst MTP wastes a little time and memory, and you can turn it off by removing one flag.

12

How to measure the gain on your own PC

Speed claims mean little until you test your own model, card and type of work. This takes about ten minutes.

  1. Start the server without MTP.Use your normal command, with -np 1 and thinking off (or a fixed thinking level), so runs are comparable.
  2. Send the same prompt three times.Use temperature 0 and a fixed length of a few hundred tokens. Note the generation speed each time and ignore the first run, which includes warm-up.
  3. Restart with MTP.Add --spec-type draft-mtp --spec-draft-n-max 2 and repeat the same three runs.
  4. Try n-max 1 and 3.Repeat once for each. Keep whichever setting is fastest for your work.
  5. Repeat with a prompt from your real work.A coding prompt and a writing prompt can give very different answers.

On Windows, this PowerShell command sends a test prompt to a running server and prints the timings. Look at predicted_per_second:

$body = @{ prompt = "Write a Python function that reads a CSV file and returns a list of dictionaries, with error handling."; n_predict = 400; temperature = 0 } | ConvertTo-Json
(Invoke-RestMethod -Uri http://127.0.0.1:8080/completion -Method Post -Body $body -ContentType "application/json").timings

On Linux or macOS:

curl -s http://127.0.0.1:8080/completion -H "Content-Type: application/json" \
  -d '{"prompt":"Write a Python function that reads a CSV file and returns a list of dictionaries, with error handling.","n_predict":400,"temperature":0}' \
  | python -c "import json,sys; t=json.load(sys.stdin)['timings']; print(round(t['predicted_per_second'],1), 'tok/s')"

Reading the acceptance rate

llama-server prints statistics in its log. The line to look for has this format:

draft acceptance rate = 0.57576 (  171 accepted /   297 generated)

This means 171 of 297 drafted tokens were kept. As a rough guide from the tests above: above 0.7 is good and you may gain from a longer draft. Between 0.5 and 0.7 is normal at n-max 2 or 3. Below 0.5, shorten the draft or add --spec-draft-p-min 0.6. A high acceptance rate with no speed gain usually means verification is expensive on your setup, typically because of CPU offload.

Proper benchmarking

For a fuller test across many prompt types, llama.cpp includes the SPEED-Bench client. It runs against a running llama-server and can compare a baseline run with a speculative run, reporting throughput, latency and acceptance. Do not confuse it with --spec-synth-len and --spec-synth-rates: those fake the acceptance for benchmarking the machinery, and the documentation warns that the output “is not valid model output”.

13

Combining MTP with n-gram drafting

n-gram drafting needs no model at all. It notices that the last few tokens already appeared earlier in the conversation and proposes whatever followed them last time. That is very effective when the model rewrites something it has already seen: editing a file, fixing one function in a long code block, reformatting a document or repeating a JSON structure. On new text it rarely finds anything.

MTP is the opposite. It is good on new text and limited to a few tokens. Combining them gives you both:

llama-server -m model-with-mtp.gguf --spec-type ngram-mod,draft-mtp --spec-draft-n-max 3

or, equivalently for the n-gram part, --spec-default --spec-type draft-mtp. The llama.cpp documentation says that when a draftless method is combined with a draft model, the draftless one “has higher precedence”. When ngram-mod finds a match it drafts a long run, and otherwise MTP drafts as usual.

The ngram-mod pool is shared across all server slots, and its default lookup length is 24 tokens. If you mainly do coding-agent work, where the model constantly re-emits code from the context, this combination is worth testing. For plain chat, MTP alone is simpler.

14

Temperature, sampling and thinking with MTP

Acceptance is highest at temperature 0, because the drafter and the main model both pick their top token. As temperature rises, the main model starts picking other tokens, and an exact-match check rejects more drafts. The October 2026 change (PR #27694) addressed this in two ways. The main model now uses rejection sampling, accepting a draft with probability min(1, p/q) instead of requiring an exact match. And the drafter can sample too (--spec-draft-sampling probabilistic) instead of always offering its single safest guess.

Coding, agents, extraction

Use temperature 0 to 0.3 and keep the default greedy drafter. This gives the highest acceptance.

General chat

Use the model’s recommended temperature (often 0.6 to 0.7) and test --spec-draft-sampling probabilistic against the default.

Fiction and brainstorming

Expect a small gain. Use n-max 1 or 2 and --spec-draft-p-min 0.6.

Thinking models

MTP speeds up the thinking tokens too. They are generated like any other text, so the same rules apply: structured, step-by-step reasoning tends to be drafted well, rambling exploration less so. Qwen4 has four thinking levels and Qwen 3.6 has thinking on or off. When you compare speed, keep the thinking setting the same in both runs, because a different amount of thinking changes the total time far more than MTP does.

15

MTP in Ollama, LM Studio and other apps

Ollama, LM Studio, Jan, KoboldCpp and similar apps use llama.cpp code, or their own engines built in a similar way, but each decides which llama.cpp options to expose and when. At the time of writing I could not find official documentation of an MTP switch in Ollama or LM Studio, so I will not claim one exists. Check your app’s release notes for “MTP”, “multi-token prediction” or “speculative decoding”.

If your app does not have it, run llama-server yourself with MTP on and point the app at it. llama-server provides an OpenAI-compatible API at http://127.0.0.1:8080/v1, which Open WebUI, most coding agents, VS Code extensions and many chat apps can use as a “custom OpenAI” or “OpenAI-compatible” provider. You keep your favourite interface and get MTP from llama.cpp.

Ollama now runs llama.cpp’s llama-server underneath on Windows and Linux. My Ollama vs llama.cpp VRAM test shows the command it uses and which llama.cpp settings Ollama does and does not expose.

16

NVIDIA, AMD, Apple and multiple GPUs

SetupWhat to know
NVIDIA (CUDA)The most tested. CUDA graphs for the MTP draft arrived in September 2026 (#28549), which cuts overhead. A Gemma E4B MTP FlashAttention fix landed in June.
Apple Silicon (Metal)Tested in the Qwen3-Next pull request and Unsloth’s guide on an M5 Max: 1.17 times for Qwen3-Next, 1.21 to 1.40 times for Qwen4. Unified memory means the MTP layer simply comes out of the same pool.
AMD (ROCm, Vulkan)MTP is part of the common code, not a CUDA-only feature, so it runs wherever the model runs. I found no published AMD MTP benchmarks, so measure your own.
CPU onlyIt works, but CPU inference is usually limited by memory bandwidth for both drafting and checking, so expect small gains. Try n-max 1.
Several GPUsThe pull request says MTP is compatible with tensor and pipeline parallelism. For Gemma 4 with several GPUs, the author notes you may need --spec-draft-device together with -sm layer to pick where the draft runs.
17

Troubleshooting MTP

ProblemLikely causeFix
“invalid argument” or unknown spec typeOld llama.cpp, or old flag namesUpdate to a current release and use --spec-type draft-mtp and --spec-draft-n-max
MTP is on but nothing is draftedThe GGUF has no MTP layerCheck the metadata (section 5) and download an MTP version
Slower with MTP than withoutDraft too long, CPU offload, or creative textTry n-max 1, add --spec-draft-p-min 0.6, and compare again
Out of memory after turning it onThe MTP layer and its cache no longer fitUpdate for the --fit fixes, use -ctkd q8_0 -ctvd q8_0, lower --spec-draft-n-ubatch, reduce -c or add one --n-cpu-moe
Log says layer 0 is on CPU and a fused kernel is disabledOlder --fit did not count MTP layersUpdate past late July 2026 (#26177)
First reply after a long paste is slowPrompt processing is slower with MTPExpected. Turn MTP off for mostly long-prompt, short-answer work
Acceptance drops at temperature 0.7 or higherExact-match drafting at high temperatureUse a build from October 2026 or later and try --spec-draft-sampling probabilistic
The MTP file loads as the main modelRouter mode did not recognise the companion fileName it mtp-*.gguf and update (#24431), or load it with -md
Slow or errors with several GPUsDraft placed on the wrong deviceSet --spec-draft-device and try -sm layer
Gemma 4 E2B or E4B will not use MTPNot supported in the first Gemma 4 MTP versionUpdate and check the release notes, or use the 31B
18

Frequently asked questions

Does MTP reduce answer quality?

No. A draft token is only kept if the main model accepts it. With greedy sampling the output is identical, and with normal sampling llama.cpp uses rejection sampling, which keeps the same output distribution. The MTP pull request re-ran AIME 2026 with MTP and matched Qwen’s reported score.

Is MTP the same as speculative decoding?

MTP is one way to do speculative decoding. Speculative decoding is the draft-then-verify method. MTP is where the drafts come from: a layer built into the model, instead of a second model or an n-gram lookup.

What is the difference between MTP and NextN?

Nothing for you as a user. NextN is the name llama.cpp and some model makers use for the same extra prediction layer. You may see nextn in tensor names and metadata.

Does every GGUF of a supported model have MTP?

No. Files made before support arrived, or converted with --no-mtp, leave the layer out. Check the metadata or download a version that mentions MTP.

Which n-max should I use?

Start with 2. Try 3 for dense models that fit in VRAM, and 1 for mixture-of-experts models with experts in system RAM. Keep whichever measures fastest.

How much faster will my PC be?

Between no gain and about 2.4 times. Dense models on slow-memory hardware gain most. Mixture-of-experts models usually gain 1.1 to 1.5 times. Heavy CPU offload often gains under 1.1 times.

Does MTP use more VRAM?

Yes, a little: the MTP layer (0.5 to 1.7GB for Qwen4 depending on the quant) plus a small cache. When MTP is off, recent llama.cpp does not load the layer at all.

Can I use MTP and a separate draft model at the same time?

The documented combination is one model-based drafter, such as MTP, plus a draftless method such as ngram-mod, which takes precedence when it finds a match. I have not seen two model-based drafters combined in the documentation or the tests, so I would not rely on it.

Does MTP work with images?

Yes. The original pull request says MTP is compatible with vision input, and a later change improved image input with MTP. Skip --no-mmproj if you need images.

Does MTP speed up prompt processing?

No. It only speeds up generation and can make prompt processing slightly slower.

Can I use MTP with Llama 3 or Mistral?

No, those models have no MTP layer. Use a draft model from the same family or n-gram drafting.

Is MTP worth it on an 8GB card?

Sometimes. If the model fits on the GPU, usually yes. With a 35B mixture-of-experts model mostly in system RAM, the gain is small, and the extra VRAM might be better used for more layers. Measure both ways with section 12.

Does MTP work on Windows?

Yes. Use the Windows build of llama.cpp from the releases page that matches your GPU (CUDA, Vulkan or CPU). The flags are the same on every system.

Does MTP help with many users at once?

It works with -np greater than 1, but the pull request says parallel MTP is not fully optimised yet. Measure before relying on it for a shared server.

Where do I see if MTP is working?

In the server log, look for the line draft acceptance rate. If it shows accepted and generated counts, MTP is drafting.

Does Qwen4 need MTP turned on to run properly?

No. It is optional. Qwen4 runs normally without it, and MTP only adds speed. My Qwen4 guide and my Qwen4 vs Qwen 3.6 comparison cover the rest.

19

Your next step

Update llama.cpp to the newest release and check that your model’s GGUF contains the MTP layer. Then run the ten-minute test in section 12 with --spec-type draft-mtp --spec-draft-n-max 2, and try 1 and 3. If MTP is faster on your own prompts, add the flags to your normal start command and forget about it. If it is not, you have lost nothing: remove the flag. If you are setting up Qwen from scratch, start with my Qwen4 guide for 8GB, 12GB and 16GB cards or my Qwen 3.6 guide.

Sources: llama.cpp speculative decoding docs, llama.cpp server README, PR #22673 MTP support, PR #23398 Gemma 4 MTP, PR #27694 rejection sampling, PR #26534 GLM-4.5-Air MTP, PR #24868 GLM-4.7-Flash MTP, PR #25589 Qwen3-Next MTP, PR #29761 Qwen4Exp MTP, PR #26177 MTP offload fix, PR #26296 load MTP only if used, Unsloth Qwen4 guide, ggml-org Qwen3.6-27B-MTP-GGUF, llama.cpp releases.