TL;DR
Speculative decoding speeds up LLM inference by having a small "draft" model guess $k$ future tokens and a large "target" model verify them all at once—but picking the right $k$ for a mixed batch of requests is surprisingly tricky. CurveK solves this by using the accepted-token counts already returned by the verifier to sketch a real-time throughput curve over all candidate draft lengths and simply picking its peak. It requires no extra training or model calls, yet boosts throughput by 8.5%–9.9% over prior adaptive methods in vLLM.
What Problem Does This Paper Address?
In batched LLM serving, requests from wildly different tasks—math reasoning, code generation, open-ended dialogue, summarization—often land in the same batch. Speculative decoding accelerates these batches by proposing $k$ draft tokens per step and verifying them in a single target-model pass.
Here is the catch: all requests in a batch typically share one draft length $k$, and choosing $k$ is a delicate balancing act. If $k$ is too small, you leave parallel verification capacity on the table. If $k$ is too large, you waste compute drafting tokens that get rejected. Worse, the "best" $k$ shifts constantly as batch size and workload composition change:
Existing adaptive controllers adjust $k$ using multi-armed bandit rewards, draft-model confidence, or scalar acceptance summaries (like the first-token acceptance rate). The authors show that these signals are too coarse: two batches can have the exact same first-position acceptance probability $p_1$ yet peak at completely different optimal draft lengths.
Methods
Instead of relying on a single scalar summary, CurveK estimates the full batch throughput curve $R(k)$ across every candidate draft length $k \in \{0, 1, \dots, K\}$:
$$R(k) = \frac{1 + L(k)}{1 + k c_r}$$
Here, $c_r = c_{\text{draft}} / c_{\text{verify}}$ is the relative cost of drafting one token (profiled once per hardware/model setup), and $L(k) = \sum_{j=1}^k p_j$ is the expected number of accepted draft tokens per request, where $p_j$ is the batch-average probability of accepting all of the first $j$ tokens.
CurveK estimates this curve online with zero extra model calls:
- Track per-request depth: After each verification step, the verifier already reports how many consecutive draft tokens each request accepted. If all $k_{t-1}$ tokens were accepted (and $k_{t-1} < K$), CurveK adds $+1$ to account for the possibility that acceptance could have continued.
- Smooth with EWMA: Each active request's accepted-depth estimate $\hat{Z}_{t,i}$ is updated using an exponentially weighted moving average (default $\beta = 0.5$). Completed requests are evicted immediately, so the state always reflects the current batch.
- Construct the curve and pick the peak: CurveK computes $\hat{L}_t(k) = \frac{1}{B} \sum_{i=1}^B \min(k, \hat{Z}_{t,i})$ across all $B$ active requests, plugs it into $\hat{R}_t(k)$, and selects $\hat{k}_t = \arg\max_k \hat{R}_t(k)$ for the next step.
This takes just $O(BK)$ simple arithmetic operations and $O(B)$ state storage.
Datasets
The authors evaluate CurveK across a broad set of single-workload and mixed-workload benchmarks:
- Single-workload: GSM8K (math), HumanEval (code), AlpacaEval (instruction following), SpecBench-Mix (eight task groups including QA, RAG, translation, and writing), and LMSYS-Chat-1M (dialogue).
- Multi-phase mixed-workload trace: A newly constructed serving trace that cycles through math-heavy, code-heavy, dialogue-heavy, long-context-heavy, and balanced phases, combining GSM8K, HumanEval, LMSYS-Chat-1M, CNN/DailyMail (summarization), Natural Questions/DPR (retrieval QA), and instruction-following prompts.
Key Insights and Ideas
- Scalar summaries are mathematically ambiguous: The paper proves (Proposition 2) that neither the first-position acceptance rate $p_1$ nor the mean accepted depth $L(K)$ uniquely determines the throughput-maximizing $k$. You need the shape of acceptance across positions.
- The throughput curve is unimodal: Under the normalized cost model, $R(k)$ rises to a single contiguous peak region and then falls (Proposition 1), making optimization a clean, finite search.
- Truncate before averaging, not after: Averaging request depths before truncating at $k$ (a variant called
MeanDepth-K) introduces a Jensen gap and drops throughput by 6.8% on average compared to CurveK's per-request truncation. - Decision stability matters: Even when next-step depth predictions have small errors (MAE of 0.312–0.404 tokens), CurveK's selected draft lengths still retain 94.7%–98.1% of the oracle-best throughput.
Key Results
Implemented in vLLM V1 across LLaMA-3.1-8B, Qwen3-8B, and LLaMA-3.3-70B (using EAGLE-3 and Medusa drafters on A100 and H20 GPUs):
- Throughput gains: Across six 8B settings, CurveK achieves the highest mean throughput in every comparison, outperforming OTF and TurboSpec by 8.5% and 9.9% on average. It also leads on all three workloads at the 70B scale on both A100 and H20.
- Beating fixed $k$: Across 21 single-workload settings, CurveK beats the best single fixed draft length by 2.37% (greedy) and 1.97% (sampling)—without needing an offline sweep.
- Streaming SLOs: Under random arrivals (3–14 req/s) with a Tight latency SLO, CurveK sustains $\ge 90\%$ attainment up to 10 req/s (vs. 7.5 for vanilla/fixed $k=5$, and 9 for OTF, TurboSpec, and Nightjar) and hits 61.7% attainment at 12 req/s (vs. 53.7% for OTF).
Limitations and Future Work
- Fixed cost ratio: CurveK assumes a pre-profiled relative draft cost $c_r$, though the implementation supports swapping in a measured per-length cost table when verification time scales strongly with $k$ at large batch sizes.
- Standard-decoding fallback: If CurveK repeatedly selects $k=0$ (standard decoding), verifier feedback dries up; the system must periodically run a short draft to refresh its acceptance estimates.
- Shared batch length: CurveK optimizes a single shared $k$ for the batch. Complementary techniques—such as assigning per-request draft lengths or coupling length control with SLO-aware scheduling—remain orthogonal directions.
Summary updated