Research
R2-Router: A New Paradigm for LLM Routing with Reasoning
R2-Router: A New Paradigm for LLM Routing with Reasoning Overview Research area: Natural Language Processing / Machine Learning — specifically LLM routing, the systems-level problem of deciding which
- arXiv
- 2602.02823
- Published
- 2026-02-02
- Authors
- Jiaqi Xue, Qian Lou, Jiarong Xing, Heng Huang
AI summary
R2-Router: A New Paradigm for LLM Routing with ReasoningOverview
Research area: Natural Language Processing / Machine Learning — specifically LLM routing, the systems-level problem of deciding which large language model to send each query to.
Technical level: Intermediate. The paper combines an intuitive core idea (output length is controllable) with a lightweight machine-learning router (multi-head MLPs over query embeddings). The math is limited to a search-space dominance argument; no deep theoretical background is required.
Scope: The paper proposes R2-Router, a router that jointly selects an LLM and an output-length budget, plus R2-Bench, a dataset that records each LLM's behavior across many token budgets, and reports that this combination reaches comparable quality at 4–5 times lower cost than reactive routers.
What This Paper Is About
Existing LLM routers predict a single quality and a single cost for each model on a given query, then pick whichever model scores best under a quality–cost trade-off. This treats every LLM as a fixed point, so a powerful but expensive model like Qwen3-235B gets discarded whenever its estimated cost exceeds the budget — even though the same model might still produce good answers more cheaply if asked to be brief. The paper's goal is to make the router reason about how quality changes with output length, and to select both the model and a token budget together.
Key Contributions
-
R2-Router, a routing framework that treats output length budget as a controllable variable and jointly selects the best LLM and the best budget, enforcing the choice with length-constrained instructions such as "use at most K tokens." This reframes routing from "routing on points" to "routing on curves," described by the authors as routing as reasoning.
-
R2-Bench, described as the first LLM routing dataset capturing LLM behavior across diverse output-length budgets. It contains 30,968 queries spanning 20 categories from 6 benchmarks, with responses from 15 LLMs at 16 cost levels per query.
-
An optimization-dominance argument (Theorem 4.3) showing that the reasoning-based search space over (LLM, budget) pairs contains the reactive router's fixed-point search space, so the maximum achievable utility of the reasoning router is at least as high.
-
A plug-in integration design, demonstrated by combining R2-Router with UniRouter (Uni-R2Router) so that existing routers can be extended from predicting a single value to predicting a quality–cost curve.
Main Findings
-
Oracle upper bound rises: On R2-Bench versus a SPROUT version reconstructed with the same LLM pool, judge, queries, and ground truth, per-LLM Oracle selection improves AUDC from 0.85 to 0.98, lowers QNC from 0.18 to 0.04, and raises Peak Quality from 0.90 to 0.98.
-
State-of-the-art cost efficiency: R2-Router reaches an average quality of 0.8 at a cost of approximately 0.5×10⁻³, while reactive baselines need 4× to 5× that budget to match similar performance. All reported costs are total costs (input plus output tokens), not output-only.
-
Dynamic-pool generalization: On a simulated transition from a 6-LLM pool to a pool with 5 unseen models, Uni-R2Router achieves a higher AUDC (0.623 vs. 0.590) than point-based UniRouter while reducing QNC by 80%.
-
Out-of-distribution robustness: Splitting MMLU-Pro into STEM (training) and non-STEM (testing) disciplines, R2-Router records an AUDC of 0.71 versus 0.67 for the next-best method, CARROT-L.
-
Data efficiency: QNC converges to near-optimal (approximately 0.12) with as few as 6 to 8 anchor points, and even a coarse K=4 setting outperforms MIRT (QNC = 0.43) and CARROT-L (QNC = 0.32).
-
Robust to component swaps: Replacing the default Qwen3-Embedding-0.6B encoder with MiniLM-L6-v2, R2-Router still attains the lowest QNC (0.32). Swapping the MLP head for an LGBM regressor raises AUDC to 0.80 with QNC 0.29. Under DeepSeek-V3.1 as the test-time judge, R2-Router reaches AUDC 0.80 and QNC 0.35.
-
Prompting alone does not explain the gains: Adding a length-constraint prompt to the reactive baseline does not give it the advantage, because such prompts change model outputs but not the router's static cost estimates or its selection logic.
-
Constraint compliance depends on model size: Large models such as Qwen3-235B and DeepSeek-V3 follow length constraints above 82% compliance even at a 10-token budget and above 97% at budgets of 100 tokens or more. Models below 4B drop to 3%–21% compliance at budget 10.
-
Leaderboard result: R2-Router ranks first on the public RouterArena leaderboard at the time of acceptance.
Methodology in Plain English
The team starts from the observation that an LLM's answer quality rises with output length and then saturates. Rather than profiling a model once, they profile it repeatedly: for every (query, LLM) pair they collect answers under many fixed token budgets and score each answer from 0 to 1 with an LLM judge.
To build R2-Bench, they pull queries from six public benchmarks — GPQA, MuSR, MMLU-Pro, MATH, OpenHermes, and RAGBench — and run 15 open-source models ranging from 0.6B to 235B parameters at 16 cost levels: 10, 20, 30, 40, 50, 80, 100, 150, 200, 300, 500, 800, 1200, 2000, 4000, and a "default" setting with no instruction but a 4000-token ceiling. Length is enforced by the instruction "use at most k tokens" plus truncation. To pick a judge, they sampled 500 responses, had 30 expert annotators label them, and compared four candidate judges; Qwen3-80B-Instruct had the highest Pearson correlation with human judgments (ρ = 0.82) and became the final judge.
The router itself is small. A shared encoder (Qwen3-Embedding-0.6B, producing 1024-dimensional query embeddings) feeds a set of per-LLM, per-cost prediction heads — each a three-layer MLP with hidden dimensions [256, 128, 64], ReLU activations, and a sigmoid output that keeps predictions in [0, 1]. Heads are trained with MSE loss using Adam at a learning rate of 1×10⁻⁴ for 100 epochs.
At inference, the user supplies a budget limit and a trade-off coefficient λ. The router scores every (LLM, cost) combination as (1−λ)·Q̂ − λ·C and picks the highest-scoring pair, then sends the query to that LLM with the instruction to use at most that many tokens. All reported results use discrete routing over K = 16 anchors; piecewise linear interpolation between anchors is presented as an optional way to shrink the number of heads when collecting offline data is expensive. Evaluation sweeps λ over [0, 1] to trace a deferral curve and reports AUDC, Peak Quality, and QNC, averaged over 5 independent runs with different random seeds.
Why This Matters
Impact on research. The paper argues that an entire class of routers has been optimizing over a search space that is artificially too small. If quality is a function of a controllable variable — output length — then the right unit of comparison is a curve, not a point. The authors position this as opening a direction called routing as reasoning, where the router deliberates about configurations before committing, and they show the idea is orthogonal to how quality is estimated (regression, similarity search, or probabilistic modeling).
Real-world applications:
- Cost-controlled API gateways: Production platforms that must respect a per-query or per-month spend cap could route strong models with tight budgets instead of falling back to weaker models.
- Dynamic model marketplaces: When providers add or retire models, a curve-based profile of each model (as in Uni-R2Router) lets the router adapt without full retraining.
- Latency- and budget-sensitive assistants: Systems that already compress prompts and outputs could combine that with per-query budget selection rather than a single global setting.
- Evaluation and benchmarking infrastructure: R2-Bench's multi-budget design gives a way to measure cost-quality trade-offs that single-response benchmark datasets cannot express.
Industry relevance. The paper notes that routers are already deployed in open-source stacks (HuggingFace, vLLM), in commercial systems (an internal router in OpenAI's GPT-5, a paid model router in Azure AI Foundry), and in routing platforms such as OpenRouter, NotDiamond, and RequestyAI. The reported routing overhead — under 400 ms per query, less than 1% of total LLM generation time — and the modest training cost (about 30 minutes for 15 LLMs on a single NVIDIA RTX 3090, plus under $50 in API cost and roughly 30 minutes of training to add a model like Gemini 3 Pro Preview) are framed as practical for deployment.
Future Directions
-
Beyond output length. The authors suggest the core idea — treating LLM behavior as controllable rather than fixed — may extend to system prompts, decoding strategies, or reasoning depth, so that the router searches over a broader configuration space.
-
Thinking-token budgets for reasoning models. The paper reports that the approach "extends naturally to thinking-token budgets on reasoning LLMs" (Appendix C), leaving open how far curve-based routing generalizes across reasoning-model behavior.
-
Handling model updates and distribution shift. The paper states that re-estimation is needed only when a model is updated or the query distribution shifts substantially, without specifying how to detect or respond to such shifts.
-
Constraint compliance as a first-class signal. Small models (below 4B) follow tight token budgets only 3%–21% of the time at budget 10, so a router that also reasons about whether a model will actually respect its budget remains an open problem.
Target Audience
This paper is most useful to ML systems engineers and infrastructure teams who deploy multiple LLMs and need to manage cost without sacrificing quality; to researchers working on routing, model selection, or inference-time compute allocation, who can build directly on R2-Bench; and to benchmark designers interested in how evaluation data should represent a model's behavior across operating points. Readers need only a working familiarity with LLM inference and basic regression to follow the method.
Authors’ abstract
As LLMs proliferate with diverse capabilities and costs, LLM routing has emerged by learning to predict each LLM's quality and cost for a given query, then selecting the one with high quality and low cost. However, existing routers implicitly assume a single fixed quality and cost per LLM for each query, ignoring that the same LLM's quality varies with its output length. This causes routers to exclude powerful LLMs when their estimated cost exceeds the budget, missing the opportunity that these LLMs could still deliver high quality at reduced cost with shorter outputs. To address this, we introduce R2-Router, which treats output length budget as a controllable variable and jointly selects the best LLM and length budget, enforcing the budget via length-constrained instructions. This enables R2-Router to discover that a powerful LLM with constrained output can outperform a weaker LLM at comparable cost-efficient configurations invisible to prior methods. Together with the router framework, we construct R2-Bench, the first routing dataset capturing LLM behavior across diverse output length budgets. Experiments show that R2-Router achieves state-of-the-art performance at 4-5\times lower cost compared with existing routers. This work opens a new direction: routing as reasoning, where routers evolve from reactive selectors to deliberate reasoners that explore which LLM to use and at what cost budget. The code is publicly available at https://github.com/UCF-ML-Research/R2-Router.