arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2602.02823cs.CL
收藏

R2-Router: 一种基于推理的LLM路由新范式

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

University of Science and Technology of China(中国科学技术大学)

Jiaqi Xue, Qian Lou, Jiarong Xing, Heng Huang

AI总结:

针对现有LLM路由忽略输出长度对质量和成本影响的问题,提出R2-Router,通过将输出长度预算作为可控变量联合选择最优LLM和预算,实现低成本高质量路由。

摘要:

随着LLM在能力和成本上的多样化,LLM路由通过学习预测每个LLM对给定查询的质量和成本,然后选择高质量低成本的LLM。然而,现有路由器隐式假设每个LLM对每个查询有固定的质量和成本,忽略了同一LLM的质量随输出长度变化的事实。这导致当估计成本超过预算时,路由器会排除强大的LLM,错过了这些LLM通过缩短输出长度以降低成本仍能提供高质量的机会。为了解决这个问题,我们引入了R2-Router,它将输出长度预算视为可控变量,并联合选择最佳LLM和长度预算,通过长度约束指令强制执行预算。这使得R2-Router能够发现,在先前方法无法看到的成本效益相当的情况下,受限输出的强大LLM可以超越较弱的LLM。结合路由器框架,我们构建了R2-Bench,这是第一个捕捉LLM在不同输出长度预算下行为的路由数据集。实验表明,与现有路由器相比,R2-Router以4-5倍更低的成本实现了最先进的性能。这项工作开辟了一个新方向:路由即推理,其中路由器从反应式选择器演变为深思熟虑的推理器,探索使用哪个LLM以及以何种成本预算。代码公开于https://github.com/UCF-ML-Research/R2-Router。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑