Speculative Decoding: How to Speed Up Local LLMs and a Practical Implementation Checklist

    Speculative decoding is a generation-optimization technique that can dramatically cut per-token latency under the right conditions, but it is not free acceleration. This article explains why large language models fall into slow, one-token-at-a-time generation during the decode phase, how speculative decoding uses a small draft model to propose candidate tokens that the target model verifies in a single forward pass, and why average acceptance length is the metric that actually determines the speedup. It also provides an engineering checklist covering draft-model selection, draft-length tuning, low- versus high-concurrency testing, fallback strategies, and a scenario-fit table, so you can benchmark whether speculative decoding is worth enabling for your own model, hardware, and workload.

    Same hardware, why can speed differ by several times?

    Let’s start with the conclusion: speculative decoding is not “free acceleration.” It is a generation-optimization technique that can deliver clear gains under specific conditions but always needs to be validated with real measurements.

    In certain local test scenarios, if you keep the same machine, the same GPU, and the same memory bandwidth, and the following conditions hold:

    • The target model and the draft model come from the same family, or at least share the same vocabulary;
    • The inference framework has speculative decoding enabled and the draft model is configured correctly;
    • The batch size is small, for example a single request or low concurrency;
    • The sequence length is moderate;
    • Sampling parameters such as temperature, top-p, and top-k stay consistent during draft verification;
    • The task itself has some predictability, such as Q&A, writing, or code completion;

    then single-request generation speed can approach roughly four times the original. Similarly, in some throughput tests, improvements of around twofold are commonly seen.

    But it must be emphasized: these numbers are not a universal guarantee. Actual gains are affected by the GPU model, memory bandwidth, target model size, draft model size, batch size, sequence length, the inference framework implementation, temperature and top-p parameters, and task predictability. A more accurate statement is:

    When the decode phase is memory-bandwidth-bound and the draft model’s overhead is controlled, speculative decoding may significantly reduce single-token generation time; but in scenarios with high concurrency, saturated GPU compute, or large distributional divergence between the draft and target models, the gains narrow and may even disappear or turn negative.

    Therefore, whether it is worth enabling speculative decoding should not be judged only by hearsay that “it can be several times faster.” You should run load tests against your own model, hardware, and workload.

    At a minimum, record the following metrics:

    • tokens/s with speculative decoding off versus on;
    • Time to first token (TTFT);
    • Total response time;
    • Average acceptance length;
    • GPU utilization;
    • Memory usage and memory-bandwidth pressure;
    • Throughput changes across different batch sizes;
    • Acceptance-rate changes across different temperature and top-p values.

    Why do large models fall into “one-token-at-a-time” generation?

    To understand why speculative decoding works, you first need to see the two phases of large-model inference.

    1. Prefill phase: process the entire prompt at once

    After the user enters a prompt, the model processes the whole thing together. This phase has to complete the attention computation and produce the KV cache. Because it processes a large number of tokens at once, it is typically a compute-intensive task whose performance depends mainly on GPU compute power and matrix-computation efficiency.

    2. Decode phase: generate only one token per step

    Once the actual answer begins, the model enters autoregressive generation. Each step produces only one token, appends it back to the context, and then continues generating the next token until the answer ends.

    The problem mainly occurs in the decode phase. To generate the next token, the GPU usually has to:

    1. Read all of the model weights and the existing KV cache from memory;
    2. Perform one forward pass;
    3. Write the new key/value data back into the cache.

    And large models often have tens or even hundreds of GB of weights. In other words, generating a single token may require sweeping the entire set of weights through memory each time.

    At this point, the real bottleneck is often not a shortage of GPU compute units but memory bandwidth and data-movement speed. The compute units sit largely idle, and speed is gated by repeatedly reading and writing weights. This is why large models, when doing local inference, tend to “load themselves one character at a time.”


    The core of speculative decoding: let the draft model guess first, and let the target model concentrate on verification

    The core idea of speculative decoding is to hand the relatively easy-to-predict part of the work to a smaller, faster draft model, and then have the target model verify it in a concentrated pass.

    An intuitive example:

    Input prompt:

    The cat

    The draft model can predict a candidate segment in one go:

    sat on my lap

    The target model then checks these candidate tokens together with a single forward pass. Note that the target model does not simply judge whether they “look right”; it verifies the candidates against its own probability distribution.

    More precisely, the acceptance mechanism of speculative decoding usually works like this:

    • The draft model first produces several candidate tokens;
    • The target model performs a probability check on these candidates;
    • If a candidate token matches the target model’s distribution under the current sampling configuration, it is accepted;
    • If a candidate is rejected, that candidate and all subsequent candidates are discarded;
    • The target model then generates one corrected token from its adjusted probability distribution and continues the output from there.

    As long as the draft and target models use consistent sampling parameters, such as temperature, top-p, and top-k, and the framework implementation is correct, the final adopted output distribution should be consistent with decoding directly with the target model. This is also the key reason speculative decoding can speed things up without noticeably changing generation quality.

    From a cost perspective, the draft model is very small, and the overhead of generating several candidate tokens in a row is usually far lower than the cost of the target model repeatedly reading the full weights multiple times. You can think of it this way:

    The draft model proposes candidates first, and the main model verifies them together in a single forward pass. The tokens that pass verification “catch a free ride” and no longer need to be generated one by one by the target model.


    Key metric: average acceptance length

    Speculative decoding may look like it accelerates things, but the metric that truly determines the effect is:

    Average acceptance length: how many draft tokens the target model accepts on average per verification round.

    A numerical example:

    Suppose the draft model predicts 4 tokens at once.

    • If the target model accepts 3 of them, then at least 3 draft tokens are adopted this round;
    • If the target model rejects 1 and generates 1 corrected token, the round can still move forward;
    • If the average across multiple rounds of testing is 3 accepted tokens, then the average acceptance length is 3.

    A higher average acceptance length generally means more effective tokens produced per unit of time, and a more noticeable speedup.

    But this does not mean a longer draft is always better.

    An overly long draft can cause two problems:

    1. More candidates get rejected, wasting draft computation;
    2. The target model has to verify more candidates, raising the per-round verification cost.

    When the extra benefit from a longer draft no longer outweighs the cost of draft generation and verification, a long draft can actually slow down overall speed. Therefore, the draft length should not be increased blindly; it should be measured against task type, model distribution, hardware bandwidth, and concurrency pressure.

    A common starting point is to test with a draft length of 4, then try other values such as 2, 6, and 8, observing changes in average acceptance length and actual tokens/s.


    Engineering implementation checklist

    If you plan to enable speculative decoding in a local deployment, you can follow this checklist.

    1. Prefer a draft model that shares the target model’s vocabulary and family

    A shared vocabulary means consistent token mapping, which lowers the cost for the target model to verify candidate tokens. The same family means the language distributions are closer, so candidates are usually accepted with higher probability.

    If the draft and target models have different vocabularies, an additional alignment mechanism is usually required, and engineering complexity rises significantly.

    2. Set the draft length and measure the average acceptance length

    Don’t look at total speed alone; also look at average acceptance length.

    It’s recommended to test draft lengths of 2, 4, 6, and 8 separately and record:

    • Average acceptance length;
    • Tokens generated per second;
    • Time to first token;
    • Draft model time;
    • Target model verification time.

    If speed drops after increasing the draft length, that means the draft overhead is already too high and you should shorten the draft length.

    3. Validate in low-concurrency scenarios first

    Speculative decoding usually shows its gains more easily in low-concurrency, single-request interactive scenarios, because at that point the target model’s main bottleneck is decode-phase memory bandwidth.

    If your scenario is single-user chat, a coding assistant, or a local writing assistant, trying speculative decoding first is usually a good fit.

    4. Load-test high-concurrency scenarios

    In high-concurrency scenarios, the GPU may already be compute-saturated. In that case, the draft model consumes additional compute resources, and target model verification also adds to the compute load.

    Therefore, you cannot assume speculative decoding is always faster under high concurrency. A more accurate judgment is:

    Only when memory bandwidth is still the main bottleneck and the draft model’s overhead is controlled can high-concurrency throughput possibly improve; if the GPU is already compute-saturated, speculative decoding may bring no gain or even slow things down.

    When load-testing, compare throughput and latency across different concurrency levels, sequence lengths, and batch sizes.

    5. If problems appear, shorten the draft length or turn off speculative decoding

    If, after enabling it, you observe:

    • A drop in speed;
    • Too low an average acceptance length;
    • Abnormal output stability;
    • Abnormally high GPU utilization;
    • Worse high-concurrency throughput;

    you should first try shortening the draft length. If that still doesn’t help, you can turn off speculative decoding and return to the standard decoding path for comparison.


    Applicable and non-applicable scenarios

    Dimension Recommendation
    Good fit Low-concurrency interaction, memory-bandwidth-bound, draft and target distributions close, strongly predictable tasks
    Limited benefit High-concurrency saturation, GPU-compute-bound, large distribution gap between draft and target models, mismatched vocabularies
    Key parameters Draft model, draft length, temperature, top-p, batch size, sequence length, inference framework implementation
    Validation metrics Average acceptance length, tokens/s, time to first token, total latency, throughput, GPU utilization
    Fallback strategy Shorten draft length, switch draft model, lower concurrency assumptions, turn off speculative decoding

    FAQ

    When running large models locally, how should I choose the draft model?

    Prefer a model that shares the same vocabulary and family and is smaller in size. Ideally, the draft model should be clearly smaller than the target model while staying close to it in language distribution. If the draft model is too small, the acceptance rate may drop; if it is too large, the draft cost will cancel out the acceleration gains.

    Is a longer draft always faster?

    No. A longer draft means more candidates, but it can also mean more rejected candidates, and the target model’s verification cost rises. Judge by average acceptance length and actual speed, not by simply increasing the draft length.

    What should I do if the average acceptance length is low?

    You can troubleshoot in this order:

    1. Whether the draft and target models come from the same family;
    2. Whether they use the same vocabulary;
    3. Whether temperature, top-p, and top-k are consistent;
    4. Whether the task is too open-ended and has low predictability;
    5. Whether the draft length is too long;
    6. Whether the inference framework version supports the current model combination.

    Is speculative decoding suitable under high concurrency?

    Not necessarily. At low concurrency, the decode bottleneck is usually more pronounced, so the gains from speculative decoding show up more easily. At high concurrency, if the GPU is already compute-saturated, both the draft model and target model verification add load, and there may be no gain or even a slowdown. You must confirm this through load testing.

    Does speculative decoding reduce output quality?

    With a correct implementation, the target model verifies candidate tokens against its own probability distribution, so the adopted results should be consistent with decoding directly with the target model. But this depends on consistent sampling parameters and a correct implementation. If the framework implementation is flawed, output differences can still occur, so a quality regression test is recommended before going live.


    Summary

    The value of speculative decoding lies in the fact that it avoids the high-cost path of “increasing single-token compute” and instead optimizes how tokens are generated: a low-cost small model drafts candidates in bulk, and then the higher-cost larger model or target model verifies them in a single pass, extracting a speed benefit in the memory-bandwidth-bound decode phase.

    Understanding three key points is enough to judge whether it fits your scenario:

    1. The decode phase is often constrained by memory bandwidth, not simply by a lack of compute;
    2. The draft model is responsible for proposing candidates, and the target model is responsible for verifying them against its probability distribution;
    3. Average acceptance length is the core metric for measuring the acceleration effect.

    Note that acceptance length varies greatly across tasks. Scenarios where the draft and target distributions are close, concurrency is low, and the memory-bandwidth bottleneck is clear usually see more pronounced gains; with high concurrency, compute saturation, or mismatched model distributions, the gains may be limited, and you may even need to fall back to standard decoding. For developers who want to improve local large-model inference speed on existing hardware, speculative decoding is an optimization worth prioritizing for real benchmarking.