arXiv:2610.31743cs.MAOct 2026

Manuscript Offprint

arXiv:2610.31743

Not Every Agent Needs the Strongest Model: Unified Prompt-Model Optimization for Heterogeneous LLM-based Multi-Agent Systems

Mingxiu Cai, Haoyang Xian, Xinyu Ma, Yutong Wang, Zhenxi Song, Jing Li, Xuebo Liu

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

Large language model (LLM)-based multi-agent systems (MAS) rely on role-specific prompts and execution models to solve complex tasks collaboratively. However, prompt optimization typically keeps model assignments fixed, leaving differences in role requirements and their associated inference costs outside the search. We present UNIMASO, a Unified framework for heterogeneous Multi-Agent System Optimization through the joint adaptation of prompts and model assignments. UniMASO evaluates candidate updates through local, downstream, and global feedback, using cost-aware Pareto search to retain useful quality-cost trade-offs. Topology-aware co-evolution then coordinates these updates according to agent roles and dependencies. Cross-level trajectory memory further supplies historical successes and failures to guide subsequent optimization. Experiments on five benchmarks and five execution topologies show that UniMASO achieves competitive task performance at substantially lower deployment cost than the strongest homogeneous configurations. Under centralized execution, it improves the average score from 69.79 to 70.40 while reducing token-weighted deployment cost by 85.2%85.2\% relative to DeepSeek-V4-Pro with MASPO. These results support joint prompt-model adaptation as an effective approach to efficient multi-agent collaboration. The code is available at https://github.com/Achilles008/UniMASO_main.

1 INTRODUCTION

LLM-based multi-agent systems (MAS) decompose complex tasks through role specialization and communication (Li et al., 2023; Wu et al., 2024; Chen et al., 2024b; Hong et al., 2024; Zhuge et al., 2024; Wang et al., 2025; Tian et al., 2025). Each agent's prompt shapes its behavior and the information passed downstream, while its execution model determines capabilities and inference cost. System quality depends on how both choices align across the communication topology (Table 1).

Automatic prompt optimization refines instructions from task feedback, and recent MAS methods coordinate role prompts (Yang et al., 2024; Fernando et al., 2024; Opsahl-Ong et al., 2024; Cheng et al., 2024; Zhou et al., 2026; Zhang et al., 2026a; Wang et al., 2026; Hong et al., 2026); they generally fix execution models. Conversely, model routing and heterogeneous agent design assign models by task or role (Chen et al., 2024a; Ong et al., 2025; Chen et al., 2025; Yue et al., 2025; Zhang et al., 2026b), but typically fix prompts, leaving behavior outside model search. Fixed model assignments create role-

capability misalignment: they can waste strong models on routine roles or bottleneck demanding roles with lightweight models, while prompt edits cannot supply missing capabilities.

Changes to either choice propagate through the agent graph, altering downstream context, end-to-end quality, and cost; independent search can favor locally attractive but system-level poor configurations. This coupling motivates joint prompt–model search across the full execution topology.

Table 1: Comparison of prompt and model optimization paradigms.

MethodPromptModel
MIPRO (Opsahl-Ong et al., 2024)✓✕
GPTSwarm (Zhuge et al., 2024)✓✕
MASS (Zhou et al., 2026)✓✕
MASPOB (Hong et al., 2026)✓✕
MASPO (Wang et al., 2026)✓✕
MasRouter (Yue et al., 2025)✕✓
Hetero-Designer (Zhang et al., 2026b)✕✓
UNIMASO (Ours)✓✓

*Corresponding author.

To address this gap, we introduce UniMASO, which jointly optimizes agent prompts and model assignments in heterogeneous MAS (Figure 1). It evaluates candidate updates through local, downstream, and global feedback, then applies cost-aware Pareto search to retain quality-cost trade-offs. Topology-aware co-evolution coordinates updates across dependent agents, while cross-level trajectory memory guides subsequent search. Across five benchmarks and five execution topologies, we assess quality-cost trade-offs, topology generalization, and the con-

Figure

Figure 1: Homogeneous vs. Heterogeneous MAS.

tributions of trajectory memory and search controls. Under centralized execution, UniMASO raises the average score from 69.79 to 70.40 while reducing token-weighted deployment cost by 85.2% relative to DeepSeek-V4-Pro with MASPO.

Our contributions are summarized as follows:

• We formulate heterogeneous MAS optimization over prompt–model configurations, making role–capability misalignment explicit.

• We develop cost- and topology-aware search that couples local multi-granularity evaluation with system-level co-evolution.

• We introduce cross-level trajectory memory that turns local feedback, global outcomes, and cost observations into experience for later rounds.

References (1)