Multi-Token Prediction for LLM Inference Acceleration
This article explains how multi-token prediction (MTP) drafts and speculative decoding reduce the number of target-model forward passes in autoregressive LLM inference. It covers the memory-bandwidth bottleneck, draft generation, parallel verification, acceptance and correction, quality-equivalence caveats, speedup factors, production deployment steps, evaluation criteria, and common pitfalls.
1. Background: The Performance Bottleneck of Autoregressive Decoding
Mainstream large language models generate text autoregressively, producing only one token per forward pass. To generate the Nth token, the model must read the parameters and cached data corresponding to the entire existing context.
In single-request, small-batch scenarios, compute units are idle most of the time, and the main system constraint comes from GPU memory and system memory read/write bandwidth. As models grow larger, more data must be moved per step, so simply adding compute capacity does not scale generation speed linearly.
A core direction for inference optimization is therefore to reduce the number of large-model forward passes required per generated token without significantly changing output quality. Speculative decoding and multi-token prediction drafts are designed around this goal.
2. The Basic Idea of Speculative Decoding
Speculative decoding splits inference into two roles:
- Draft model: smaller and faster, responsible for proposing a candidate token sequence.
- Target model: the actual large model, responsible for deciding whether candidate tokens can be accepted.
Its core assumption is straightforward: the more tokens the draft model guesses correctly, the greater the benefit of having the large model verify multiple positions in one forward pass. If the draft model guesses k tokens at once, the target model can verify k positions with a single forward pass. In theory, each forward pass can therefore produce multiple valid tokens.
The key is that verification is parallel. When the target model processes a longer input, its computation increases, but memory accesses remain roughly unchanged. Under bandwidth-limited conditions, parallel verification costs far less than generating tokens one by one.
3. How Multi-Token Prediction Drafts Work
A Multi-Token Prediction (MTP) draft model does not generate candidate tokens recursively one by one. Instead, through a designed output structure, it predicts multiple subsequent positions in one computation. This reduces the latency of the draft stage itself and makes the overall pipeline more compact.
A complete inference step can be divided into three stages.
3.1 Draft Generation
Based on the current context, the draft model predicts the next k candidate tokens at once and retains the probability distribution for each position. These distributions are used in subsequent verification to calculate acceptance probabilities and cannot be omitted.
3.2 Parallel Verification
The target model takes “current context + candidate tokens” as one input and performs a single forward pass to obtain the target probability distribution at each position. After this step, the system can determine whether each candidate token is consistent with the target model’s judgment.
3.3 Acceptance and Correction
The system checks candidates sequentially starting from the first candidate token. Once a position is rejected, it resamples a token at that position from the corrected distribution and discards all later candidates. If all candidates are accepted, it samples one additional token from the target model’s last position.
As a result, each step produces at least one token and at most k+1 tokens.
The following pseudocode illustrates the acceptance and correction logic. It is not a complete runnable implementation.
import randomdef speculative_step(target, draft, prefix, k):# 1. Draft model proposes k candidate tokens and their probabilities in one passcandidates, draft_probs = draft.propose(prefix, k)# 2. Target model performs a single forward pass to obtain target probabilities at each positiontarget_probs = target.score(prefix, candidates)accepted = []for i, tok in enumerate(candidates):p = target_probs[i] # Target model distribution at position iq = draft_probs[i] # Draft model distribution at position i# Accept the candidate token with probability min(1, p/q)if random.random() < min(1.0, p[tok] / q[tok]):accepted.append(tok)else:# On rejection, resample from the normalized residual distribution max(0, p - q)accepted.append(sample_residual(p, q))return prefix + accepted# If all candidates are accepted, sample one extra token from the target model's last positionaccepted.append(sample_from(target_probs[k]))return prefix + accepted
4. Understanding “No Quality Loss”
An important property of speculative decoding is that its output distribution can remain consistent with the distribution produced by direct decoding with the target model. This follows from the acceptance and correction rules above: accepted tokens follow the target model distribution, and resampling after rejection also follows the corrected distribution. Together, they guarantee the correctness of the final sampling result.
Two cases should be distinguished.
- Greedy decoding: each step selects the highest-probability token. In this case, as long as the verification logic is correct, the output is exactly the same as that of the original target model and can be compared token by token.
- Random sampling: the output distribution is theoretically consistent, but a single result may vary because of different random numbers. Evaluation should therefore rely on statistical metrics.
Thus, “no quality loss” should be understood as a mathematically grounded distribution equivalence, not a promise that holds for every engineering implementation. Numerical precision, random number management, and batching methods can all introduce subtle differences, which need to be verified separately in testing.
5. Speedup and Influencing Factors
Publicly available material reports that such approaches can achieve about a 3× generation speedup under specific conditions. This figure is the result of a particular combination of model, hardware, task, and parameters and should not be treated as a universal value. Actual gains mainly depend on the following factors.
- Acceptance rate: the proportion of draft tokens accepted by the target model. The higher the acceptance rate, the more valid tokens each verification produces. Acceptance rate is strongly affected by draft model quality, task type, and sampling temperature. Highly predictable tasks such as code completion and templated text usually have higher acceptance rates, while open-ended generation is relatively lower.
- Candidate length k: as k increases, the potential gain per step increases, but the probability that later candidates are rejected also rises, increasing wasted draft computation. k needs to be tuned together with the acceptance rate curve, and there is usually an optimal range.
- Batch size: with larger batches, compute unit utilization improves and the bandwidth-limited situation is alleviated, so the relative benefit of speculative decoding may decrease. High-concurrency services usually need separate evaluation.
- Draft model overhead: the GPU memory and time consumed by the draft stage itself must be included in the total cost. A draft model that is too large can offset the speedup.
- Hardware and runtime: memory bandwidth, cache size, operator fusion, and scheduling policy all affect final throughput.
6. Implementation Steps for Production
To introduce such a scheme into a production environment, the following steps are recommended.
Step 1: Establish a Baseline
Without enabling speculative decoding, measure the target model’s time to first token, output tokens per second, GPU memory usage, and tail latency under different concurrency levels. Baseline data is the only basis for later judging gains.
Step 2: Evaluate the Draft Model
Use representative business data to measure the draft model’s acceptance rate and plot the acceptance rate curve as k changes. If the acceptance rate remains low for a long time, consider replacing the draft model or adjusting the task scope before discussing performance optimization.
Step 3: Canary Validation
First enable speculative decoding in small traffic or offline batch jobs and check output consistency. In greedy mode, compare token by token. In sampling mode, compare distribution differences in quality evaluation metrics.
Step 4: Monitoring and Rollback
After launch, continuously monitor throughput, latency, acceptance rate, and error rate. If an anomaly occurs, it should be possible to quickly switch back to the normal decoding path without affecting service availability. Configuration changes should be possible through a feature flag to avoid redeployment.
7. Selection and Evaluation Criteria
When choosing an acceleration scheme, compare it from the following dimensions.
- Correctness: whether it has strict acceptance and correction logic and whether it can pass consistency tests.
- Benefit stability: how much throughput improvement fluctuates under different business workloads.
- Resource cost: additional GPU memory, training, and maintenance costs of the draft model.
- Integration complexity: whether internal logic of the inference framework must be modified and what compatibility risk exists during upgrades.
- Rollback capability: whether it can be quickly disabled when problems occur without affecting existing services.
For evaluation, at least pay attention to the following metrics: output tokens per second, end-to-end latency per request, average accepted tokens per step, acceptance rate, peak memory, and regression test results for output quality.
8. Common Pitfalls
- Looking only at peak multipliers: the highest advertised speedup usually comes from the most favorable conditions. Use the average performance and tail latency of your own workload as the basis.
- Ignoring concurrency effects: good single-request test results do not mean there is still a gain under high concurrency.
- Neglecting draft quality: when the distribution gap between the draft model and the target model is too large, the acceptance rate drops significantly and the overall system may become slower.
- Skipping consistency tests: launching without verifying output distribution or greedy-result consistency may introduce hard-to-detect bias in long-tail scenarios.
- Treating speedup as the only goal: inference cost, response quality, and system stability need to be weighed together. Improvement in a single metric does not necessarily create overall value.
9. Conclusion
The combination of multi-token prediction drafts and speculative decoding targets the bandwidth bottleneck in large-model inference. Through a process of “draft proposal, parallel target verification, and rule-based acceptance or correction,” it reduces the number of large-model forward passes and thereby improves generation speed.
Its quality guarantee comes from strict acceptance and correction rules, not from empirical approximation. Actual gains, however, depend heavily on acceptance rate, task type, concurrency scale, and hardware conditions. During deployment, establish a baseline first, then evaluate draft quality, proceed gradually through canary validation and monitoring, and retain the ability to roll back at any time.
