Speculative Decoding: How to Choose a Draft Model and Troubleshoot Low Acceptance Rates
Learn how to select a draft model for speculative decoding, diagnose low acceptance rates, and tune draft length as workloads change. This guide covers acceptance and rollback logic, speedup estimates, eight-GPU benchmarking, and production monitoring to help determine when speculative decoding delivers a measurable benefit.
Speculative decoding performance depends primarily on two factors: draft-token acceptance and serving concurrency. When acceptance is low, much of the draft model’s computation is wasted. At high concurrency, verification may already be approaching the hardware’s compute limit, leaving less room for acceleration.
This guide provides actionable checks for workload suitability, acceptance logic, draft-model selection, acceptance-rate diagnosis, dynamic tuning, multi-GPU measurement, and production troubleshooting.
1. When Speculative Decoding Makes Sense
Autoregressive decoding requires access to model weights and the KV cache for each generated token. At single-request concurrency or small batch sizes, memory traffic often dominates execution time. Speculative decoding typically offers its greatest benefit under these conditions.
The draft model proposes k candidate tokens, and the target model verifies those positions in one forward pass. A single verification round can therefore commit multiple output tokens.
Three prerequisites matter:
- The draft and target models must use the same tokenizer and vocabulary. With incompatible vocabularies, proposed tokens cannot be compared directly with the target model’s decisions.
- The workload should primarily involve low-concurrency or interactive requests, such as chat and code completion. There is no universal definition of “low concurrency.” On the same hardware and request distribution, measure per-request latency and total throughput at batch sizes of 1, 2, 4, and 8. Use those results to identify the concurrency limit below which speculative decoding remains beneficial.
- The output should be reasonably predictable. Open-ended creative generation has higher entropy and often lower acceptance. Code, structured output, and templated responses generally achieve higher acceptance, but this must still be validated against real request logs.
If these conditions are not met, speculative decoding can reduce throughput. Disable it before pursuing other optimizations.
2. Acceptance and Rollback Logic
Verification determines which proposed tokens are retained. The two common cases are greedy decoding and sampling.
| Aspect | Greedy decoding | Sampling |
|---|---|---|
| Acceptance condition | The draft token matches the target model’s argmax at that position | Accept with probability min(1, p(x) / q(x)), where p is the target probability and q is the draft probability |
| After the first rejection | Replace that position with the target model’s argmax and discard subsequent draft tokens | Sample a replacement token from the normalized max(0, p − q) distribution and discard subsequent draft tokens |
| If all draft tokens are accepted | Use the target model’s argmax at position k + 1 as an extra token |
Sample an extra token from the target distribution at position k + 1 |
| Equivalence to target-only decoding | Token-for-token equivalence | Distributional equivalence; individual generated sequences may differ |
An important detail is that the verification forward pass provides distributions for k + 1 positions. If all draft tokens are accepted, the token at position k + 1 requires no additional target-model forward pass. This extra output is the bonus token.
Once a rejection occurs, the verification round ends. No draft results after the rejected position are used.
Keep both KV caches consistent
Both the target model’s and the draft model’s KV caches must be rolled back to the last accepted position before the correction or bonus token is appended.
Rolling back only the target cache leaves the draft model with an incorrect context for its next proposal. Repeated tokens or skipped text are common symptoms of this type of rollback error.
Handle probability calculations carefully
Compute probabilities in FP32 before calculating acceptance ratios. When q(x) is close to zero, p(x) / q(x) can amplify numerical errors.
Temperature, top-p, and other sampling transformations must be applied consistently to both models’ logits. Otherwise, the acceptance calculation no longer preserves the intended target distribution. A zero normalization denominator also requires explicit handling.
3. How to Choose a Draft Model
Evaluate candidates in the following order. If a candidate fails a prerequisite, stop its evaluation until the issue is resolved.
Draft-model selection checklist
- Prefer a draft model from the same model family, with identical tokenizer behavior, vocabulary size, and special-token IDs.
- Confirm that both models use the same chat template and system-prompt assembly. Otherwise, the same input may become different token sequences.
- Run both models offline on anonymized production requests and record the number of accepted draft tokens per verification round.
- Measure draft-model step latency at the intended concurrency to obtain
c. - Confirm that the draft model’s weights and KV cache, together with the target model, remain below a safe GPU-memory limit.
- For multi-GPU deployments, verify the draft model’s parallelism strategy so that draft generation does not become communication-bound.
- After domain fine-tuning, remeasure acceptance and
con the same evaluation set.
Estimate speedup using measured costs
A useful approximation is:
Speedup ≈ (1 + mean accepted length) / (k × c + v)
The terms are:
- Mean accepted length: The average number of accepted draft tokens per verification round, ranging from
0tok. The correction or bonus token is counted separately as the1in the numerator. k: The number of tokens proposed in each draft round.c: Draft-model single-step latency divided by target-model single-step latency. Measure at production-equivalent batch sizes and sequence lengths, and use the median across repeated runs.v: Verification-forward latency divided by target-model single-step latency. A simplified estimate setsv = 1, which can be approximately reasonable for memory-bound workloads with smallk. Askor concurrency increases, verification requires more computation andvcan become substantially greater than 1. Measure it rather than assuming it.
For illustration only, suppose the mean accepted length is 2.5, k = 4, c = 0.1, and v = 1:
Speedup ≈ 3.5 / 1.4 = 2.5
These are hypothetical values, not benchmark results. Replace them with measurements from your deployment.
A draft model that is too small may have poor acceptance. One that is too large raises c, potentially consuming all the gains from speculation. Evaluate acceptance and drafting cost together; neither parameter count nor acceptance alone is enough.
4. How to Diagnose Low Acceptance Rates
Work through these checks in order. Tuning later-stage parameters is not useful if an earlier correctness or configuration issue remains unresolved.
1. Check tokenizer and input compatibility
Verify that tokenizer behavior, vocabulary size, special tokens, and chat templates match. These problems often become apparent when acceptance is extremely low and generated output is also abnormal.
2. Test implementation correctness
Run a greedy-decoding consistency test. For the same prompts at temperature = 0, speculative decoding should produce the same token sequence as target-only decoding.
If the outputs diverge, inspect rollback handling and KV-cache position calculations around the first mismatch. Floating-point operation ordering in batched execution can occasionally produce small differences. In that case, use deterministic kernels and record the first divergent position.
3. Check sampling settings
Higher temperature flattens the target distribution and can reduce acceptance when the draft distribution does not match it well.
Compare production and offline settings for temperature, top-p, and repetition penalty. Confirm that the two models apply those settings consistently.
4. Check for domain drift
A draft model trained on general-purpose data may perform poorly when production requests concentrate on a specialized domain.
Sample production logs and group acceptance statistics by request type. Identify which groups account for the low acceptance.
5. Check whether k is too large
Measure acceptance by draft position. If acceptance drops sharply after the third position, the draft length may exceed the useful prediction horizon. Reduce k.
6. Inspect the request distribution
Long-tail requests, including very long contexts or outputs, can pull down aggregate results.
Bucket metrics by input length and output length rather than making decisions from a single blended average.
The priority is to fix implementation and configuration issues first, address domain drift next, and only then adjust k or change draft models. If multiple draft candidates still fail to produce a net benefit, disable speculative decoding.
5. Dynamically Tune Draft Length
A fixed k cannot suit every concurrency level and request type. A dynamic controller can track recent acceptance in a sliding window, adjust k, and disable speculation when measured gains disappear.
The following thresholds are starting points, not universal recommendations. Calibrate them with offline evaluation and a production canary.
Parameters (initial values; calibration required):k_min = 1, k_max = 6Window W = most recent 200 verification roundsDecrease-k threshold r_low = 0.3Increase-k threshold r_high = 0.7Disable threshold:measured window speedup < 1.0 for N consecutive windowsAfter each verification round:Record accepted_len and the k used for that roundr = mean of (accepted_len / k) across rounds in the windowIf r < r_low and k > k_min:k = k - 1If r > r_high and k < k_maxand verification latency growth is below the threshold:k = k + 1If current batch size > B_off (determined by load testing):Disable speculative decoding and use standard decodingIf measured window speedup < 1.0 for N consecutive windows:Disable speculative decoding and raise an alert
Implementation considerations:
- Reset or reweight the window after changing
k. Otherwise, old observations can delay recognition of the new setting’s effect. - Determine
B_offthrough load testing. It depends on the hardware and models. As concurrency rises, verification cost andvincrease, gradually eroding the benefit. Do not copy a threshold from another system. - Log every adjustment. Record the change in
k, window acceptance, and throughput for later analysis. - Start with a small canary. Compare P95 latency and throughput against a control group with speculative decoding disabled.
6. Benchmarking with Eight-GPU Tensor Parallelism
Environmental differences can easily distort multi-GPU comparisons. Keep the following conditions fixed and document them.
| Category | Conditions to record |
|---|---|
| Hardware | GPU model, driver version, GPU interconnect, CPU configuration, and system memory |
| Parallelism | Tensor parallelism degree TP = 8; explicitly state the target and draft models’ parallelism strategies |
| Framework and kernels | Inference-framework version, operator-library versions, and precision such as BF16 or FP8 |
| Request distribution | Input and output length distributions, batch size or target concurrency, and sampling settings |
| Request data | Anonymized real-world request samples or a public benchmark dataset |
| Warm-up | Run warm-up requests before timing and exclude them from results |
| Repetition | Run each complete configuration at least three times; report the median and observed variation |
Metrics to compare
Latency
Report P50 and P95 time per output token (TPOT), along with time to first token (TTFT). Keep TTFT separate from TPOT because speculative decoding primarily affects TPOT.
Throughput
Measure output tokens per second at a fixed concurrency.
Performance breakdown
Record:
- Mean accepted draft length.
- Fraction of time spent drafting.
- Fraction of time spent verifying.
- Rollback count.
These breakdowns help explain why throughput changes.
The baseline should use the same hardware and request set with speculative decoding disabled. A credible comparison changes only the speculative-decoding setting between the control and experimental runs.
Do not report speedup alone. Include the test conditions and underlying measurements.
7. Production Monitoring and Troubleshooting
Continue monitoring after deployment. Set alert thresholds using the offline baseline established before rollout rather than copying example values.
Recommended alerts
- Declining acceptance: The moving average of accepted length falls below the offline baseline by more than the configured threshold.
- Excessive draft overhead: The drafting-time fraction exceeds its threshold, indicating that draft computation may be consuming the expected gains.
- Unexpected rollback growth: A sharp increase in rollback rate can indicate sampling-configuration changes or an implementation regression.
- Worse tail latency: P95 TPOT becomes worse than the control group with speculation disabled.
- Throughput below baseline: Automatically disable speculative decoding if throughput falls below the standard-decoding baseline.
- Abnormal output patterns: Increased repeated n-grams, garbled output, or skipped text can indicate rollback or numerical problems.
- GPU-memory pressure: Combined target-model and draft-model memory usage approaches the limit. Keep sufficient headroom for both.
- Communication failures: Multi-GPU timeouts or NCCL errors warrant checking whether the draft and target parallelism configurations are consistent with the deployment design.
For troubleshooting, use this sequence:
- Check for recent configuration changes.
- Examine acceptance metrics and the request-log distribution.
- Run the greedy-decoding consistency test.
- Inspect communication and GPU-memory metrics.
Record the findings from each step in the change record so that regressions can be traced later.
Speculative decoding is not a universal acceleration technique. Use the checklists above and benchmark with your own request distribution. Enable it in production only when measured results demonstrate a benefit.
