Preprint
Large Language Models

Masrouter: Learning to route llms for multi-agent systems

January 1, 2025

0

Citations

0

Influential Citations

Venue

2025

Year

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 …

Analysis

Why This Paper Matters

Multi-agent systems (MAS) powered by LLMs have shown impressive capabilities but come with high computational costs, especially when every agent call uses a large, expensive model. Masrouter addresses this critical bottleneck by introducing a learned routing mechanism that selects the most cost-effective LLM for each query within a multi-agent workflow. This is significant because it directly tackles the economic feasibility of deploying such systems at scale, which is a major barrier for both research and industry adoption.

The paper's approach is timely as the AI community increasingly focuses on efficiency and sustainability. Instead of treating all agent calls equally, Masrouter recognizes that different subtasks have varying complexity and can be handled by smaller, cheaper models without sacrificing overall performance. This insight aligns with a broader trend toward adaptive computation and resource-aware AI, making the paper relevant to practitioners building production systems.

Technical Contributions

  • Learned Router: A neural network that takes the query and agent context as input and outputs a probability distribution over available LLMs, trained via reinforcement learning.
  • Reward Design: Combines task success (e.g., correctness of final answer) with a cost penalty, allowing the router to trade off performance and expense.
  • Multi-Agent Integration: The router is designed to be plugged into existing multi-agent frameworks, routing each agent's call independently or jointly.
  • Benchmark Evaluation: Tested on diverse multi-agent tasks, showing consistent cost savings across different agent architectures.

Results

Masrouter achieves up to 50% reduction in inference cost while maintaining over 95% of the performance of a system that uses the strongest LLM for every call. The paper reports results across several benchmarks, demonstrating that the router learns to allocate smaller models to simpler subtasks and reserve large models for complex reasoning. Compared to heuristic baselines (e.g., always using the smallest model or random routing), Masrouter significantly outperforms in cost-performance trade-off.

Significance

This work has broad implications for the deployment of LLM-based multi-agent systems. By making routing a learned component, it opens the door to more sophisticated resource management in AI systems, potentially extending to other dimensions like latency or energy. It also encourages the development of more heterogeneous LLM ecosystems where models of varying sizes and capabilities coexist and are used optimally. For practitioners, Masrouter offers a practical solution to reduce operational costs, making large-scale agent systems more viable. Future research could explore dynamic router adaptation, multi-objective optimization, and integration with model caching or early-exit strategies.