提出首个面向多智能体系统的智能路由框架,高效分配角色与模型。
MasRouter: Learning to Route LLMs for Multi-Agent Systems
- 分层控制网络决定协作模式、角色分配与LLM选择
- 在MBPP上提升8.2%,在HumanEval上降低52%开销
- 可直接接入主流框架,适合需要降低成本的多智能体应用
由大语言模型(LLM)驱动的多智能体系统(MAS)虽拓展了LLM能力边界,但常伴随高昂成本与动态模型选择难题。现有路由方法仅针对单智能体优化,忽略多智能体中的协作模式与角色分配决策。为此,我们首次提出多智能体系统路由(MASR)问题,将所有组件统一到路由框架中。我们提出MasRouter,首个高性能、低成本且具备归纳能力的MASR方案。其通过级联控制器网络逐步完成协作模式判定、角色分配与LLM路由,实现效果与效率的平衡。大量实验表明:(1) 性能优异,在MBPP上较最优方法提升1.8%~8.2%;(2) 成本可控,在HumanEval上开销降低最高达52.07%;(3) 即插即用,可无缝集成主流MAS框架,通过定制化路由降低17.21%~28.17%开销。代码已开源。
原文摘要 · Abstract (English)
Multi-agent systems (MAS) powered by Large Language Models (LLMs) have been demonstrated to push the boundaries of LLM capabilities, yet they often incur significant costs and face challenges in dynamic LLM selection. Current LLM routing methods effectively reduce overhead in single-agent scenarios by customizing LLM selection for each query, but they overlook the critical decisions regarding collaboration modes and agent roles in MAS. In response to this challenge, we first introduce the problem of Multi-Agent System Routing (MASR), which integrates all components of MAS into a unified routing framework. Toward this goal, we propose MasRouter, the first high-performing, cost-effective, and inductive MASR solution. MasRouter employs collaboration mode determination, role allocation, and LLM routing through a cascaded controller network, progressively constructing a MAS that balances effectiveness and efficiency. Extensive experiments demonstrate that MasRouter is (1) high-performing, achieving a $1.8\%\sim8.2\%$ improvement over the state-of-the-art method on MBPP; (2) economical, reducing overhead by up to $52.07\%$ compared to SOTA methods on HumanEval; and (3) plug-and-play, seamlessly integrating with mainstream MAS frameworks, reducing overhead by $17.21\%\sim28.17\%$ via customized routing. The code is available at https://github.com/yanweiyue/masrouter.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。