TL;DR
TokenRouter is a high-performance serving system designed specifically for token-level LLM routing, where a single request can switch between different models (e.g., a small "drafter" and a large "expert") mid-generation. By decoupling routing logic from execution and introducing a novel "delayed-batching" scheduler, TokenRouter achieves up to 64x higher throughput than existing implementations, finally making fine-grained routing practical for production.
What Problem Does This Paper Address?
Model routing is a popular way to balance cost and quality: you send easy queries to a cheap model and hard ones to an expensive one. While most systems do this at the "query level," recent research shows that token-level routing—switching models for specific difficult tokens within a single response—is far more efficient.
However, existing serving systems like vLLM or SGLang are built on the assumption that a request stays with one model. When you try to implement token-level routing on these systems, you hit three walls:
- Step Desynchronization: Different models have different speeds. In a synchronized batch, the fast model sits idle waiting for the slow one.
- Batch Admission Delay: Frequent model switching means requests arrive at a sub-model at irregular times, often just missing the start of a new batch and causing "bubbles" of idle time.
- Implementation Complexity: Current systems don't have a clean way to handle mid-request handoffs, forcing developers to write complex, hacky code that breaks features like KV-caching.
Methods
The authors propose a "request-centric programming, model-centric execution" paradigm.
1. The Programming Interface
Developers only need to implement three simple functions: route (decide where to go), send (package the state), and receive (resume decoding). This hides the underlying system complexity.
2. Model-Centric Runtime
Instead of one giant server, TokenRouter launches an autonomous subserver for each LLM. These subservers communicate asynchronously.
- Tri-loop Execution: Standard servers have two loops (client-server and decoding). TokenRouter adds a third inter-model loop to handle peer requests without blocking the main decoding process.
- Handoff-Resume: When a request returns to a model, TokenRouter treats it as a "resumption" rather than a new request. This preserves the KV-cache and avoids re-calculating prefixes, turning a complex model switch into a simple token append.
3. Delayed-Batching Scheduler
To solve the "bubble" problem, the authors introduced a delayed-batching scheduler. Instead of starting a batch the moment a request arrives, the scheduler waits for a short, calculated interval to accumulate more requests. Comparison of scheduling strategies showing how delayed batching (d) reduces average latency compared to eager asynchronous scheduling (c). The authors even developed a mathematical model based on Discrete-Time Markov Chains (DTMC) to find the mathematically optimal waiting threshold ($B^*$) that maximizes throughput.
Datasets
The system was evaluated across several diverse workloads and benchmarks:
- Low-effort reasoning: AIME2024 (short input/output).
- High-effort reasoning: AIME2024 (short input, very long output).
- Agentic tasks: SWE-Smith (multi-turn, long trajectories).
- General benchmarks: CommonsenseQA and GSM8K.
They tested five different routing algorithms, including R2R, CITER, R-Stitch, Co-LLM, and ME, using model pairs like Qwen3-0.6B/32B and LLaMA2-7B/70B.
Key Insights and Ideas
- Asynchrony is King: The biggest performance killer in multi-model systems is global synchronization. By letting each subserver run at its own pace, TokenRouter keeps hardware utilization high.
- Waiting can be Faster: It sounds counter-intuitive, but intentionally delaying a batch for a few milliseconds (Delayed Batching) significantly increases throughput by ensuring batches are fuller and reducing the overhead of frequent, tiny executions.
- KV-Cache Continuity: The "pending" state for requests is a crucial engineering detail. It allows a request to "leave" a model's active batch but keep its memory reserved, making the return trip nearly instantaneous.
Key Results
TokenRouter consistently crushes both official algorithm implementations and standard serving baselines:
- Throughput Gains: It achieves 2.01x to 64.15x higher decoding throughput than existing systems.
- Efficiency Breakdown: Engineering optimizations (like CUDA graphs) provide a 1.71x boost, but the architectural changes (Async + Delayed Batching) push that to a total 2.76x gain over optimized baselines at concurrency 8.
- Pareto Frontier: As shown in Figure 1(b), TokenRouter achieves 18.58x higher throughput than the official R2R implementation while maintaining a stricter Service Level Objective (SLO) for speed.
Limitations and Future Work
- Geometric Distribution Assumption: The mathematical model for finding the optimal batching threshold assumes that the number of tokens generated between model switches follows a geometric distribution. While this holds for most current algorithms, it might fail for more complex, deterministic routing logic.
- Static Thresholds: Currently, the optimal threshold is calculated based on steady-state assumptions. Future work could involve dynamic thresholds that adapt to fluctuating traffic in real-time.
Overall, TokenRouter provides the first robust system architecture that makes the theoretical benefits of token-level routing a reality for high-traffic LLM deployments.
Summary updated