Confidence-Scheduled Speculative Decoding: Up to 85% Faster Single-User Generation
This article explains why speculative decoding often wastes verification capacity under high concurrency. It describes how confidence-scheduled verification addresses this problem through semi-autoregressive draft generation and hardware-aware control of verification length for each request. It also reviews offline acceptance length results and production speedups at matched overall throughput, notes the limits of applying these numbers to other setups, and outlines what teams need to evaluate the approach.
1. Wasted Verification Is the Core Problem
When a large language model generates text one token at a time, the bottleneck is usually memory bandwidth rather than compute. Each token requires reading all of the model weights, and a larger batch does not hide this memory access latency. Speculative decoding has therefore become a common way to speed up generation. A lightweight draft model first proposes a sequence of candidate tokens, and the target model then verifies the whole sequence in one parallel forward pass. If the candidates pass verification, several tokens cost the time of a single forward pass.
In production, this simple approach runs into two linked bottlenecks.
First, candidates become less likely to be accepted the further they extend. Longer draft sequences accumulate more error, so the probability that deeper candidate tokens match the target model’s true distribution drops quickly. Tree-based or parallel candidate expansion covers more branches, but the deeper nodes still take part in attention computation, logits computation, and KV cache management. The verifier will often reject them.
Second, under high concurrency, verifying low-confidence tail tokens consumes the target model’s batch capacity. The batch capacity of the target model is limited. The longer the verification window each request occupies, the fewer batch slots remain for other requests. Many low-confidence tokens are verified and then discarded, so valuable batch slots produce almost no accepted tokens.
As a result, simply increasing the number of draft candidates or making the tree larger does not necessarily improve end-to-end generation speed. The real problem is dynamic control of verification length: how far to verify, when to stop, and how to match the verification length to the current load.
2. The Core Method: Two-Stage Candidate Generation and Confidence-Scheduled Verification
To solve these linked bottlenecks, the method separates candidate generation from candidate verification, which are normally tied together in a fixed speculative decoding pipeline.
2.1 Semi-Autoregressive Generation: Parallel Candidates with Restored Dependencies
Fully parallel generation removes the ordering dependency between candidate tokens, and prediction quality drops sharply. Fully autoregressive generation, however, makes the draft model itself a latency bottleneck. The method uses a compromise, a semi-autoregressive structure:
- A parallel backbone produces candidate tokens for multiple positions at once. It does not wait for each preceding output, so it can quickly generate a candidate block.
- A lightweight sequential head restores dependencies within the block. It does not regenerate the entire block token by token. Instead, it applies a light sequential correction to the candidates from the parallel backbone, so the tokens in the block have approximately autoregressive dependencies.
This design balances speed and accuracy in the candidate generation stage. In the verification stage, the candidate block is not a set of fully independent guesses. Because its dependencies have been restored, the accepted length is more stable.
2.2 Confidence Scheduling: Deciding Verification Depth by Prefix Survival Probability
Good candidate generation alone is not enough, because candidate quality varies widely across requests and positions. The second key component is confidence-scheduled verification.
For each candidate token, the method computes a metric similar to a prefix survival probability. This is the probability that the tokens after the current prefix will still be accepted by the target model if verification continues. The scheduler reads this probability and combines it with the current hardware load to decide how long each request should be verified:
- When the load is low, the verification window can be wider. The scheduler verifies more candidate tokens to maximize acceptance length.
- When the load is high, the verification window narrows. The scheduler verifies only high-confidence prefixes, so low-confidence tail tokens do not take up batch capacity.
- Different requests can have different verification lengths, instead of sharing one fixed draft length across all requests.
This turns the verification budget from a fixed length into dynamic resource allocation. The verification depth for each request is no longer a guess from the draft model. It depends on both confidence and real-time load.
2.3 Hardware-Aware Scheduler
The scheduler is not a simple static threshold. It is hardware-aware. It considers the current GPU batch state, remaining GPU memory, queue length, and target model throughput. It makes real-time trade-offs between accepting as many candidates as possible and making sure other requests are not blocked. When resources are tight, the scheduler can shorten verification to a very small length and give capacity to requests with higher confidence. When the system is idle, it can lengthen verification to use the draft model’s potential more fully.
3. Evaluation: Acceptance Length Offline, End-to-End Speed Online
A speculative decoding method should not be judged only by candidate generation speed. In the industry, the usual first metric is acceptance length, followed by end-to-end metrics under real production traffic.
3.1 Offline Benchmarks: Macro-Average Acceptance Length Improves Significantly
The method was compared with two existing speculative decoding methods across 4B, 8B, and 14B model scales and several task types, including math, code, and everyday chat. The results were as follows:
- Relative to the first baseline, the macro-average acceptance length increased by about 30.9%, 26.7%, and 30.0% for the 4B, 8B, and 14B scales, respectively.
- Relative to the second baseline, the macro-average acceptance length increased by about 16.3%, 18.4%, and 18.3% for the same three scales, respectively.
A higher acceptance length means the draft model produces more valid tokens. It also means the target model confirms more tokens per verification batch. However, acceptance length is only a necessary condition for end-to-end gains, not a sufficient one. If verification length is not controlled, a high acceptance length can still slow the overall service, because invalid verification work fills the batch.
3.2 Production Deployment: Single-User Generation Speed Up to 85% Faster at Matched Throughput
The method was deployed to a production cluster and compared with an existing production baseline. “Matched overall throughput” means that single-user generation speed was measured without sacrificing the system’s total throughput.
Public data shows the following:
- For the lightweight model variant, single-user generation speed improved by about 60% to 85%.
- For the larger model variant, single-user generation speed improved by about 57% to 78%.
These results are easier to understand than offline gains. They are closer to what developers care about: whether typing feels faster and whether responses feel smoother to users.
3.3 These Results Should Not Be Generalized
These numbers come from specific model sizes, task distributions, service loads, and production configurations. They cannot be extended to say that all models will improve by more than 60%, and they do not mean that any deployment will see the same gains after adopting this method. On a different model, the match between draft and target models may differ. Under different traffic patterns, the best scheduler thresholds may also be different.
4. Open-Source Value and Practical Limits
The technical report covers not only the training method but also open-sources the related trained weights and training repository. The repository covers the full pipeline of data preparation, training, and evaluation, and includes three types of draft model approaches. Its main value lies in the following:
- It provides a reusable training framework for speculative decoding.
- It standardizes the full workflow for draft models, from training to evaluation.
- Developers can retrain and tune the draft model for their own models and tasks.
However, it is not a low-cost, one-click migration tool.
Using this framework requires significant engineering effort:
- The default cache requirements for the target model configuration are large. For a 4B-scale model, training and evaluation caches can reach tens of terabytes, roughly 38 TB. This exceeds the capacity of a single GPU.
- The default scripts assume a single node with 8 GPUs, so the training environment must be prepared at that scale.
- Users must complete data preparation, training, evaluation, and integration with the inference service on their own.
- Production results were compared against an existing production baseline, not by running the two candidate methods side by side in the same production environment. Be cautious when comparing the methods directly.
In short, if a team only wants to download the code and speed up an existing model immediately, it may face substantial obstacles. A better approach is to first study the repository as a training framework. Then train a draft model that fits your own model specifications and traffic patterns, and verify the gains in your real serving environment.
5. Recommendations for Engineering Adoption
Teams evaluating speculative decoding can follow these four steps:
- Measure offline acceptance length first. Use a dataset from your own workloads and compare the acceptance length of a fixed draft length with that of dynamic verification length.
- Run a small online experiment. Send a small share of production traffic to the new scheduling policy. Track overall throughput, queuing latency, single-request generation speed, and GPU utilization.
- Tune thresholds dynamically. Confidence thresholds should not be fixed once. During peak hours, you may narrow the verification window. During off-peak hours, you may widen it. Over time, this produces a scheduling policy that matches your business rhythm.
- Monitor the verification waste rate continuously. Define a metric such as the share of invalid verification tokens: the tokens that the target model verified but eventually discarded, divided by all verified tokens. This metric shows whether batch resources are being wasted more directly than average acceptance length does.
The following is illustrative scheduling pseudocode. It does not represent a real interface. It only helps explain the idea of dynamically deciding verification length:
def decide_verify_length(prefix_survival_prob, current_load):# The higher the current_load, the smaller the verification budget.if current_load > 0.9:max_verify_len = 1elif current_load < 0.6:max_verify_len = len(prefix_survival_prob)else:max_verify_len = max(1, int(len(prefix_survival_prob) * 0.5))verify_len = 0for prob in prefix_survival_prob:if verify_len >= max_verify_len:break# Stop extending verification once confidence falls below the threshold.if prob < 0.5:breakverify_len += 1return max(verify_len, 1)
On Baidu AI Cloud, teams can combine general cloud capabilities, such as container services, object storage, and logging and monitoring, to connect large-scale training caches, evaluation scripts, and online services. The main challenge, however, is still choosing confidence thresholds that fit your own traffic characteristics. Copying the default parameters from the public report is not enough.
6. Conclusion
Speculative decoding optimization is no longer only a question of how accurately the draft model guesses. It has become a scheduling problem: who gets verification resources, and how long verification should run to be worthwhile. Semi-autoregressive candidate generation balances the quality and speed of drafts. Confidence-scheduled verification reduces resource waste in production systems. Together, these two components can raise single-user generation speed by 60% to 85% while matching overall throughput.
For developers, the most important step is not to copy a specific performance number. It is to understand the trade-offs behind the technique and then revalidate it on your own models, workloads, and deployment environment. An effective acceleration approach depends on how well the system design fits the production load.
