MasRouter: Learning to Route LLMs for Multi-Agent Systems

Yanwei Yue, Gui-Min Zhang, Boyang Liu, Guancheng Wan, Kun Wang, Dawei Cheng, Yiyan Qi

arXiv:2502.11133 · 2026-07-27 공개 · arXiv · PDF

multi-agent-systems mbpp plug-and-play llm-routing humaneval cascaded-controller masr collaboration-mode

Abstract

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.

한국어 요약

한 줄 요약

MasRouter는 다중 에이전트 시스템에서 협력 모드, 역할, LLM을 통합적으로 라우팅하여 성능과 비용을 균형 있게 최적화하는 첫 번째 솔루션입니다.

핵심 기여도

핵심 아이디어

기존 LLM 라우팅은 단일 에이전트에만 초점을 맞추며, 다중 에이전트 시스템(MAS)에서의 **협력 모드 결정**, **역할 할당**, **LLM 라우팅**을 통합적으로 고려하지 못했다. 이에 MasRouter는 **협력 결정**(Collaboration Determiner), **역할 할당**(Role Allocator), **LLM 라우팅**(LLM Router)을 **캐스케이드 컨트롤러 네트워크**를 통해 단계적으로 처리함으로써, 각 쿼리에 맞춘 최적의 MAS를 구성합니다. 특히, **협력 결정** 단계에서는 **변분 잠재 변수 모델**(Variational Latent Variable Model)을 사용하여 최적의 협력 모듈을 선택하고, **역할 할당**은 **구조적 확률적 캐스케이드**(Structured Probabilistic Cascade)를 통해 점진적으로 생성됩니다. **LLM 라우팅**은 각 에이전트의 역할과 협력 토폴로지에 따라 **다항 분포**(Multinomial Distribution) 문제로 모델링됩니다.

기술적 접근법

주요 결과

의의 및 한계

MasRouter는 다중 에이전트 시스템에서 LLM 라우팅의 새로운 패러다임을 제시하며, **성능과 비용을 동시에 최적화**하는 데 기여합니다. 특히, **협력 모드와 역할 할당을 고려한 통합 라우팅**은 기존 연구에서 다루지 못한 핵심 문제를 해결합니다. 그러나, **모델의 유연성**과 **다양한 도메인에 대한 일반화 능력**은 추가 연구가 필요합니다. 또한, **비용 평가 함수 C(·)**의 정확한 설계가 성능과 비용 균형에 큰 영향을 미치므로, 이에 대한 더 많은 실험적 검증이 필요합니다.

실용적 활용

MasRouter는 **코드 생성**, **수학적 추론**, **소프트웨어 개발** 등 다양한 도메인에서의 **다중 에이전트 시스템 구축**에 적용 가능합니다. 특히, **비용 효율적인 대규모 컬렉티브 인텔리전스**(Collective Intelligence) 시스템 개발에 기여할 수 있으며, **LLM 기반 자동화 플랫폼**이나 **산업용 AI 솔루션**에 즉시 통합하여 활용할 수 있습니다.