Accelerating LLM Generation Without Upgrading GPUs: Draft Models and Speculative Decoding Practices
This article explores how speculative decoding can accelerate large language model (LLM) generation using draft models without altering model precision or upgrading hardware. It covers the underlying mechanics of speculative decoding, including the bottlenecks of prefill versus decode phases, acceptance criteria, and the probability rules that ensure output distribution consistency. Additionally, it provides practical guidelines for local deployment, performance testing, and determining when this optimization provides genuine benefits.
1. From Sequential Generation to Propose-and-Verify
Can we speed up the same large language model on the same device without reducing model precision or altering the generation task?
The answer is: under the right conditions, yes. The key is not to shrink the target model, but to change how it advances the output sequence.
Traditional autoregressive decoding typically determines only one new token per round of target model computation. Speculative decoding introduces a low-cost draft model that first proposes several candidate tokens consecutively, which are then verified in a batch by the target model. As long as a sufficiently long continuous prefix of the candidates is accepted, one round of target model computation can advance multiple positions.
A token here is the basic unit of text processed by the model and does not necessarily correspond to a single word or character. Therefore, performance discussions should prioritize “tokens generated per second” rather than simply “words per second.”
Some tests have observed up to a 4x speedup in single-request generation, but this should not be taken as a universal guarantee. Target model size, draft model cost, candidate acceptance rate, context length, concurrency, and implementation details all affect the final outcome. Understanding these conditions is more important than memorizing a specific multiplier.
2. Why Generation Remains Slow Despite Powerful GPUs
1. Prefill vs. Decode Face Different Bottlenecks
A text generation process typically involves two phases.
The prefill phase processes the user’s entire input prompt, calculates representations for each layer, and builds the attention key-value cache (KV Cache) required for subsequent generation. Because it can process multiple input positions simultaneously, this phase usually has a high degree of parallelism.
The decode phase continuously generates new tokens based on the existing context. For a single sequence, subsequent positions depend on previously determined results, making direct parallelization impossible, unlike processing the entire input.
This explains a common phenomenon: a model might read a long prompt very quickly, but its response must still be output step-by-step.
2. Low-Concurrency Decoding is Memory-Bandwidth Bound
During each step of decoding, the target model must access a massive number of parameters and read the cache for the current context. Once the new position is calculated, the key-value data for that position is appended.
In low-batch scenarios, the incremental computation per round is relatively limited, yet it still involves substantial parameter reads, leading to an unfavorable ratio between computation and data transfer. At this point, even if the device has strong theoretical compute power, it may fail to perform optimally due to insufficient memory bandwidth.
It is important to note that this does not mean “every token requires reloading the entire model from system memory to the GPU.” When the model resides in VRAM, the main issue is the access to parameters and caches in VRAM during execution. If some weights need to be migrated across storage tiers, the bottleneck worsens further.
The value of speculative decoding lies in allowing the target model to process multiple candidate positions in a single call, increasing the effective output yield per parameter access.
3. How Draft Models Help the Target Model Advance Multiple Positions
Suppose the draft model proposes four candidate tokens following the current context:
Context -> Candidate 1 -> Candidate 2 -> Candidate 3 -> Candidate 4
During verification, the target model calculates the conditional probabilities for these candidate positions. Although the draft model proposes candidates autoregressively, once the candidate sequence is given, the target model can evaluate multiple positions in a single forward pass using causal attention.
If the first two candidates are accepted and the third is rejected:
- The first two candidates enter the formal output.
- The third position requires a correction token.
- The fourth candidate cannot be used directly, as it was built upon the rejected third candidate.
- The next round starts fresh from the new valid context.
Therefore, what truly matters is the continuously accepted candidate prefix, not scattered hits among the batch.
In classic implementations, if all candidates pass verification, an additional token can be generated using the subsequent probabilities already obtained by the target model. However, specific execution paths and variants may differ, and this behavior should not be assumed as a fixed feature across all implementations.
4. How “Target Model Gating” Ensures Output Distribution
Speculative decoding is not merely checking if the draft text “reads reasonably.” For sampling tasks that require strict distribution consistency, acceptance and rejection must follow probabilistic rules.
1. Greedy Decoding: Comparing the Target Model’s Choice
When using greedy decoding, each step selects the highest probability token. We can check if the draft candidate matches the target model’s highest probability choice for the corresponding context.
A continuous matching prefix is accepted, while the first mismatched position uses the target model’s choice. Under deterministic conditions, this maintains the same greedy generation results; though numerical precision and parallel computation differences can still affect the ranking of extremely close probabilities.
2. Random Sampling: Target Probability Alone is Not Enough
For random sampling, let the draft model’s distribution at a position be q, and the target model’s distribution be p. Classic speculative sampling uses the following acceptance probability for a candidate token x:
Acceptance probability = min(1, p(x) / q(x))
If a rejection occurs, a correction token is sampled from a residual distribution proportional to:
Residual probability ∝ max(p(x) - q(x), 0)
These rules offset the bias introduced by the draft model’s proposal distribution. Given algorithmic assumptions are met and probabilities and caches are handled correctly, the final sampling distribution can remain consistent with that of the target model generating independently.
However, “consistent distribution” does not mean “token-by-token identical output.” Even with the same random seed, different execution flows may consume varying amounts of random numbers, resulting in different specific responses.
Sampling manipulations like temperature and top-p (truncation) must also be incorporated into the distribution calculations. If candidates are accepted using simplified thresholds while claiming strict maintenance of the target distribution, the justification is lacking.
5. Why Longer Drafts Are Not Necessarily Faster
Speculative decoding replaces a portion of target model calls with draft generation and batch verification. It does not eliminate computation; it rearranges it.
We can understand its benefits using a simplified model. Let:
- T be the time spent generating one token in normal decoding.
- D be the time spent on draft generation.
- V be the time spent on the verification round and related processing.
- M be the average number of tokens actually advanced per round.
The approximate speedup ratio is:
Speedup ≈ M × T / (D + V)
This is an analytical model, not an exact prediction formula. Actual systems also incur overhead from scheduling, synchronization, cache maintenance, memory allocation, and data transfer.
1. The Draft Model Must Be Cheap Enough
A smaller draft model usually means faster candidate generation, but it may also be worse at predicting the target model’s behavior. If the draft model is too large, its added cost might offset the benefits of reducing target model calls.
The goal is not to blindly pursue the smallest or strongest model, but to find a combination of low generation cost and high continuous acceptance length.
2. Average Acceptance Length Matters More Than Single Successes
Focus on the average number of continuous draft tokens accepted per round. Merely recording “once accepted many tokens in a round” does not represent the real workload.
The same model combination performs differently across tasks. Content with stable formatting and repetitive patterns may be easier to predict, while open-ended writing, complex reasoning, or inputs with large distribution shifts might experience more frequent rejections.
These are just potential trends and cannot replace task-level testing.
3. Diminishing Returns on Candidate Length
The longer the candidates, the higher the draft generation cost, and the greater the target model’s verification and temporary storage demands. If earlier positions are rejected, the massive number of later candidates cannot be converted into effective output.
A more reasonable strategy is to adjust the candidate length based on recent acceptance rates: moderately increase it during continuous acceptance, and shorten it during frequent rejections. However, dynamic adjustment itself has overhead, and the benefits should be confirmed through experimentation.
6. What Conditions to Check for Local Deployment
1. VRAM Margin
The draft model not only needs to store its weights but also must maintain its own cache. Target model batch verification may also introduce extra temporary tensors and cache space.
If the target model is already near the VRAM limit, adding a draft model could cause memory migration, reduce available batch sizes, or even cause a failure to run. In this case, “not upgrading the GPU” does not mean “no extra resources needed.”
2. Tokenizer Compatibility
Classic dual-model speculative decoding typically requires that candidate tokens can be accurately interpreted by the target model. Using the same tokenizer significantly simplifies candidate verification and probability processing.
If the two models tokenize text differently, additional text mapping and alignment mechanisms are required. Some extended schemes can handle this, but complexity and overhead increase. It cannot be assumed that any two models can be directly combined.
3. Cache Rollback Correctness
Candidate verification might first compute the cache containing multiple candidate positions. Once a rejection occurs midway, the state corresponding to the invalid suffix must be discarded, and the correction position must be correctly appended.
Errors in cache rollback, position indexing, and request state handling can cause subsequent outputs to deviate, not just performance drops. Therefore, cache correctness testing should precede performance tuning.
4. Concurrency Alters Existing Bottlenecks
In single-request scenarios, speculative decoding can effectively alleviate poor bandwidth utilization. Under high concurrency, normal batch decoding already improves the reuse rate of parameter reads, and the device might instead be constrained by compute capacity or scheduling.
At this point, adding draft computation may not yield the same speedup multiplier and might occupy resources that could otherwise serve other requests. It is essential to measure low-concurrency interactive use and high-concurrency serving separately, without extrapolating conclusions from one to the other.
7. How to Conduct Meaningful Performance Testing
Testing should answer two questions simultaneously: whether the output behavior is correct, and whether the end-to-end experience is improved.
1. Fix Comparable Conditions
The baseline and speculative decoding should use the same target model, numerical precision, prompt set, output length limits, and sampling configuration. Complete necessary warm-up before testing, and separate model load time from stable inference time.
The input set should cover real tasks, including varying prompt and output lengths. Do not only select samples that the draft model finds easiest to predict.
2. Record More Than Just Tokens per Second
It is recommended to record at least:
- Time to First Token (TTFT);
- Total request time;
- Steady-state generation speed;
- Average accepted length per round;
- Time spent on draft generation and target verification;
- Peak VRAM usage;
- Total throughput and tail latency under different concurrency levels.
Speculative decoding primarily optimizes the decode phase. If a task spends most of its time on prefilling a long prompt, even if the generation phase speeds up significantly, the total request time may not decrease proportionally.
3. Avoid Being Misled by Chunked Output Illusions
After batch-accepting candidates, the system might release multiple tokens at once, making the output appear smoother. However, “bouncing out a whole block of text” in the UI does not necessarily mean the overall generation speed is faster.
Judge the benefits based on total time and token count, and clarify whether the statistics include prefilling, queuing, and network transmission.
4. Verify Correctness and Performance Separately
For greedy generation, check output consistency across different lengths and rejection positions. For random sampling, in addition to testing implementation logic, focus on distribution verification rather than just comparing if a single response matches.
Additionally, cover edge cases like early stopping, triggering stop conditions, and end-of-sequence tokens appearing in candidates to ensure that extra candidates do not bypass normal termination logic.
8. When Is It Worth Enabling
Speculative decoding is more suitable for scenarios where the target model’s step-by-step generation is costly, the device has available resource margin, and the draft model matches the target task well. For developers looking to reduce local wait times for long responses, it is an optimization path worth evaluating.
If the output is short, prefilling dominates, draft acceptance length is low, or the device is already under heavy load, the extra model might actually increase latency.
Therefore, the correct implementation order is: first confirm the bottleneck, then verify algorithmic correctness, followed by measuring acceptance length and cost, and finally adjust candidate strategies based on real workloads.
The essence of the draft model is not to replace the large model in answering, but to use low-cost predictions to reduce expensive serial calls. Whether speculative decoding accelerates performance ultimately depends on a clear condition: whether the effective output gained per round of incremental computation is sufficient to cover its own cost.
