How Draft Models Accelerate Local LLM Inference by Several Times
This article explains why memory bandwidth—not compute—is the real bottleneck in local LLM inference, and how speculative decoding with a draft model overcomes it. It covers the propose-and-verify mechanism, why average acceptance length determines the speedup ceiling, how to choose a draft model, key engineering considerations such as KV Cache management and dynamic draft length, and a simplified code example. It also outlines when speculative decoding is worth adopting and when it is not.
First, the Bottleneck: The GPU’s “Bandwidth Anxiety” During Decoding
LLM inference is typically divided into two phases: prefill and decoding.
During prefill, the model processes the entire user prompt, computes attention, and builds the KV Cache. Because many tokens are processed in parallel, GPU compute utilization is high, and speed is largely determined by raw compute power.
Once decoding begins, everything changes. To generate each token, the model must read all of its weights, read the existing KV Cache, and write new key-value entries into the cache. This process repeats for every subsequent token. For a model of tens or even hundreds of gigabytes, generating a single token effectively means moving all weights through memory from start to finish.
As a result, when running LLMs locally, the real bottleneck is usually not compute capability but memory bandwidth. No matter how powerful the GPU is, generation speed is capped if data movement can’t keep up. This is also why simply upgrading to a more powerful GPU with more compute does not necessarily yield linear gains.
The Core Idea of Speculative Decoding: The Draft Model Proposes, the Target Model Verifies
Speculative decoding changes “token-by-token generation” into “guess in batches, then verify all at once.”
A smaller, faster draft model first generates K candidate tokens based on the current context. These candidates are not used directly as final output. Instead, they are passed to the target model for a single forward pass that verifies whether they match the target model’s own probability distribution.
For example, given the input “The cat”, the draft model might predict “sat on my lap” in one go. The target model then runs a single forward pass over this candidate sequence to obtain the probability at each position. If the first few tokens align with high-probability positions of the target model, they are accepted. Once a position is rejected, all subsequent candidates are discarded, and the target model samples a corrected token at that position.
One key point: the final output is not decided by the draft model—it is verified by the target model.
Why It Speeds Things Up: Turning “Repeated Loading” into “One Verification”
In traditional decoding, the target model loads its full weights once for every token it generates. Producing 4 tokens theoretically requires 4 forward passes—4 full weight loads.
Speculative decoding restructures the flow as follows:
- The draft model quickly generates K candidate tokens.
- The target model scores all K candidate positions in a single forward pass.
- Several of the candidates are accepted.
- The next round starts from the context after the accepted position.
In this way, multiple weight loads are compressed into one verification pass. Even though the verification forward pass involves more computation than a single-token forward pass, in a bandwidth-bound local environment, the gains from reducing weight movement far outweigh the extra compute cost.
Note that speculative decoding is not a free lunch. The draft model itself consumes compute and memory, and the target model’s verification pass must process a longer candidate sequence. The factor that truly determines the payoff is a core metric: average acceptance length.
The Speedup Ceiling: Average Acceptance Length Decides Everything
Average acceptance length refers to how many draft tokens the target model accepts per verification round, on average. It directly determines the acceleration effect of speculative decoding.
Suppose the draft model generates 4 candidate tokens each round, and the target model accepts 3 of them in one verification pass. That single forward pass advances 3 tokens—roughly a 3x speedup compared with 3 separate forward passes.
But if the draft model frequently guesses wrong, and the target model accepts only 1 or even 0 tokens per round, the picture is very different: the draft model’s compute is wasted, and the target model still performs an extra verification pass. The end result can be slower than not using speculative decoding at all.
Therefore, the effectiveness of speculative decoding doesn’t depend on how fast the draft model can write, but on how likely its output is to be accepted by the target model.
In theory, when rejection sampling is used, the final output distribution is identical to the target model’s autoregressive sampling distribution. In other words, output quality is guaranteed by strict probability, not by “feeling close enough.”
Choosing a Draft Model: Small, Fast, and Aligned with the Target Model
Choosing the draft model is the most critical step in engineering implementation. It cannot be understood as “just picking any smaller model.”
First, the draft model must be small enough that generating candidate tokens is cheap. If the draft model itself needs to load large amounts of weights, the time saved is eaten up by the draft model.
Second, the draft model should be as “distributionally similar” to the target model as possible. The closer the two models’ probability distributions are at the same context position, the higher the acceptance rate. A practical approach is to use a model from the same family with several orders of magnitude fewer parameters, or to obtain a lightweight version through knowledge distillation. This makes it easier for the draft model to mimic the target model’s output style rather than producing wild, off-target text.
Additionally, the draft model can be adapted to the target domain. In tasks with strong predictability—such as code completion, structured data generation, or fixed-format output—the draft model is more likely to guess correctly. In open-ended creative writing or complex multi-step reasoning, the acceptance rate drops noticeably.
Engineering Considerations
Reuse and Truncation of the KV Cache
In speculative decoding, the draft model and the target model each maintain their own KV Cache, and the two cannot be mixed. When the target model verifies the candidate sequence, it generates a new set of KV Cache entries for the candidate tokens.
If some tokens are accepted, their KV Cache entries can be reused for subsequent generation. Once a position is rejected, the KV Cache from that position onward must be discarded, and correct KV data must be regenerated. This “truncation” process sounds simple, but in distributed or batched scenarios it requires very careful management—otherwise, context misalignment is easy to introduce.
Dynamically Adjusting Draft Length
The draft length K is not “the bigger, the better.” A larger K means more computation in the target model’s single verification pass. If the acceptance rate of the later candidate tokens is low, the cost-benefit ratio deteriorates. A reasonable approach is to adjust K dynamically: increase draft length when the context is stable and acceptance rates are high; shorten it when the context shifts sharply and acceptance rates drop, or even temporarily fall back to traditional decoding.
Batching and Concurrency
In concurrent-request scenarios, speculative decoding can also improve throughput. The target model can verify candidate sequences from multiple requests in a single batch, loading weights only once to serve many requests. Compared with single-request latency improvements, throughput gains under concurrency depend more heavily on the target model’s batching operators and memory planning. If the draft model also maintains context for each request, memory pressure increases accordingly, so a comprehensive evaluation is needed.
Code Walkthrough
Below is a simplified example illustrating the “draft generation + target verification” flow:
import randomdef speculative_decode(draft_model, target_model, prompt_tokens, max_new_tokens, draft_k=4):generated = list(prompt_tokens)while len(generated) - len(prompt_tokens) < max_new_tokens:# 1. Draft model quickly generates candidate tokenscandidates = draft_model.generate(generated, k=draft_k)# 2. Target model scores the candidate sequence in one passtarget_scores = target_model.score(generated + candidates)# 3. Decide whether to accept each candidate tokenfor i, token in enumerate(candidates):target_prob = target_scores[len(generated) + i][token]draft_prob = draft_model.prob(token, generated + candidates[:i])# Acceptance condition: target probability is no lower than draft probability,# or accept with probability proportional to their ratioif target_prob >= draft_prob or random.random() < target_prob / draft_prob:generated.append(token)if len(generated) - len(prompt_tokens) >= max_new_tokens:breakelse:# Rejected: sample a token from the corrected target distributiongenerated.append(sample_from_corrected_distribution(...))breakreturn generated
This code demonstrates only the core idea. Real systems must also handle token mapping, batch padding, KV Cache lifecycle, sampling parameter consistency, truncation strategies, and other details.
When Is It Worth Using?
Speculative decoding is best suited to scenarios that are already constrained by memory bandwidth, where the target model has large weights and the decoding sequence is long. If the target model is already small and fast, the overhead introduced by a draft model can become a burden instead.
Scenarios that typically see clear benefits:
- Local single-GPU deployment of large models where memory bandwidth is the main bottleneck;
- Highly predictable outputs, such as code completion, structured data extraction, or fixed-template generation;
- An existing lightweight model from the same family, requiring no additional training cost;
- High request concurrency, where reducing weight-load frequency improves overall throughput.
Scenarios that require caution:
- Memory is already very tight, and adding a draft model would trigger overflow;
- Highly open-ended tasks where the draft model’s acceptance rate is very low;
- The target model is already small enough that the time saved by the draft model doesn’t cover verification overhead;
- The business is highly sensitive to deployment complexity and unwilling to take on extra model and cache management costs.
Final Thoughts
Speculative decoding is not a “magic solution” that requires new GPUs or compressing the main model to deliver gains. Its core contribution is transforming the serial process of “reading all weights for every token” into an efficient collaboration where “a small model guesses first, and a large model verifies in one pass.”
In local inference scenarios, when you find that model response speed is pinned near the memory bandwidth limit, introducing a well-chosen draft model is often one of the most cost-effective optimizations available. For inference services deployed on cloud platforms, the draft model and target model can also be integrated into the same serving pipeline, combined with general capabilities such as elastic compute, monitoring, and alerting for canary testing and load testing—making the speedup measurable and operable.
