Speculative Decoding: Faster LLM Inference Without New Hardware

    Local LLM generation speed is not limited by raw compute as much as by memory bandwidth, since every decoded token forces the model to move large weights and a growing KV cache through the GPU. Speculative decoding attacks this bottleneck by letting a small draft model cheaply guess several candidate tokens and asking the large target model to verify them in a single forward pass. This article explains why decode is bandwidth-bound, walks through a full speculative decoding step, and shows why Average Acceptance Length is the metric that decides whether you actually gain speed. It also covers which workloads benefit most, how draft-model choice, speculation length, context size, and sampling strategy affect the speedup, and why mainstream inference frameworks are increasingly adopting the technique. You will learn how to keep costly compute focused on the tokens that matter and cut the number of times the full target weights are loaded.

    1. Where the bottleneck in local LLM inference really comes from

    Many people assume that local LLM generation speed depends on how much compute the GPU has or how many compute units it packs. But anyone who has actually deployed these models quickly notices something different: swapping in a higher-throughput card does not necessarily speed up token-by-token generation. The reason is that the two phases of text generation are limited by completely different things.

    Prefill phase: When a user submits a prompt, the model first processes the entire input in one pass, computes attention relationships between tokens, and builds the KV cache. This phase ingests a large batch of tokens at once, making it a classic compute-bound task that scales with raw compute.

    Decode phase: Once the model starts producing its answer, it switches to generating one token at a time. And this seemingly simple step is exactly where local inference feels the pain.

    To generate the next token, the GPU must do three things: read the model weights, which can run to tens or even hundreds of GB; read the existing KV cache; and, after one forward pass, write the newly produced key/value data back into the cache. Then, to generate the token after that, the whole sequence repeats in full.

    That is the problem: for every single token, the massive weights and the ever-growing cache have to be moved from memory into the compute units. At that point, speed is no longer determined by “how many floating-point operations per second,” but by “how much data per second can be moved”—that is, memory bandwidth. The larger the weights and the longer the context, the higher the transfer cost, and the slower the token-by-token generation. This is the root cause of having “plenty of compute but still no speed.”

    2. The core idea of speculative decoding: let a cheap small model run ahead

    Since the bottleneck is repeatedly moving the large model’s weights, a natural idea emerges: can we reduce how often the large model is fully invoked? Speculative decoding is built on exactly this intuition.

    It introduces two roles:

    • Draft model: A model far smaller than the target, so cheap that generating candidate tokens on its own costs only a fraction of the target’s cost—typically a few tens of a percent.
    • Target model: The original large model that actually serves users and has final say over quality.

    The key insight is this: although the small model is less capable, it reads far fewer weights and moves far less data, so it can quickly and continuously guess a string of candidate tokens. The large model no longer has to generate them one by one—it only needs to verify the whole string in parallel with a single forward pass.

    3. A complete speculative decoding step

    Consider an abstract example. Suppose the user inputs “The cat” and the goal is to continue the text.

    1. Draft phase: The draft model predicts a candidate sequence, say "sat" "on" "my" "lap"—4 tokens in total.
    2. Verification phase: The target model appends these 4 candidates to the existing context and, in one forward pass, produces the probability distribution at each position for “what would the target model itself have generated here.”
    3. Accept/reject decision: Positions are compared one by one. If a candidate token matches the target model’s distribution, it is accepted; the moment a position is rejected, all subsequent candidates are discarded, and the target model supplies its own corrected token at that position.

    In this example, if the first three tokens (sat, on, my) are all accepted and the fourth (lap) is rejected, that single round still advances several valid positions at once. Work that would have taken the target model three or four consecutive rounds is compressed into one verification. What you save is precisely the cost of “repeatedly moving the large model’s full weights”—and that is the source of the speedup.

    You can think of it this way: let the cheap small model do the “guessing,” and let the expensive large model only “grade.” The more accurate the guess, the fewer times the large model has to be called.

    4. The metric that decides success: Average Acceptance Length

    Speculative decoding looks like a free lunch, but whether it actually delivers speed depends on one critical metric—Average Acceptance Length, the average number of draft tokens the target model accepts per round.

    • If the draft model averages 3 accepted tokens per round, one large-model computation effectively advances 3 positions, which is a significant speedup.
    • If the draft model guesses wrong frequently, the target model keeps rejecting and correcting. Not only do you fail to save compute, you also pay extra for “running the draft model” and “verifying candidates,” so the overall result can end up slower than plain token-by-token generation.

    For this reason, speculative decoding is not unconditional acceleration. Its payoff depends heavily on draft quality and how well it matches the task:

    • High-payoff scenarios: Output that follows relatively predictable patterns—code completion, structured output, templated replies, format conversions. Here the draft model often hits the target’s intent, giving a high acceptance length.
    • Low-payoff scenarios: Highly creative, high-variance open-ended writing, where word choices are full of uncertainty. The draft is likely to drift, acceptance length is low, and it may even slow things down.

    5. Key factors and tuning directions

    Once you understand the principle, several dimensions matter for tuning results in practice:

    1. Choice of draft model: The draft model must be “small enough to save cost” yet “accurate enough to raise the hit rate.” These pull in opposite directions, so you usually want a lightweight model from the same family as, or aligned with, the target model’s domain and language.
    2. Speculation length (how many tokens to predict per round): Too few, and verification overhead takes up a large share of each round, wasting one target-model call; too many, and a rejection near the front makes all the later guesses wasted. The length is best adjusted dynamically based on acceptance length.
    3. Context length: The larger the KV cache, the more cache each verification round must read, and the more the relative benefit of speculation is diluted.
    4. Temperature and sampling strategy: The more deterministic the sampling (lower temperature), the more easily the draft matches and the higher the acceptance length; higher temperature adds diversity but lowers the acceptance rate.

    The following illustrative logic is easy to follow (pseudocode, expressing the idea only):

    1. def speculative_decode(draft, target, prefix, gamma):
    2. # gamma: max number of tokens the draft predicts per round
    3. while not done:
    4. # 1) draft model quickly guesses gamma tokens in a row
    5. draft_tokens = draft.generate(prefix, max_new=gamma)
    6. # 2) target model runs one forward pass, giving distributions at all positions
    7. target_probs = target.forward(prefix + draft_tokens)
    8. # 3) accept/reject left to right
    9. accepted = 0
    10. for i, tok in enumerate(draft_tokens):
    11. if accept(tok, target_probs[i]):
    12. accepted += 1
    13. prefix += tok
    14. else:
    15. # rejected: use the target model's sample at this position as the correction
    16. prefix += target.sample(target_probs[i])
    17. break
    18. # if the whole draft is accepted, let the target model "gift" one more token
    19. if accepted == gamma:
    20. prefix += target.sample(target_probs[gamma])
    21. if len(prefix) >= max_len:
    22. break
    23. return prefix

    6. The trend across mainstream inference frameworks

    Speculative decoding is not a lab concept. It is steadily being adopted by mainstream inference frameworks as a standard technique for improving throughput in both local and high-concurrency settings. Its value shows up not only in the generation speed of a single request, but also in server-side concurrency: even as concurrent requests pile up, overall throughput can gain a meaningful boost. That is why the “draft model” is becoming a role you can hardly avoid when running large models locally.

    For scenarios that need to run large models smoothly on consumer or mid-range hardware, or that need to support more concurrency under limited resources, pairing a speculative decoding strategy with a suitable cloud inference service—using a general-purpose container platform to host the inference service, object storage to distribute model weights, and monitoring and alerting services to track throughput and acceptance-length metrics—is a highly cost-effective optimization path. The core idea stays the same: spend expensive compute where it counts, and minimize the number of times the large model’s weights are moved.

    7. Summary

    The essence of speculative decoding is to have a cheap small model “guess” ahead, then let the large model “grade” it all at once—compressing what used to be multiple rounds of token-by-token generation into a single verification round, and thereby sidestepping the fundamental memory-bandwidth bottleneck. It requires no GPU upgrade, yet can deliver several times the speedup on suitable tasks.

    But keep one thing firmly in mind: the key to speedup is Average Acceptance Length. The more accurate the draft, the greater the payoff; the worse the draft, the more likely you are to lose more than you gain. When putting it into practice, tune jointly across task type, draft-model quality, speculation length, and sampling strategy, and monitor acceptance length to judge whether the strategy is actually working. Once you understand this “punch above your weight” mechanism, you can make every bit of your hardware compute count where it matters most when deploying large models locally.