MTP Speculative Decoding for Local Deployment: Files, Parameters, and Benchmarks
This article explains how to deploy MTP speculative decoding locally with llama.cpp, covering the required draft files, launch parameters, verification steps, throughput measurement, VRAM budgeting, troubleshooting, and best practices. It emphasizes that MTP only takes effect when the framework, model files, and launch configuration all match, and that actual speedup depends on draft acceptance rate and should be validated on your own hardware.
1. Key Takeaways
MTP speculative decoding takes effect only when three conditions are met at the same time: the inference framework version supports MTP drafts, the main model and draft file come from the same release and matching version, and the draft file is explicitly loaded at launch. If any of these is missing, inference falls back to standard autoregressive decoding, and speed will not improve.
2. How It Works and Where It Applies
An MTP model has one or more draft prediction heads in addition to the main prediction head. A single forward pass can propose candidates for several subsequent tokens. The inference framework lets the main model validate these candidates in one pass; accepted tokens are kept, allowing multiple tokens to be produced in one decoding cycle.
The speedup depends on the draft acceptance rate. In structured outputs such as code generation and JSON, candidate tokens are usually easier to accept, so the benefit is more noticeable. In highly open-ended creative writing, the acceptance rate is lower, the benefit shrinks, and the extra draft computation may even offset the gain. Therefore, this article does not give a fixed multiplier. Use benchmark results from your own machine as the reference.
3. Preparing Files
- First check the file list on the model release page. Different repositories are organized differently: some place draft heads in a subdirectory or a separate file, while others do not include draft heads at all. Do not guess based on directory names; verify each item.
- The main model and draft file must come from the same model family and the same release batch. If their architecture or vocabulary differs, loading may fail, or the acceptance rate may be zero.
- After downloading, check file sizes and checksums:
ls -lh ./models/sha256sum ./models/*.gguf
Compare the output SHA256 values with those provided on the release page, and continue only when they match.
4. Launch Command
The following example uses llama.cpp. The loading parameter and parameter names for draft models may change between versions, so first run llama-cli --help to confirm the syntax supported by your current version. The command below illustrates the structure; replace the filenames with the files you actually downloaded:
llama-cli \-m ./models/main-model-qat-q4.gguf \-md ./models/mtp-draft.gguf \--draft-max 8 \-ngl 99 \-c 8192
Parameter meanings: -m specifies the main model, -md specifies the draft model, --draft-max limits the number of draft tokens per round, -ngl sets the number of layers offloaded to the GPU, and -c sets the context length. For CPU-only use, remove -ngl.
5. Confirming Whether MTP Is Actually Active
- Check the startup log to confirm that the draft model loaded successfully. Log wording varies by version; the simplest approach is to save two startup logs, one with
-mdand one without, and compare the differences. - If your version outputs acceptance rate or speculative decoding statistics, record that value. A very low acceptance rate means the draft is not very helpful for the current task.
- If the log contains no draft-related information at all, inference has most likely fallen back to standard decoding. Go back to Sections 3 and 4 and check the files and parameters.
6. How to Measure Throughput
Results from a single run are affected by system load, VRAM state, and caching, so they can fluctuate significantly. Use the following steps:
- Use the same prompt, fix the output length, and set sampling temperature to 0 so both comparison groups receive identical input.
- Warm up once or twice first; do not count warm-up results.
- Repeat each group at least 5 times and take the median generation speed in tokens/s.
- Record results with
-mdand without-mdseparately, then calculate the ratio. - Also record VRAM usage to determine whether the speedup comes at a VRAM cost.
7. VRAM Budget
VRAM requirements roughly consist of four parts: main model weights, draft model weights, KV cache, and compute buffers. The KV cache can be estimated with the following formula:
KV cache (bytes) ≈ 2 × layers × KV heads × head dimension × context length × bytes per element
The coefficient 2 represents the two caches for K and V. With FP16, bytes per element is 2. If the context length doubles, the KV cache also doubles. When VRAM is tight, reduce context length first, then consider a lower quantization level.
8. Troubleshooting Common Issues
| Symptom | Possible cause | Check | Fix |
|---|---|---|---|
| Startup error indicating tensor or architecture mismatch | Framework version is too old, or the main model and draft are not from the same family | Check the framework version and release notes, and compare the model names of both files | Upgrade the framework, or replace with files from the same batch |
| Draft file not found | Draft file was not downloaded, or the path is wrong | Use ls to check the path and compare against the release page file list |
Download the draft file and use an absolute path |
| Out of VRAM at startup | Draft weights and KV cache are occupying memory together | Estimate with the formula in Section 7 and observe VRAM allocation in the startup log | Lower -c, use a lower quantization level, or reduce the number of GPU-offloaded layers |
| Speed is essentially the same as without a draft | Draft is not active, or acceptance rate is very low | Check the logs and compare tokens/s with and without -md |
Confirm the parameters are active, then retest with a structured-output task |
9. Best Practices
- First run a baseline without the draft command to confirm that the model produces normal output, then add
-md. - Change only one parameter at a time so issues are easier to isolate.
- Record the launch command, framework version, and file checksums in a script or README for future reproduction.
- Use relative paths or environment variables for model paths; do not hardcode absolute paths and secrets directly into scripts.
10. Conclusion
Local deployment of MTP with QAT can be summarized in three steps: verify the file list and version compatibility, explicitly load the draft file at launch, and confirm the speedup with throughput measurements using the same prompt. Once these three steps are complete, you can determine whether the speedup is actually happening and which types of tasks benefit most.
