Introduction
Large Language Model (LLM) serving is characterized by high computational costs and strict latency requirements. Speculative decoding has emerged as a promising technique to accelerate inference by using a small "draft" model to predict multiple tokens, which are then verified in parallel by a larger "target" model.
However, traditional speculative decoding employs a fixed speculative length (SL)—the number of tokens drafted per round. This static approach faces a "Goldilocks" problem: too many drafted tokens waste computation if rejected, while too few leave potential performance gains on the table. Furthermore, real-world workloads involve fluctuating request rates and diverse hardware, making a fixed SL even more inefficient and leading to Service Level Objective (SLO) violations.
The AdaSpec Framework
To address these challenges, the authors propose AdaSpec, an inference framework that transforms speculative decoding into a dynamic, SLO-aware system. Built on the vLLM engine, AdaSpec introduces three core components to optimize the speculative process in real-time:
- Adaptive Drafter: This module employs a "predict-execute-correct" strategy. By analyzing historical confidence scores, it dynamically decides whether to continue drafting tokens or to stop and initiate verification, optimizing the draft length for current conditions.
- Confidence Prior Verifier: In batched environments, different requests vary in predictability. AdaSpec decouples speculation across the batch, selectively dropping low-confidence tokens for specific requests before they reach the target model. This ensures that "hard" requests do not bottleneck the "easy" ones.
- SLO-Aware Efficiency Estimator: This component acts as a safety mechanism. It utilizes a mathematical model to predict the Time Per Output Token (TPOT). If a long speculative draft is predicted to exceed the user's SLO, the system automatically shortens the draft to prioritize latency targets.
The system is underpinned by a theoretical model proving that throughput is "quasi-concave" relative to speculative length—meaning there is a single optimal peak that can be found via lightweight online tuning.
Performance and Evaluation
The researchers evaluated AdaSpec using production traces from BurstGPT and Mooncake, alongside the SpecBench benchmark across tasks like translation, summarization, and math.
Key findings include:
- Significant Throughput Gains: AdaSpec achieved a 16% to 66% speedup over state-of-the-art systems like SpecInfer and outperformed threshold-based dynamic methods by up to 58%.
- Robust SLO Attainment: Unlike vanilla speculative decoding, which often misses latency targets under heavy load, AdaSpec maintained a 90%+ SLO attainment rate.
- Hardware Adaptability: The system demonstrated consistent improvements across various NVIDIA GPUs (L40, A100), adapting to the specific "arithmetic intensity" of each platform. On memory-bound GPUs, long drafts often provide "free" performance, whereas compute-bound GPUs require more conservative speculation.
Conclusion
AdaSpec demonstrates that the optimal speculative length is not a static value but a moving target influenced by model accuracy, hardware constraints, and workload dynamics. By making speculative decoding adaptive and SLO-aware, AdaSpec provides a more efficient and reliable solution for large-scale LLM deployment. Future work may involve integrating this adaptive logic into more complex tree-search speculation methods.
Summary updated