Multi-Token Prediction Draft Models and Speculative Decoding: An Engineering Guide

    This article explains how speculative decoding with multi-token prediction (MTP) draft models alleviates the memory-bandwidth bottleneck in LLM inference. It covers the draft–verify–accept workflow, two key techniques (Target Activations and KV Cache Sharing), a comparison of common drafting strategies, and a practical checklist for deployment and acceptance-rate monitoring.

    Multi-Token Prediction Draft Models and Speculative Decoding: An Engineering Guide

    When a large language model generates text, each forward pass typically produces only one token. GPU compute sits largely idle during this process because model weights and the KV cache must be repeatedly loaded from memory into the compute units. This condition is known as being memory-bound—the classic memory bandwidth bottleneck. Multi-token prediction (MTP) draft models combined with speculative decoding are a common approach to easing this bottleneck. This article explains the workflow, describes two techniques—Target Activations and KV Cache Sharing—and lists what to check during deployment and monitoring.

    1. How Speculative Decoding Works

    The core of speculative decoding is “draft and verify.” A lightweight draft model first proposes a sequence of candidate tokens, and the main model then checks all of them in a single forward pass. The main model’s forward pass is expensive, but verifying several tokens at once costs about the same as verifying one—and that is where the speedup comes from.

    1.1 Drafting

    The draft model has few parameters and low compute cost. Within the time the main model would take to generate a single token, it sequentially produces multiple candidate tokens. The number of candidates is configurable, typically ranging from a few to a dozen or so. The faster the drafting phase, the greater the overall benefit. However, longer drafts carry a higher risk of rejection.

    1.2 Verification

    The main model feeds the context together with all candidate tokens into one forward pass and obtains its own predicted distribution at every position. This replaces what would otherwise be serial, token-by-token computation with a single batched computation, reducing the number of times weights and the KV cache must be read from memory.

    1.3 Acceptance and Rejection

    Verification has two outcomes.

    • Full acceptance: All candidate tokens match the main model’s predictions and are accepted. Because the main model also produces a token for the next position within the same forward pass, the number of tokens generated in one step is the number of candidates plus one.
    • Partial acceptance: Starting from the first mismatch, that position and all subsequent candidates are discarded. The mismatched position is replaced with the main model’s own prediction, and the next drafting round continues from this new token.

    With identical sampling parameters and standard rejection sampling rules, the final output distribution matches the distribution the main model would produce on its own. Under greedy decoding, the output text is exactly the same as token-by-token generation by the main model. This is what “lossless acceleration” means: the output distribution is guaranteed to be unchanged, while the actual speedup still depends on the specific environment.

    2. Target Activations: Giving the Draft Model Access to the Main Model’s State

    A draft model relying solely on its own parameters struggles to capture the deep semantics of long contexts. Target Activations addresses this by feeding the main model’s hidden states to the draft model.

    Specifically, the system takes the hidden state from the main model’s final layer (before the language model head), concatenates it with the embedding of the draft model’s current input token, and projects the result through a linear layer into the draft model’s hidden dimension. The draft model thereby gains access to the main model’s understanding of the current context.

    Across multiple drafting rounds, the input source changes. The first round uses the hidden state just computed by the main model. In each subsequent round, the draft model concatenates its own hidden state from the previous round with the new token, then applies the projection. This preserves the high-quality guidance of the first round while keeping multi-round predictions coherent.

    Three points require attention during implementation:

    • Layer alignment between the draft model and the main model must be consistent; otherwise, the semantics of the injected state will be misaligned.
    • Positional encoding must use the same position indices as the main model, or the draft model will read the context at wrong positions.
    • If the draft model and the main model share embeddings or the output head, verify that both use the same weight versions.

    3. KV Cache Sharing: Reducing the Draft Model’s Cache Overhead

    The Transformer KV cache stores keys and values of historical tokens to avoid redundant computation, but it consumes substantial GPU memory, and reading it costs bandwidth. If the draft model maintains its own independent KV cache, both memory footprint and write overhead increase.

    KV Cache Sharing lets the draft model directly read the KV cache already computed by the main model:

    • Local attention layers: The draft model’s local attention layers reuse the main model’s most recently computed local KV cache.
    • Global attention layers: The draft model’s global attention layers connect to the global KV cache of the main model’s final layer.

    With sharing, the draft model no longer generates or stores its own KV for historical tokens, saving the corresponding memory and write bandwidth. The draft model still computes its own queries, attention scores, output projections, and MLPs, so its computation is not zero. The benefit of this technique lies mainly in memory and memory access, not in eliminating computation entirely.

    Several prerequisites apply:

    • The shared draft layers and main-model layers must match structurally, including the number of heads, dimensions, and cache layout.
    • Causal masks and positional encodings must be consistent, or attention results will diverge from the main model.
    • The main model’s cache must not be overwritten after draft writes; otherwise, the verification phase would read corrupted data.

    4. Comparing Drafting Approaches

    The table below compares three common drafting approaches. The assessments are relative and qualitative; concrete numbers must be measured on your own model and hardware.

    Approach Extra Memory Draft Compute Cost Acceptance Rate Potential Main Risks
    Standalone small model as drafter High—separate weights and KV cache required Medium—depends on model size Limited by the small model’s capability Low acceptance when its distribution diverges from the main model
    MTP draft with KV Cache Sharing Low—reuses the main model’s cache Low to medium Relatively high—can leverage Target Activations Layer structure and masks must be strictly aligned; complex implementation
    Tree-based candidate verification Medium—candidate branches add cache usage Medium to high High—multiple paths verified simultaneously Higher verification overhead; complex scheduling

    When choosing an approach, consider the following order: first confirm that the main model is genuinely memory-bound, then evaluate your workload’s output lengths and the implementation complexity you can accept, and finally use measured acceptance rates to determine the draft length.

    5. Engineering Checklist

    Deployment Environment

    • GPU memory: Reserve headroom for the combined footprint of the main model, the draft model, and the KV cache. For long-context scenarios, size it based on the maximum context length.
    • Bandwidth and interconnect: Data exchanges between the draft and main models are frequent. Deploy them on the same node, or use GPU instances with high-bandwidth interconnects.
    • Weight loading: If model weights are loaded from object storage or a shared file system, complete the loading during startup to avoid I/O waits during inference.
    • Framework versions: The inference framework and the draft model architecture must be version-compatible. Validate in a test environment before upgrading.

    Acceptance Rate Monitoring

    The acceptance rate directly determines the speedup. The speedup can be estimated as:

    Speedup ≈ average number of tokens produced per step ÷ the per-step latency after enabling speculative decoding