用强化学习让大模型路由系统学会多轮协作与整合,提升任务效果并控制成本。
Router-R1: Teaching LLMs Multi-Round Routing and Aggregation via Reinforcement Learning
- 将路由决策建模为多轮交互过程,让路由器像大模型一样思考后选择
- 在7个问答基准上超越基线,兼顾性能与成本,推理延迟降低30%
- 仅需价格、延迟等简单信息就能泛化到未见过的模型,实用性强
大规模语言模型(LLMs)的快速发展催生了各类大模型路由系统,用于将用户请求分配给最合适的模型。然而,现有路由系统通常采用单轮一对一映射(即孤立地将每个请求分配给单一模型),难以应对需要多个模型互补优势的复杂任务。本文提出 extbf{Router-R1},一种基于强化学习(RL)的框架,将多模型路由与聚合建模为一个序列决策过程。Router-R1 将自身作为具备推理能力的大模型,通过交错执行“思考”(内部推敲)和“路由”(动态调用模型)动作,并将每次响应融入其不断演化的上下文。为促进学习,采用轻量级规则奖励机制,包含格式奖励、最终结果奖励及新颖的成本奖励,以优化性能与成本之间的权衡。Router-R1 仅依赖价格、延迟和示例性能等简单模型描述符,实现对未见模型选择的强大泛化能力。在七个通用及多跳问答基准上的实验表明,Router-R1 超越多个强基线,在保持稳健泛化和成本管理的同时取得更优性能。
原文摘要 · Abstract (English)
The rapid emergence of diverse large language models (LLMs) has spurred the development of LLM routers that assign user queries to the most suitable model. However, existing LLM routers typically perform a single-round, one-to-one mapping (\textit{i.e.}, assigning each query to a single model in isolation), which limits their capability to tackle complex tasks that demand the complementary strengths of multiple LLMs. In this paper, we present \textbf{Router-R1}, a reinforcement learning (RL)-based framework that formulates multi-LLM routing and aggregation as a sequential decision process. Router-R1 instantiates the router itself as a capable LLM, leveraging its reasoning ability to interleave "think" actions (internal deliberation) with "route" actions (dynamic model invocation), and integrates each response into its evolving context. To facilitate learning, we employ a lightweight rule-based reward comprising format rewards, final outcome rewards, and a novel cost reward for optimizing the balance between performance and cost, opening a pathway toward enhancing performance-cost trade-offs via RL. Router-R1 also conditions only on simple model descriptors such as pricing, latency, and example performance, enabling strong generalization to unseen model selection. Experiments on seven general and multi-hop QA benchmarks show that Router-R1 outperforms several strong baselines, achieving superior performance while maintaining robust generalization and cost management.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。