Speculative Decoding for Open-Source LLMs: Why Acceleration Can Make Inference Slower

    This article explains why speculative decoding and multi-token prediction can sometimes reduce throughput in local open-source LLM deployments. It covers the draft-and-verify workflow, the role of acceptance rate and validation overhead, task-dependent performance differences, dense versus MoE trade-offs, and the impact of memory bandwidth and unified-memory devices. It also provides a practical checklist for measuring, tuning, and deploying speculative decoding based on real workloads.

    Background: Open-Source Model Families and the Anxiety Around Inference Speed

    In recent years, open-source LLMs have evolved into clear model families. A mature open-source model series often includes ultra-lightweight variants for mobile and edge devices, mid-sized general-purpose dense variants, and MoE variants with larger total parameter counts but fewer activated parameters per forward pass. Together, they cover a spectrum from “can run on a phone or laptop” to “stronger reasoning capability.”

    When developers run these models locally, a practical question quickly emerges: how do we make them faster? Autoregressive generation is inherently serial, so each token requires a complete forward pass during decoding. As a result, acceleration techniques such as speculative decoding and multi-token prediction have been widely adopted. However, many teams observe a counterintuitive result after testing: throughput can drop after acceleration is enabled. Understanding this requires separating how acceleration works from where it fails.

    How Speculative Decoding and Multi-Token Prediction Work

    The core idea of speculative decoding is: use a cheap draft to guess, then use an expensive main model to verify.

    The typical flow has three steps:

    1. Draft: A lightweight draft model, or a built-in multi-token prediction (MTP) head, proposes several candidate tokens at once.
    2. Verify: The main model performs a parallel forward pass over the candidate tokens and checks whether each position matches its own distribution.
    3. Accept or roll back: Accepted tokens are kept. At the first mismatch, the sequence is rolled back and replaced with the main model’s result.

    In the ideal case, one expensive main-model forward pass can confirm multiple tokens. This can reduce the average latency per token. Multi-token prediction internalizes the drafting capability by using additional prediction heads to predict several future steps at once, avoiding the need for a separate draft model.

    Key Metric: Acceptance Rate

    The first key to understanding whether acceleration is effective is the acceptance rate: the proportion of candidate tokens proposed by the draft that are accepted by the main model.

    Acceptance rate alone does not equal speedup. Real acceleration depends on two factors:

    • Acceptance rate: how closely the draft matches the main model’s distribution.
    • Verification cost: the extra overhead of generating the draft and running the main model’s parallel verification.

    This creates a break-even point. Acceleration is beneficial only when the extra tokens gained per round outweigh the additional cost introduced by drafting and verification. If acceptance is low, most draft tokens are rejected. The model then pays both the draft cost and the verification cost, leading to more work and less output.

    Why Acceleration Can Make Decoding Slower: Evidence from a Cross-Task Test

    The following example data, normalized and provided only to illustrate a general pattern, comes from a comparison across task types. It shows a clear relationship between acceptance rate and decode speedup:

    Task type Average acceptance rate Decode speedup
    Coding ~0.76 1.18x
    RAG ~0.81 0.98x
    General QA ~0.65 0.87x
    Math ~0.61 0.87x
    Reasoning ~0.61 0.80x
    STEM ~0.61 0.79x
    Creative writing ~0.58 0.74x

    A clear pattern emerges: when the acceptance rate falls below roughly 0.6, speedup often drops to around 0.8x, meaning speculative decoding can make overall decoding slower.

    The reasons are straightforward:

    • Coding tasks produce highly structured and predictable token sequences. Draft hits are more likely, so these tasks can often achieve stable speedups above 1.1x.
    • Creative writing and deep reasoning tasks have more open-ended and diverse outputs. The main model’s distribution has higher entropy, making drafts harder to guess. Low acceptance rates turn speculative decoding into a burden.
    • Acceptance rates vary significantly across tasks. This shows that enabling speculative decoding globally with one setting is usually inappropriate.

    Speculative decoding is therefore a task-dependent and scenario-dependent optimization. It should not be assumed to always improve performance.

    Dense Models vs. MoE Models: Architectural Trade-Offs

    For local deployment, model speed often depends less on total parameter count and more on how many parameters are actually activated or read per token.

    • Dense models: Every token requires reading and computing with all weights. More parameters mean more data to read per token.
    • MoE models: The total parameter count can be large, but each token activates only a small subset of expert networks. During decoding, fewer parameters may actually need to be moved and computed.

    This introduces an important perspective: autoregressive decoding is typically memory-bandwidth bound, not compute bound. The main bottleneck for generating each token is usually the speed at which weights can be moved from memory to the compute units, rather than floating-point operations themselves.

    As a result, an MoE model with a larger total parameter count but fewer activated parameters can run faster than a smaller dense model in a memory-bandwidth-limited environment. This also explains a common observation: on unified-memory devices, larger MoE variants can offer better overall performance.

    The Deeper Impact of Unified Memory and Deployment Environments

    On devices where CPU and GPU or NPU share the same physical memory, a unified-memory architecture, the situation becomes more complex:

    • Memory bandwidth becomes a scarce shared resource, competing among CPU and accelerators.
    • Drafting and verification in speculative decoding add further bandwidth pressure.
    • In this environment, reducing the amount of weights moved per token often delivers more direct benefit than improving peak compute capability.

    Therefore, model selection should prioritize activated parameter count and architecture type, rather than comparing only total parameter counts or parameter labels. This is why MoE variants in the same model family often show better cost-performance on unified-memory devices.

    Practical Recommendations and Tuning Checklist

    Based on the above, here are actionable engineering recommendations:

    1. Measure before enabling: Measure acceptance rates on your real task distribution before enabling speculative decoding. Do not infer from general benchmarks or leaderboards alone.
    2. Route by task: Enable speculative decoding for structured tasks such as coding. For creative or open-ended reasoning tasks, consider disabling it or reducing draft length to avoid negative optimization.
    3. Tune draft length: Proposing too many draft tokens increases the cost of wrong guesses. Compare speedup and acceptance rate across different draft steps to find a balance.
    4. Match architecture to environment: For bandwidth-limited unified-memory or edge devices, prefer MoE architectures with fewer activated parameters. For compute-rich cloud environments, dense large models may be preferred for absolute capability.
    5. Evaluate with real workloads: Avoid conclusions based on a single prompt. Cover multiple task categories and observe the distribution and variance of speedups.

    A simple evaluation flow can be described with pseudocode:

    1. def evaluate_speculative_decoding(model, tasks, draft_steps):
    2. results = []
    3. for task in tasks:
    4. # Baseline: speculative decoding disabled
    5. base_tps, base_latency = benchmark(model, task, speculative=False)
    6. # Speculative: enabled with a specified number of draft steps
    7. spec_tps, spec_latency, accept = benchmark(
    8. model, task, speculative=True, draft_steps=draft_steps
    9. )
    10. speedup = base_tps / spec_tps
    11. results.append({
    12. "task": task.name,
    13. "accept_rate": accept,
    14. "decode_speedup": round(speedup, 2),
    15. })
    16. return results

    Conclusion

    Speculative decoding is not a free lunch. Its benefits depend on the balance between acceptance rate and verification cost. Real inference speed also depends more on activated parameter count, architecture type, and memory bandwidth than on a simple total-parameter label. By understanding these two layers of behavior and evaluating across realistic workloads and task categories, developers can make engineering decisions for local open-source LLM deployment that balance capability and speed, instead of being misled by the assumption that enabling acceleration must make things faster.