Speculative Decoding with Multi-Token Prediction Draft Models for Faster LLM Inference
This article explains how to accelerate large language model inference with speculative decoding and multi-token prediction (MTP). It covers why autoregressive decoding is bottlenecked by memory bandwidth, how draft models and target models work together to verify multiple tokens per step, and how MTP can serve as a lightweight draft through self-speculation and shared-backbone designs. It also walks through key tuning dimensions (draft length, draft-target alignment, tree-based verification, KV cache management, and batching), training and alignment practices, cloud deployment considerations, and common pitfalls. Developers will learn how to achieve lossless speedups without sacrificing output quality.
1. Why LLMs Need to Predict More Than One Step
Mainstream large language models generate text with autoregressive decoding: at each step the model emits a single token, appends it to the input sequence, and runs a full forward pass to produce the next token. This token-by-token approach has a structural bottleneck—during generation, real-world performance is often constrained by memory bandwidth rather than compute. Producing each token requires moving the large model weights and the growing KV cache from GPU memory to the compute units, while those compute units frequently sit idle, underutilized.
This raises an intuitive question: if every step pays the fixed cost of “reading all the weights,” why not produce several tokens at once and raise the output efficiency of a single forward pass? Multi-token prediction is a family of techniques built around exactly this simple goal.
2. The Core Idea of Multi-Token Prediction (MTP)
Multi-Token Prediction (MTP) lets a model predict not only the next token in a single forward pass but also several future positions. Traditional training supervises just one objective at each position—the “next token.” MTP, by contrast, sets prediction targets at multiple future positions (typically via additional prediction heads, or a multi-head structure sharing a common backbone), training the model to “see further ahead.”
Two points are worth emphasizing. First, MTP can serve as a training objective that improves the quality of the backbone representations. Second, when used for inference acceleration, it is often combined with the “draft model + target model” speculative decoding framework.
3. Draft Models and Speculative Decoding: Verify Multiple Tokens at Once
Speculative decoding involves two roles:
- Draft Model: A lightweight model that is small, fast, and whose output distribution stays as close as possible to the main model. It quickly proposes a candidate token sequence autoregressively—essentially, “guess first.”
- Target Model: The large model that actually serves requests. It verifies the candidate sequence proposed by the draft model in parallel.
The workflow can be summarized as follows:
- The draft model generates γ candidate tokens in sequence.
- The target model feeds these candidate tokens together with the current context into a single forward pass (verification is parallel, so compared to computing just one token, the added cost is limited).
- Based on its own probability distribution, the target model decides, token by token, whether each candidate can be accepted.
- The accepted prefix is adopted directly. At the first rejected position, a token is resampled from the target model’s distribution as a “correction.”
- A single iteration often lands multiple tokens, not just one.
The key point: under the standard acceptance criterion, the output distribution of speculative decoding is equivalent to sampling token by token directly from the target model. It is therefore a form of “lossless acceleration”—it does not sacrifice generation quality, only trades for speed. The speedup depends on two core factors: the draft acceptance rate (the more accurate the guesses, the more tokens pass in one round) and the relative cost of a single parallel verification by the target model.
Illustrative pseudocode:
def speculative_generate(context, draft_model, target_model, gamma):output = []while not finished:# 1. The draft model quickly proposes gamma candidate tokenscandidates = draft_model.draft(context + output, num_tokens=gamma)# 2. The target model verifies the whole candidate sequence in paralleltarget_probs = target_model.verify(context + output, candidates)# 3. Accept tokens one by one; at the first rejection, correct with the target distributionaccepted = 0for i, tok in enumerate(candidates):if accept(tok, target_probs[i]):output.append(tok)accepted += 1else:output.append(target_model.resample(target_probs[i]))break# 4. If all tokens are accepted, commit one extra tokenif accepted == gamma:output.append(target_model.resample_next())return output
4. MTP as a Draft: Self-Speculation and Multi-Head Structures
There are two common forms of combining MTP with speculative decoding:
- Independent draft model: Use a small model as the draft. This is simple to implement, but requires maintaining two sets of weights, and the alignment between their distributions determines the acceptance rate.
- Self-speculation / shared backbone: Attach additional multi-token prediction heads directly to the target model and reuse the backbone’s hidden states to produce subsequent candidates. This “self-drafting” approach eliminates the separate small model, reducing memory footprint and engineering complexity, and has drawn considerable attention in recent years.
In either form, the core goal is to make the draft distribution match the target distribution as closely as possible, in order to raise the acceptance rate.
5. Key Tuning Dimensions
- Draft length γ: Too short and the speedup is limited; too long and the draft becomes less accurate toward the end, the rejection probability rises, and verification overhead is wasted. It must be balanced against task characteristics.
- Draft-target consistency: The better the two are aligned, the higher the acceptance rate. This can be improved through distribution-level alignment training.
- Tree-based / branching verification: Instead of verifying a single candidate path, verify multiple branching candidates (with a dedicated attention mask), using one target forward pass to explore several possibilities and further raise the expected accepted length.
- KV cache management: Drafting and verification read and write the cache frequently, so the strategy for cache reuse and reclamation directly affects throughput.
- Batching: Different requests have different accepted lengths, which creates “uneven” batch lengths. Sensible scheduling and padding strategies are needed to avoid wasting compute.
6. Training and Alignment Essentials
If you use an independent draft model or additional prediction heads, training typically focuses on: making the draft/prediction-head token distribution as close as possible to the target model’s. Common practices include distillation-style alignment using the target model’s outputs as supervision, sharing part of the backbone parameters to reduce cost, and fine-tuning on task-specific data. The higher the alignment quality, the fewer candidates are rejected at runtime, and the more stable the acceleration gains.
7. Engineering Implementation and Cloud Deployment
When putting a multi-token prediction acceleration scheme into practice, consider the following directions:
- Heterogeneous compute: When deploying on accelerators such as GPUs, take full advantage of the parallel verification feature to turn the originally bandwidth-bound decoding step into a more compute-intensive one, improving hardware utilization.
- Containerization and elastic scaling: Use a container platform to package the draft and target models together, wrap the inference service, and combine it with elastic scaling to handle traffic fluctuations.
- Artifact and weight management: Large files such as model weights and prediction heads can be stored in object storage, with version management and fast loading.
- Observability: Connect to logging services and monitoring/alerting to continuously track key metrics such as first-token latency, tokens produced per step, acceptance rate, throughput, and memory usage, and drive tuning with data. For example, on Baidu AI Cloud, you can build an observable, elastically scalable inference service by combining general-purpose capabilities such as heterogeneous compute resources, a container platform, object storage, and monitoring/alerting.
8. Common Pitfalls and Best Practices
- Pitfall 1: Bigger drafts are always better. An oversized draft loses the “lightweight” advantage, cancels out the benefit of parallel verification, and should be avoided. Prioritize keeping the draft fast and closely aligned.
- Pitfall 2: A constant speedup. Actual gains are strongly tied to the task distribution, batch size, and draft length. Always benchmark against real production traffic.
- Pitfall 3: Ignoring high-concurrency scenarios. When the service is already under heavy load and compute is maxed out, the relative gains from lossless acceleration may narrow. Assess whether it is still worthwhile.
- Best practice: First use offline evaluation to determine the draft length and acceptance rate, then roll out with canary testing to observe end-to-end latency and throughput, forming a closed loop of “evaluate—canary—tune.”
9. Summary
The value of multi-token prediction draft models lies in converting the bandwidth-bound serial steps of autoregressive decoding into more productive parallel computation, through “guess more at once, verify in parallel”—reducing latency and improving throughput without harming output quality. It is not a single algorithmic trick, but a systems engineering effort requiring model alignment, cache management, batch scheduling, and observability to work together. For developers, the key to truly bringing inference acceleration into production is understanding its “lossless acceleration” nature, mastering the tradeoff between draft length and acceptance rate, and pairing it with elastic cloud infrastructure for data-driven, continuous tuning.
