specrouter
SpecRouter: Reusable Payoff Prediction for Cost-Aware Speculative Decoding
Bhansali, Shrenik, Gaurav, Kumar, Ambardekar, Amol, Mitra, Saptarshi, Vijayan, Karthik, Heck, Larry
Speculative decoding obtains draft tokens in diverse ways - copying from the context, n-gram lookup, a small draft model, or a learned tree drafter - and which drafter is fastest depends on both the generated text and the hardware and batch size. We introduce ReFit to separate these two factors. A 0.58M-parameter predictor reads the target model's hidden state and estimates each drafter's committed tokens; a separately calibrated cost model prices each drafter on the current hardware; only the drafter with the lowest predicted cost per committed token runs. Training needs no exploration: with deterministic drafters and greedy verification, the output is the same whichever drafter runs, so every drafter's committed length at every prefix can be computed exactly offline; under speculative sampling, its expectation follows in closed form from one target pass. We evaluate on 16 workloads with 100 held-out requests each. Averaged over workloads, ReFit speeds up decoding by $2.75\times$ on Llama-3.1-8B and $2.95\times$ on Qwen3-8B, beating EAGLE-3, the strongest fixed drafter, by 30% and 27%; with every drafter tuned on validation data, its margin over tuned EAGLE-3 is 27.5% and 24.2%. It also exceeds the best fixed drafter chosen per workload in hindsight, and its gains hold under sampling, with thinking mode enabled, and on Qwen3-32B and Llama-3.3-70B targets. Comparing costs explicitly is the largest single source of this gain. ReFit also outperforms online methods that learn drafter choice during generation, reaching $4.16\times$ versus $3.79\times$ on a pool of domain-specialized drafters. A single predictor, never retrained, is the fastest policy in a deployment campaign on A40 and H200 GPUs at batch sizes 1, 4, and 16; only its cost model is recalibrated, and in batched serving it meets every latency target that any fixed policy meets, which no single fixed policy does.
SpecRouter: Adaptive Routing for Multi-Level Speculative Decoding in Large Language Models
Wu, Hang, Zhu, Jianian, Li, Yinghui, Wang, Haojie, Hou, Biao, Zhai, Jidong
Large Language Models (LLMs) present a critical trade-off between inference quality and computational cost: larger models offer superior capabilities but incur significant latency, while smaller models are faster but less powerful. Existing serving strategies often employ fixed model scales or static two-stage speculative decoding, failing to dynamically adapt to the varying complexities of user requests or fluctuations in system performance. This paper introduces \systemname{}, a novel framework that reimagines LLM inference as an adaptive routing problem solved through multi-level speculative decoding. \systemname{} dynamically constructs and optimizes inference "paths" (chains of models) based on real-time feedback, addressing the limitations of static approaches. Our contributions are threefold: (1) An \textbf{adaptive model chain scheduling} mechanism that leverages performance profiling (execution times) and predictive similarity metrics (derived from token distribution divergence) to continuously select the optimal sequence of draft and verifier models, minimizing predicted latency per generated token. (2) A \textbf{multi-level collaborative verification} framework where intermediate models within the selected chain can validate speculative tokens, reducing the verification burden on the final, most powerful target model. (3) A \textbf{synchronized state management} system providing efficient, consistent KV cache handling across heterogeneous models in the chain, including precise, low-overhead rollbacks tailored for asynchronous batch processing inherent in multi-level speculation. Preliminary experiments demonstrate the validity of our method.