Deploying and Validating MTP Draft Models for Quantized LLMs: A Practical Guide
This guide explains how MTP heads differ from standard draft models in speculative decoding, how to estimate GPU memory for a quantized main model plus a draft model, how to confirm that both come from the same release, and how to configure, benchmark, and troubleshoot the deployment.
1. Distinguishing MTP, Speculative Decoding, and Draft Models
Standard LLM inference is autoregressive: each forward pass produces one token. When generating long text, this serial process takes a lot of time, and memory bandwidth and kernel scheduling overhead often become bottlenecks before raw compute does.
Speculative decoding works as follows. A low-cost draft module first proposes k candidate tokens. The main model then runs one parallel forward pass over those k positions and verifies the candidates one by one. Accepted candidates are kept. At the first rejected position, the main model resamples that token, and all later candidates are discarded.
Multi-token prediction (MTP) is a training objective. During training, the model learns to predict several positions ahead of the current one at the same time. Some publishers save these prediction modules separately, so they can be used as draft modules during inference. MTP is therefore one source of draft candidates, and not every model has it.
MTP heads differ from standard draft models as follows:
| Comparison | Standard draft model | MTP head |
|---|---|---|
| Source | A separate small model, trained on its own | Trained together with the main model and saved separately |
| Training dependency | No direct dependency on the main model | Depends on the main model’s training process and often reads the main model’s hidden states |
| Same-release requirement | Flexible pairing | Must be paired with the main model from the same release |
| Main risk | Low draft quality and low acceptance rate | A version mismatch can cause loading failures or a significant drop in acceptance rate |
Three conditions determine whether speculative decoding applies:
- The release page provides MTP weights, and the weights come from the same release as the main model.
- The inference framework supports the MTP decoding path for this model.
- GPU memory can hold both the main model and the draft weights, with room left for the KV cache.
If any one of these conditions is not met, do not expect speculative decoding to speed anything up. If the framework has no MTP path, you can use a standard draft model instead. If GPU memory is insufficient, the main model must decode on its own.
The acceptance rate determines the speedup. Under standard rejection sampling, the output distribution is statistically identical to decoding with the main model alone, so speculative decoding does not change the output probability distribution. However, the acceptance rate depends on the model, the task type, and the sampling temperature. Higher temperatures usually lower the acceptance rate. Structured text such as code and JSON is more predictable, so its acceptance rate is often higher. There is no fixed speedup factor. Measure it on your own workload.
2. GPU Memory Budget
2.1 Estimating Total Memory
Total GPU memory use breaks down into four parts:
Total ≈ main model weights + MTP draft weights + KV cache + framework and activation overhead
- Main model weights = parameter count × bytes per parameter. For quantized models, convert the bit width to bytes and add metadata such as scales. This usually adds 5% to 10%.
- MTP draft weights = draft parameter count × bytes per parameter.
- KV cache = 2 × number of layers × number of KV heads × head_dim × bytes per element × context length × number of concurrent requests.
- Framework and activation overhead covers the CUDA context, temporary tensors, and communication buffers. As a rule of thumb, reserve 2 to 4 GB, and confirm the actual value through measurement.
2.2 What PTQ and QAT Change
Quantization reduces the storage and memory footprint of weights. There are two common paths:
- Post-training quantization (PTQ): Convert the weights to a low-bit representation after training is complete. The process is simple, but accuracy loss is usually more noticeable at low bit widths.
- Quantization-aware training (QAT): Simulate quantization error during training so the weights adapt to a low-bit representation. At the same bit width, QAT usually preserves accuracy better.
A QAT version and an original-precision version of the same model have different memory footprints. Calculate the budget from the actual weight files in the release. Do not estimate it by multiplying the parameter count by the bit width.
Whether a PTQ or QAT main model can pair with an MTP draft depends on two things: whether the draft comes from the same release, and whether the framework supports that combination of quantization formats. Pair them only when both conditions are met. Do not pair a QAT main model with draft weights from a different release. Doing so lowers the acceptance rate, and framework documentation typically does not guarantee that the combination works.
2.3 Example Budget
Assume the following: the main model has 32B parameters and INT4 weights. The MTP draft has one layer, about 0.8B parameters, and uses BF16. The main model has 64 layers and 8 KV heads with a head_dim of 128, and the KV cache uses FP16. The context length is 8192, and the concurrency is 4.
| Item | Calculation | Example value |
|---|---|---|
| Main model weights | 32B × 0.5 bytes × 1.07 | About 17.1 GB |
| MTP draft weights | 0.8B × 2 bytes | About 1.6 GB |
| KV cache | 2 × 64 × 8 × 128 × 2 bytes, about 256 KB per token, then × 8192 × 4 | About 8 GB |
| Framework and activation overhead | Reserved estimate | About 4 GB |
| Total | About 30.7 GB |
Add about 10% headroom to the total. For this example, a GPU with 40 GB or more is a suitable choice, which helps avoid OOM errors caused by memory fragmentation. If the total exceeds the available memory, you can reduce concurrency, shorten the context, switch to a main model with lower bit width, or let the main model decode on its own. Avoid relying on CPU offloading. The data transfer overhead can cancel out all of the speedup.
3. Same-Release Validation and Directory Layout
3.1 Same-Release Checklist
Before deployment, check each item below. Load the models only after all items pass:
- The model family and version match. The release page version and the
model_typeinconfigare the same for both directories. - The vocabularies match. The tokenizer files have the same hash, and the vocabulary sizes are equal.
hidden_sizematches.- The number of layers matches. The MTP layer count field, such as
num_nextn_predict_layersin some DeepSeek-series configs, must match what the framework expects. - The MTP head version matches, and the weight key prefixes follow the format the framework expects.
- The quantization format matches, including the quantization method, bit width, and group size. The combination must be supported by the framework.
- The weight dtype matches the framework’s startup parameters.
- The framework version is at least the minimum version required by the model’s MTP decoding path.
The script below automates the comparison for the first three items and the tokenizer. The field names depend on the publisher’s config, so treat the script as an example:
import hashlibimport jsonfrom pathlib import PathMAIN = Path("models/main-model-int4")DRAFT = Path("models/mtp-draft")FIELDS = ["model_type", "hidden_size", "vocab_size"]main_cfg = json.loads((MAIN / "config.json").read_text(encoding="utf-8"))draft_cfg = json.loads((DRAFT / "config.json").read_text(encoding="utf-8"))for field in FIELDS:a, b = main_cfg.get(field), draft_cfg.get(field)status = "OK" if a == b else "MISMATCH"print(f"{status} {field}: main={a} draft={b}")def sha256(path: Path) -> str:return hashlib.sha256(path.read_bytes()).hexdigest()draft_tok = DRAFT / "tokenizer.json"if draft_tok.exists():same = sha256(MAIN / "tokenizer.json") == sha256(draft_tok)print("OK tokenizer" if same else "MISMATCH tokenizer")else:print("INFO: the draft directory has no tokenizer, so it will share the main model's tokenizer")
If the script prints any line with MISMATCH, stop the deployment. First confirm whether both directories come from the same release.
3.2 Directory Layout
Store the main model and the draft weights in two separate directories. Each directory should keep the complete set of release files. An example layout:
models/├── main-model-int4/ # Main model: all files from the same release│ ├── config.json│ ├── tokenizer.json│ └── model-*.safetensors├── mtp-draft/ # MTP draft weights: same release as the main model│ ├── config.json│ └── model.safetensors└── MANIFEST.txt # Source URL, version, and SHA256 for each file
Keep these points in mind during deployment:
- Do not overwrite one directory with the other. When you update one directory, confirm that the other one is updated to the same version.
- Set the model directories to read-only, so a running service cannot modify the files by mistake.
- When downloading gated models, store the access token in an environment variable such as
HF_TOKEN. Do not write it to a configuration file or a log.
4. Loading Configuration and Startup
Configuration field names differ between frameworks and change across versions. The configuration below shows what each parameter means. Confirm the exact field names in the documentation for your framework.
model:path: /data/models/main-model-int4quantization: int4 # Must match the actual format of the weight filesdtype: float16max_model_len: 8192gpu_memory_utilization: 0.90speculative:method: mtp # Name of the MTP draft method in the frameworkdraft_model_path: /data/models/mtp-draftnum_speculative_tokens: 2 # The k value. Start with 1 or 2.serving:max_num_seqs: 4default_temperature: 0.0
A larger num_speculative_tokens (k value) means the draft proposes more candidates per step. However, the probability that later positions get rejected also rises, so more draft computation is wasted. Start with a small k value, then adjust it based on the acceptance rate.
After startup, check the logs for these messages: the main model and draft model are both loaded, the MTP decoding path is enabled, and GPU memory usage roughly matches the budget in Section 2. If the logs report missing keys or shape mismatches, go back to Section 3 and check the versions.
If the framework provides an OpenAI-compatible API, send a short request to confirm that the output is normal:
curl http://localhost:8000/v1/chat/completions \-H "Content-Type: application/json" \-d '{"model": "main-model-int4","messages": [{"role": "user", "content": "Introduce yourself in one sentence."}],"temperature": 0}'
5. Feature Comparison, Acceptance Rate, and Throughput Measurement
5.1 Measurement Design
Run two groups for comparison:
- Baseline: the same main model with speculative decoding turned off.
- Experiment: the same main model with the MTP draft enabled and a fixed k value.
The prompt set should cover three task types: code, question answering, and structured output (JSON). Use at least 30 prompts per type, so the test does not cover only one kind of task. Keep the temperature, top_p, max_tokens, concurrency, and random seed identical in both groups. Before timing, warm up with 3 to 5 rounds to exclude the overhead of first-time loading and compilation. Repeat each group at least 3 times, and use the median as the result.
5.2 Functional Comparison
At temperature 0, the outputs of both groups should be mostly identical. Floating-point arithmetic introduces small differences, so a few samples may diverge in later text. This is normal. If most samples diverge within the first few dozen tokens, the implementation or the same-release configuration has a problem. Go back to Section 3 and investigate.
5.3 Acceptance Rate
Calculate the acceptance rate as follows:
Acceptance rate = number of accepted draft candidates ÷ total number of candidates proposed by the draft
Use a consistent counting method. Count only the candidates that actually went through main model verification, and state the counting method in your report.
5.4 Throughput and Latency
- Throughput (tokens/s) = total number of generated output tokens ÷ total elapsed time.
- Time to first token (TTFT): the time from sending a request to receiving the first token. Report P50 and P95.
- Time per output token (TPOT): the average time for each output token during the generation phase. Report P50 and P95.
Record the results in the following table:
| Metric | Baseline | MTP |
|---|---|---|
| Acceptance rate | Not applicable | To be measured |
| Throughput (tokens/s) | To be measured | To be measured |
| TTFT P50 / P95 (ms) | To be measured | To be measured |
| TPOT P50 / P95 (ms) | To be measured | To be measured |
Speedup = MTP throughput ÷ baseline throughput. Compare results only when they were measured under the same conditions. At high concurrency, the share of draft computation and verification overhead grows, so the gain may shrink. Measure at both low concurrency and your target concurrency.
6. Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| Loading fails with a key or shape mismatch | The draft and main model come from different releases, or the framework version is too old | Go back to Section 3, and check the same-release checklist and versions item by item |
| OOM at startup | Actual memory usage exceeds available GPU memory | Reduce the context length or concurrency, switch to a main model with lower bit width, or let the main model decode alone. Do not rely on CPU offloading |
| Acceptance rate is much lower than expected | Temperature is too high, k is too large, or the task is hard to predict | Lower the temperature, reduce k, and validate first on code tasks |
| Throughput drops | High concurrency increases the share of draft and verification overhead, or tight memory causes frequent paging | Re-measure at the target concurrency, and turn off MTP if needed |
| Output differs significantly from the baseline | The draft and main model come from different releases, or sampling parameters differ | Confirm that sampling parameters match, and check the same-release checklist |
| The framework has no MTP path | The framework does not support MTP decoding for this model | Use a standard draft model, or decode with the main model only |
7. Criteria for a Completed Deployment
A deployment is complete when all of the following are true:
- All three applicability conditions in Section 1 are met.
- All items in the same-release checklist pass.
- The measured GPU memory usage is within a reasonable range of the Section 2 budget, and the service runs stably.
- At temperature 0, the functional comparison shows that the outputs are largely consistent.
- Under the target workload, MTP throughput is higher than the baseline. If it does not meet expectations, troubleshoot using Section 6 before deciding whether to keep this configuration.
