Speeding Up Local LLM Inference Without Upgrading Your GPU: How Speculative Decoding Works and How to Tune It

    Local LLM inference often stalls at the decoding stage due to memory bandwidth limits, not raw compute. This article explains why token generation is bandwidth-bound, how speculative decoding uses a small draft model to propose tokens and a target model to verify them in parallel, and what engineering parameters—such as average acceptance length, draft length, and model alignment—determine whether the technique delivers real speedups. It also covers practical trade-offs for deployment, including high-concurrency scenarios and resource budgeting, and recommends tracking acceptance length as a core operational metric.

    Many teams deploying large language models locally encounter a counterintuitive problem: GPU compute is plentiful, yet generation speed remains painfully slow. Increasing concurrency, shortening prompts, or capping output length delivers only marginal gains. The bottleneck is not the total amount of compute but the way tokens are produced during the decoding phase. This article examines a technique called speculative decoding, explains why it works, under what conditions it helps, and what key parameters require attention during implementation.

    The Decoding Phase: A Token-by-Token Process Bound by Memory Bandwidth

    A typical LLM inference cycle consists of two phases.

    Prefill phase: After the user enters a prompt, the model processes the full input at once, computes attention, and builds the key-value cache (KV cache). This phase processes many tokens simultaneously, involves dense matrix operations, is primarily compute-bound, and typically achieves high GPU utilization.

    Decoding phase: Once token generation begins, the situation changes. To produce each next token, the GPU must read the model weights and the existing KV cache from memory, perform a forward pass, output one token, and write the new key-value data back. Then, for the next token, the entire sequence of reading, computing, and writing is repeated.

    The core issue here is simple: a model may weigh tens or even hundreds of gigabytes, yet each decoding step produces only one token. In other words, every generated token requires moving the entire parameter set through memory. At this point, the limiting factor is no longer the number of compute units, but memory bandwidth and data-transfer efficiency. Compute units sit idle while waiting for data to arrive—this is the fundamental reason “compute goes unused” during decoding.

    Understanding this is crucial, because it dictates the direction of optimization: instead of trying to make each individual step faster, find ways to let a single heavyweight weight fetch advance multiple token positions.

    Speculative Decoding: Draft Small, Verify Big

    The core idea of speculative decoding can be summarized in one sentence: delegate predictable parts to a smaller, faster model that produces a draft, then let the target model verify all candidates in a single pass.

    The procedure works as follows:

    1. Drafting: A draft model (also called an assistant model) predicts several candidate tokens in sequence based on the current context. For example, given the input “The cat,” the draft model might produce “sat on my lap.”
    2. Verification: The target model performs one forward pass over the original context plus all candidate tokens, obtaining probability distributions for each position at once.
    3. Acceptance and correction: The outputs are compared from left to right. If a candidate matches the target model’s distribution, it is accepted. As soon as a token is rejected, that token and all subsequent candidates are discarded, and the target model generates a correction token at that position before the round ends.

    The advantage is straightforward: what previously required three or four rounds of target-model inference can now be compressed into a single verification pass. Because the draft model is small, the cost of generating candidates is far lower than repeatedly running the full-weight forward passes of the target model. Overall, the trade-off is favorable.

    Importantly, speculative decoding does not change the output distribution of the target model—every final token is still gated by the target model’s probabilities, so output quality is identical to direct decoding. This is where it beats alternatives like switching to a smaller model or further aggressive quantization: the speedup comes from how tokens are generated, not by compromising model accuracy.

    A pseudocode sketch of the verification logic looks like this:

    1. # Draft model generates K candidate tokens
    2. draft_tokens = draft_model.generate(context, k=K)
    3. # Target model forward pass to get probability distributions for each position
    4. target_logits = target_model.forward(context + draft_tokens)
    5. accepted = []
    6. for i, tok in enumerate(draft_tokens):
    7. p_target = softmax(target_logits[i])
    8. if sample_accept(p_target, tok): # accept based on target distribution
    9. accepted.append(tok)
    10. else:
    11. # Generate a correction token from the target model at the rejected position
    12. accepted.append(sample(p_target))
    13. break
    14. # Tokens advanced in this round = len(accepted)

    This logic highlights a key point: verification is a single forward pass covering multiple positions, while acceptance decisions are made one by one. The speedup comes from balancing “advancing multiple positions in one pass” against “falling back upon rejection.”

    The Metric That Matters: Average Acceptance Length

    Speculative decoding might look like a free lunch, but the actual speedup is determined by one metric: average acceptance length—how many draft tokens the target model accepts per round on average.

    Here is a rough estimation: if the draft model predicts four tokens and three are accepted, one target-model pass advances multiple positions, which is clearly beneficial. If the draft model frequently guesses wrong, the target model rejects and corrects repeatedly, and the extra draft and verification overhead can end up slowing things down. In the worst case, acceptance length approaches one, and speculative decoding degenerates into running an extra small model for almost no savings.

    In practice, the goal is not simply “longer drafts” but maximizing average acceptance length. Several factors interact here:

    • Draft length K: Larger K increases potential per-round gains, but rejection probability accumulates along the sequence. When K is too large, later candidates are likely discarded, adding unnecessary verification and drafting costs. The optimal value depends on the workload and should be determined empirically, not fixed arbitrarily.
    • Alignment between draft and target distributions: The more consistently the two models behave on domain-specific data, the higher the acceptance rate. The draft model should not be as small as possible—it needs to strike a balance between speed and predictive similarity to the target model.
    • Task predictability: Formatted outputs, code completion, template-based copy, and similar structured tasks tend to yield higher acceptance lengths because subsequent tokens are more deterministic. Open-ended creative writing or high-temperature sampling moves in the opposite direction.
    • Sampling parameters: Settings like temperature and top-p shape the sharpness of distributions and therefore affect acceptance decisions. They must be adjusted together with the verification logic.

    A practical point that is often overlooked: track average acceptance length as a production-observable metric, segmented by traffic type. It signals problems earlier than end-to-end latency. When acceptance length drops, it usually indicates input distribution drift or a draft model that no longer matches the workload. Adjusting the draft model or length parameters at this point is more effective than blindly scaling infrastructure.

    Deployment Trade-offs and Applicability

    Speculative decoding is not a universal accelerator. Before deployment, its boundaries need to be clear.

    Scenarios with clear gains: single-request, low-concurrency local inference; hardware where memory bandwidth is the constraint while compute is relatively idle; tasks with highly structured or predictable outputs.

    Scenarios requiring careful evaluation: high-concurrency throughput settings. Here, the system bottleneck may shift from single-request latency to overall scheduling and memory occupancy. The draft model occupies additional GPU memory and compute resources, requiring a re-evaluation of the resource mix. Industry test experience suggests that as concurrency rises, the speedup ratio tends to narrow, though it may still remain positive depending on the draft model’s overhead and scheduling policy.

    Rebalancing resource overhead: although the draft model is small, it must remain resident in GPU memory. On memory-constrained devices, this may reduce the space available to the target model. Options include quantizing the draft model, loading it on demand, or sharing certain layers to control the cost.

    Interaction with continuous batching: under batch scheduling, different requests have varying acceptance lengths, causing uneven progress within a batch. Engineering solutions must handle this imbalance—for example, by dynamically regrouping batches or applying acceptance-length budgets—otherwise scheduling overhead can erode the speedup.

    Summary

    Speculative decoding deserves attention because it directly addresses the real bottleneck in local inference: decoding is limited by memory bandwidth, and each weight fetch advances only one token. By letting a small model draft and a large model verify in one pass, it compresses multiple heavyweight reads into a single one, improving generation speed without a GPU upgrade and without sacrificing output quality.

    But it is not an unconditional speed switch. Average acceptance length determines the upper bound of the speedup, while draft length, model alignment, task characteristics, and concurrency patterns jointly shape the final result. The right approach is to measure acceptance length and end-to-end latency on actual business traffic first, then select draft model specifications and length parameters based on the data, and incorporate acceptance length into routine monitoring. Combining this technique with continuous batching and KV cache management can push inference efficiency further on existing hardware.