TL;DR
BAMAS (Budget-Aware Multi-Agent Systems) is a new framework that treats the construction of LLM-based agent teams as a constrained optimization problem. By jointly optimizing LLM selection (via Integer Linear Programming) and collaboration structure (via Reinforcement Learning), it achieves state-of-the-art performance while slashing operational costs by up to 86%.
What Problem Does This Paper Address?
Large Language Model (LLM) multi-agent systems (MAS)—where multiple specialized agents collaborate to solve a task—have shown incredible potential in coding and reasoning. However, they are notoriously "token-hungry." A single complex task can trigger dozens of API calls, leading to unpredictable and often exorbitant costs.
Existing frameworks like AutoGen or MetaGPT focus primarily on maximizing performance, often treating cost as an afterthought. In a production environment, this lack of "budget-first" design makes MAS difficult to scale. The authors of BAMAS ask a fundamental question: How can we design a multi-agent system that delivers the strongest possible performance while strictly adhering to a predefined financial budget?
Methods
BAMAS breaks the problem into three distinct stages:
- Budget-Constrained LLM Provisioning: Instead of just picking the "best" model, BAMAS uses Integer Linear Programming (ILP) to select an optimal "pool" of LLMs from an available set. It uses the LMSys Chatbot Arena leaderboard as a proxy for performance. The ILP is designed lexicographically: it prioritizes getting the highest-tier model possible within the budget, as empirical evidence suggests one strong model often outperforms an ensemble of many weak ones.
- Agent Collaboration Topology Selection: Once the models are chosen, the system must decide how they talk to each other. BAMAS chooses from a library of four common topologies:
- Linear: Sequential reasoning (Agent A $\rightarrow$ Agent B).
- Star: Parallel hypothesis generation and evaluation.
- Feedback: Iterative refinement (Generator $\leftrightarrow$ Critic).
-
Planner-Driven: A central agent dynamically coordinates others.
To make this choice, BAMAS uses a policy network trained via offline Reinforcement Learning (REINFORCE). The reward function is composite: it rewards task success and provides a "bonus" for saving budget, but imposes a heavy penalty for exceeding the budget.
-
Agent Instantiation: The selected LLMs are assigned to roles within the chosen topology (e.g., the strongest model in the pool is assigned the "Critic" or "Planner" role).
Datasets
The authors evaluated BAMAS on three widely recognized benchmarks:
- GSM8K: Grade school math word problems (1,319 test problems).
- MBPP: Python programming tasks (500 test problems).
- MATH: A challenging dataset of advanced mathematical reasoning across various difficulty levels.
Key Insights and Ideas
- Joint Optimization is Key: The paper demonstrates that you cannot optimize cost by just picking cheaper models or just simplifying the workflow. You must do both simultaneously.
- Task-Specific Structures: The RL agent learned distinct strategies for different domains. For math (GSM8K/MATH), it overwhelmingly preferred the Feedback topology to catch errors. For coding (MBPP), it favored the Linear topology, mirroring a progressive refinement process.
- The "Planner" Trap: Interestingly, the RL policy almost never selected the "Planner-Driven" topology. While flexible, planners are expensive and unstable; a single poor plan can derail the entire budget and task, making it a "suboptimal choice" for budget-constrained environments.
- Risk-Aversion under Pressure: When budgets are tight, BAMAS defaults to simpler structures (Linear/Star) to avoid the high overhead of "Critic" agents, only opting for complex iterative loops when the budget allows for the extra token spend.
Key Results
BAMAS consistently outperformed or matched state-of-the-art frameworks while spending significantly less:
- Massive Cost Savings: On the MBPP (coding) dataset, BAMAS achieved 82.6% accuracy—comparable to the state-of-the-art—while reducing costs by 86% compared to MetaGPT.
- Efficiency on Math: On GSM8K, it matched AutoGen’s accuracy (95.3%) but with a 62% cost reduction.
- Budget Adherence: Unlike "reactive" systems, BAMAS rarely exceeded its budget. In the GSM8K tests, it had zero out-of-budget runs across 1,319 tasks.
- Superiority over Greed: An ablation study showed that BAMAS's ILP-based selection significantly outperformed "naive" greedy strategies that simply add more agents as the budget increases.
Limitations and Future Work
- Fixed Topology Library: Currently, BAMAS selects from a predefined set of four topologies. Future work could involve generating entirely custom, task-specific interaction graphs.
- Leaderboard Dependency: The provisioning step relies on external rankings (like LMSys) as a performance proxy. If a model's leaderboard rank doesn't correlate well with a specific niche task, the ILP might select a sub-optimal pool.
- Offline RL Data: The topology selector requires a pre-collected dataset of "experiences" to train. Expanding this to more diverse or "in-the-wild" tasks remains a challenge.
Summary updated