arXiv:2602.02823cs.CL2026-02中稿 · ICML被引 13

让大模型路由学会根据输出长度动态选最优模型,省钱又提效。

R2-Router: A New Paradigm for LLM Routing with Reasoning

  • 把输出长度当可调变量,同时选最佳模型和长度预算。
  • 在4-5倍更低成本下达到顶尖性能,超越现有方法。
  • 适合关注大模型部署效率的开发者与研究者。

随着大模型能力与成本差异增大,大模型路由技术通过预测每个模型在特定查询下的质量与成本,选择高质量且低成本的模型。然而,现有方法隐含假设每个模型在每项查询中具有固定的质量与成本,忽略了同一模型的质量会随输出长度变化。这导致当模型预估成本超预算时被排除,错失其在短输出下仍能保持高质量、降低成本的潜力。为此,我们提出R2-Router,将输出长度预算视为可控变量,联合选择最优模型与长度预算,并通过长度约束指令实现预算控制。该方法使强大模型在受限输出下表现优于弱模型,而这种高效配置此前方法无法发现。我们还构建了首个覆盖多种输出长度预算的大模型行为数据集R2-Bench。实验表明,R2-Router在4-5倍更低成本下实现当前最优性能。本工作开启新方向:路由即推理,使路由器从被动选择者转变为主动探索‘用哪个模型、花多少成本’的理性决策者。代码已开源。

原文摘要 · Abstract (English)

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.

大模型路由推理优化成本控制

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。