MAS-GPT: Training LLMs to Build LLM-based Multi-Agent Systems

Published: 01 May 2025, Last Modified: 18 Jun 2025ICML 2025 posterEveryoneRevisionsBibTeXCC BY 4.0
TL;DR: We propose MAS-GPT that simplifies the process of building query-specific multi-agent systems, making it as simple as querying ChatGPT.
Abstract: LLM-based multi-agent systems (MAS) have shown significant potential in tackling diverse tasks. However, to design effective MAS, existing approaches heavily rely on manual configurations or multiple calls of advanced LLMs, resulting in inadaptability and high inference costs. In this paper, we simplify the process of building an MAS by reframing it as a generative language task, where the input is a user query and the output is a corresponding MAS. To address this novel task, we unify the representation of MAS as executable code and propose a consistency-oriented data construction pipeline to create a high-quality dataset comprising coherent and consistent query-MAS pairs. Using this dataset, we train MAS-GPT, an open-source medium-sized LLM that is capable of generating query-adaptive MAS within a single LLM inference. The generated MAS can be seamlessly applied to process user queries and deliver high-quality responses. Extensive experiments on 9 benchmarks and 5 LLMs show that the proposed MAS-GPT consistently outperforms 10+ baseline MAS methods on diverse settings, indicating MAS-GPT's high effectiveness, efficiency and strong generalization ability. The codes are released at \url{https://github.com/rui-ye/MAS-GPT}.
Lay Summary: Building powerful AI systems with multiple collaborating agents (like a team of experts) is exciting, but it’s currently too difficult and expensive for most people to use. Each new task requires manually setting up the team or making many costly AI calls, making these systems inflexible and slow. To fix this, we created MAS-GPT, an AI that learns to automatically design these multi-agent teams. We teach MAS-GPT by showing it many examples of problems and the best team setups to solve them. By representing these teams as executable code, MAS-GPT can now generate a custom team for any new problem in a single step, just like asking ChatGPT. This means building advanced AI systems becomes fast, cheap, and adaptable. Our experiments show MAS-GPT consistently outperforms existing methods across various tasks and different AIs, even boosting complex problem-solving abilities. MAS-GPT paves the way for wider use of powerful multi-agent AI, making sophisticated AI accessible to everyone.
Link To Code: https://github.com/rui-ye/MAS-GPT
Primary Area: Deep Learning->Large Language Models
Keywords: large language models, multi-agent systems
Submission Number: 2414
Loading