arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2606.22902cs.AI
收藏

Agent-as-a-Router: 面向编码任务的智能体模型路由

Agent-as-a-Router: Agentic Model Routing for Coding Tasks

National University of Singapore(新加坡国立大学);DAMO Academy, Alibaba Group(阿里巴巴达摩院);University of California, Berkeley(加州大学伯克利分校);The Hong Kong University of Science and Technology(香港科技大学);Zhejiang University(浙江大学)

Pengfei Zhou, Zhiwei Tang, Yixing Ma, Jiasheng Tang, Yizeng Han, Zhenglin Wan, Fanqing Meng, Wei Wang, Bohan Zhuang, Wangbo Zhao, Yang You

AI总结:

提出Agent-as-a-Router框架,通过C-A-F循环积累执行经验,实现编码任务的动态模型路由,ACRouter在分布内任务上取得最低累积遗憾并泛化到分布外任务。

摘要:

真实用户通常可以访问来自不同提供商的多个大型语言模型(LLM),这些LLM往往在不同领域表现出色,但没有一个在所有领域都占主导地位。因此,将每个任务路由到最合适的模型对于性能和成本都至关重要。现有的路由器将此视为一个静态的、一次性的分类问题。然而,我们识别出这些路由器的性能瓶颈在于信息不足:简单地在任务维度级别上为普通LLM路由器增加性能统计数据,就能带来15.3%的相对提升,超过了基于相同维度级别先验的启发式路由器。受此发现启发,我们提出了Agent-as-a-Router,一个将路由形式化为C-A-F循环(上下文->动作->反馈->上下文)的框架。它通过在部署过程中积累基于执行的经验来缩小信息差距。我们将该框架实例化为ACRouter,由编排器、验证器、记忆模块组成,并引入了CodeRouterBench,一个包含约10K个任务实例的评估环境,这些实例来自8个前沿LLM的验证分数,支持基于遗憾的流式任务路由器比较。实验表明,ACRouter在分布内任务上实现了最低的累积遗憾,并泛化到分布外的智能体编程任务,证明了我们的路由框架主动缩小了信息差距。代码和基准测试已发布在此https URL。

英文摘要:

Real-world users typically have access to multiple Large Language Models (LLMs) from different providers, and these LLMs often excel at distinct domains, yet none dominate all. Consequently, routing each task to the most suitable model becomes critical for both performance and cost. Existing routers treat this as a static, one-off classification problem. However, we identify the performance bottleneck for these routers as information deficit: simply augmenting a vanilla LLM router with performance statistics at the task-dimension level yields a 15.3% relative gain, surpassing a heuristic router built on the same dimension-level priors. Motivated by this finding, we propose Agent-as-a-Router, a framework that formalizes routing as a C-A-F loop (Context->Action->Feedback->Context). It closes the information gap by accumulating execution-grounded experience during deployment. We instantiate this framework as ACRouter, composed of an Orchestrator, a Verifier, a Memory module, and introduce CodeRouterBench, an evaluation environment comprising ~10K task instances with verified scores from 8 frontier LLMs, enabling regret-based router comparison on streaming tasks. Experiments show that ACRouter achieves the lowest cumulative regret on in-distribution tasks and generalizes to out-of-distribution agentic-programming tasks, demonstrating that our routing framework actively closes the information gap. Codes and benchmarks are released at https://github.com/LanceZPF/agent-as-a-router.

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

↑