MAS-PromptBench: When Does Prompt Optimization Improve Multi-Agent LLM Systems? Laixi Shi1 Johns Hopkins University [email protected]
arXiv:2606.23664v1 [cs.LG] 22 Jun 2026
Juyang Bai1 Johns Hopkins University [email protected]
June 23, 2026
Abstract Multi-agent systems (MAS) offer a scalable path forward for agentic AI, comprising multiple LLMbased agents, each assigned a system prompt and a position within a workflow that governs inter-agent coordination and output aggregation. System prompts thus form a critical and accessible optimization surface: they specify agents’ roles and behaviors, enabling system-level improvements without model finetuning. Although prompt optimization has shown substantial potential for single LLMs, extending it to MAS poses distinct challenges, notably an exponentially growing search space. It remains unclear whether, when, and by how much prompt optimization improves MAS performance, and how sensitive such gains are to system configuration. In this work, we systematically study system-prompt optimization across a broad range of MAS setups varying in task, workflow, communication protocol, and team size, benchmarking two prompt optimizers that naturally extend state-of-the-art single-agent methods. The results reveal its potential to unlock significant gains while exposing open challenges, characterizing when and how much prompt optimization helps across diverse MAS settings. Ñ Website: https://juyangbai.github.io/MAS-PromptBench/ § Code: https://github.com/juyangbai/MAS-PromptBench
1
Introduction
Agentic AI, as foundation-model-based systems that autonomously plan, use tools, and interact with the real world, is rapidly transforming daily life, industry, and scientific discovery Anthropic (2026); Lu et al. (2024); Plaat et al. (2025). As tasks evolve from human-scale problems to organization-scale challenges that are increasingly complex, open-ended, and time-sensitive, single-agent architectures face fundamental bottlenecks in expertise breadth, context length, and sequential execution Chen et al. (2024b). In contrast, multi-agent systems (MAS) have emerged as a highly promising paradigm for next-generation agentic AI and general superintelligence (ASI) Anthropic (2026); Genewein et al. (2026), offering scalability, timeliness, and reliability through specialization and multimodality, task decomposition and parallelism, and independent cross-checks that strengthen reasoning and factual accuracy Du et al. (2023). Concretely, a MAS typically comprises multiple LLM-based agents coordinated by a harness that manages communication, task delegation, and output aggregation, with each agent assigned an instruction set and a position in a coordination workflow Anthropic (2026). Throughout this paper, we refer to an LLM’s instruction set as its system prompt, which may be a assembled collection comprising not only the system prompt itself but also other levels of instructions. Within this MAS design space, system prompts provide a critical and accessible optimization surface: they specify each agent’s role and behavior Anthropic (nd); Google (nd); Meta (nd); OpenAI (2025), enabling system-level improvement without model fine-tuning. System prompts are among the most accessible levers available to practitioners, who often inherit a fixed configuration and seek improvements without redesigning the underlying architecture; many real-world deployments further preclude topology changes due 1 Department of Electrical and Computer Engineering, Johns Hopkins University, Baltimore, MD 21218, USA.
1
Single Agent
Prompt optimization gain (Percentage points)
20
Single
+14
+13
+14
10 +4
0
+4
+2
0 0
+3
+4
+4 0
-1
10
20 mond HotpotQA A-Dia
GPQ
Multi-Agent Systems Independent Centralized
-9 -16
MATH
APPS
BFCL
A nd iamo HotpotQ D A GPQ
MATH
APPS
BFCL
Figure 1: Prompt-optimization gains using a state-of-the-art optimizer GEPA in single-agent and multi-agent settings. While GEPA consistently improves single-agent performance across all five diverse tasks, its natural multi-agent extension yields highly variable effects across tasks and workflow topologies, ranging from large gains to severe performance drops. to safety, compliance, or auditability constraints Hong et al. (2026). Given the important role of system prompts, automatic prompt optimization has been studied extensively in the single-agent regime, with strong demonstrated benefits Agrawal et al. (2025); Khattab et al. (2023); Wang et al. (2024); Yang et al. (2024); Zhou et al. (2022). Whether such gains transfer to the multi-agent setting remains underexplored. Extending prompt optimization to MAS introduces qualitatively new challenges: inter-agent prompt dependencies, compounded by coordination dynamics across multi-turn interactions, induce a combinatorial search space that grows exponentially with the number of agents. As illustrated in Figure 1, the current effect of prompt optimization on MAS varies dramatically across tasks and topologies—ranging from substantial gains to equally severe performance drops. Meanwhile, most influential MAS frameworks—including AutoGen, CrewAI, CAMEL, MetaGPT, ChatDev, and AgentVerse Chen et al. (2024c); CrewAI Inc. (2026); Hong et al. (2024); Li et al. (2023a); Qian et al. (2024); Wu et al. (2024), as well as collaboration workflows such as debate Du et al. (2023); Liang et al. (2024)—still rely on manually crafted system prompts. Recent works have begun to address this gap, either by developing dedicated MAS prompt optimization algorithms Hong et al. (2026); Shen et al. (2025a); Xia et al. (2026); Zhang et al. (2026) or by jointly optimizing prompts alongside orchestration components such as workflow topology Hu et al. (2025); Zhao et al. (2025); Zhou et al. (2025). Yet these works evaluate on different tasks (e.g., math, coding, stock trading), configurations, and baselines, making cross-comparison difficult and leaving a fundamental question open: How much can prompt optimization help in MAS, and how does its effect vary across configurations? We address this through a benchmark-driven study that quantifies the gains from system-prompt optimization across a diverse set of fixed MAS configurations, pinpointing the regimes where prompt optimization offers substantial untapped improvement room and regimes where MAS sensitivity calls for more principled algorithm design. These findings provide a roadmap for designing future prompt optimization algorithms and, more broadly, for MAS design, where prompts are tightly coupled with other configuration choices. Our main contributions are as follows: • MAS-PromptBench: a benchmark for MAS prompt optimization. We introduce a comprehensive benchmark for evaluating system-prompt optimizers for MAS. It spans diverse MAS configurations across task domains (reasoning, coding, and tool calling), five workflow topologies (comprising both existing and newly constructed systems), communication protocols ranging from free-form to highly structured coordination, varying team sizes, and two default prompt optimizers. The benchmark 2
provides a foundation for proposing, analyzing, and comparing system-prompt optimization algorithms under controlled MAS configurations. • Prompt optimization gains and failures for MAS. Using this benchmark, we systematically evaluate the performance gains achieved by a natural multi-agent extension of GEPA Agrawal et al. (2025), a state-of-the-art single-agent prompt optimizer, relative to default system prompts. The results highlight the promise of prompt optimization for MAS: improvements reach up to 24.0 percentage points. Yet they also reveal the need for principled algorithms tailored to multi-agent settings, as performance can drop by as much as 16.0 percentage points for certain configurations. • Insights into when prompt optimization works for MAS. Prompt optimization shows greater potential when tasks have explicit, controllable, and verifiable agent-local behaviors, and when communication protocols impose an explicit shared structure that makes agent interactions easier to control and transfer; it also needs to be workflow-topology-aware. In addition, prompt optimization becomes harder as team size grows, confirming the challenges of scaling MAS prompt optimization and motivating principled and more scalable, robust algorithms.
2
Related Work
Prompt Optimization for Single LLM. Prompt optimization improves LLM performance without updating model weights; see Chang et al. (2024); Ramnath et al. (2025) for detailed reviews. Prompts are typically categorized into system (hard) prompts as discrete text instructions and soft prompts as continuous embeddings Chang et al. (2024). While both have shown effectiveness in single-agent settings, we focus on system prompts—the discrete instructions that specify each agent’s role—due to their interpretability and direct role in specifying agent behavior in MAS. Most system prompt optimization methods can be viewed as searching over a discrete instruction space Chang et al. (2024). Existing approaches fall into three categories: (1) sampling-based methods that generate and select candidate prompts using task feedback, including self-generated methods Wang et al. (2023), LLM-as-optimizer approaches such as APE Zhou et al. (2022) and OPRO Yang et al. (2024), planningbased methods such as PromptAgent Wang et al. (2024), and evolutionary methods such as EvoPrompt Guo et al. (2024) and PromptBreeder Fernando et al. (2023); (2) feedback-based methods that leverage directional signals such as reinforcement-learning rewards Deng et al. (2022), textual gradients Pryzant et al. (2023); Yuksekgonul et al. (2024), or self-reflection Madaan et al. (2023); Shinn et al. (2023); and (3) editing-based methods that refine prompts through local operations such as insertion, deletion, or paraphrasing Prasad et al. (2023). These techniques are also integrated into broader frameworks such as DSPy Khattab et al. (2023), which optimizes instructions within multi-stage LLM programs via algorithms such as MIPROv2 Opsahl-Ong et al. (2024). In this work, instead of single-agent, we focus on prompt optimization for multi-agent LLM systems, where it remains unclear whether single-agent gains transfer. To investigate, we evaluate when and how much prompt optimization improves MAS performance across a broad range of setups varying in task, workflow, communication protocol, team size, and different prompt optimizers. Prompt Optimization in Multi-Agent LLM Systems. Many influential MAS still rely on manually designed system prompts, specifying roles in CAMEL, MetaGPT and ChatDev Hong et al. (2024); Li et al. (2023a); Qian et al. (2024); specifying conversations and coordination patterns in AutoGen, CrewAI, and AgentVerseChen et al. (2024c); CrewAI Inc. (2026); Wu et al. (2024); instantiating collaboration patterns, such as debate Du et al. (2023); Liang et al. (2024), mixture-style aggregation Wang et al. (2025), or consensus among diverse LLMs Chen et al. (2024a). Recently, automatic prompt optimization for MAS has attracted growing attention and shown substantial progress. Many existing methods generate new prompts from diverse feedback sources, including failure attributes and identified underperforming agents Li et al. (2026); Shen et al. (2025a), as well as multi-resolution signals spanning the agent itself, its neighborhood, and global contexts Wang et al. (2026); while other work searches over a fixed, pre-generated set of candidate prompts rather than generating new ones Hong et al. (2026). Beyond these directions, researchers have also studied MAS prompt optimization for domain-specific problems Xia et al. (2026) and incorporated richer MAS-configuration information into the optimization process Zhang et al. (2026). Recognizing that system 3
Multi-Agent System
Task Distribution Reasoning Coding
Agent
Task
Agent
Solution
Tool Calling Communication Protocol
Agent
Freeform Semi-structured Agent
Structured
Agent
Workflow Topology Single Sequential Independent Centralized Decentralized Team Size 2
4
8
10
Figure 2: Overview of benchmark MAS-PromptBench. Given an input task, a multi-agent system produces a final solution through interactions among LLM-based agents. MAS-PromptBench measures promptoptimization gains across four axes: task distribution, workflow topology, communication protocol, and team size. prompts are tightly coupled with other design choices, another line of work jointly optimizes prompts with orchestration components such as communication topology and hierarchical planning Zhao et al. (2025); Zhou et al. (2025). In this work, we ask a more foundational question: within a given MAS configuration, how much headroom does system prompt optimization actually offer, and how does this headroom vary across configurations? We address this through a benchmark-driven study that quantifies how much system-prompt optimization helps across a diverse set of fixed MAS configurations. Specifically, we evaluate the gains—relative to default prompts—of a natural multi-agent extension of GEPA Agrawal et al. (2025), a state-of-the-art single-agent prompt optimization method. We view these findings as an empirical roadmap that can guide the design of future prompt optimization algorithms—and, more broadly, the design of MAS itself. Benchmarks for multi-agent LLM systems or prompt optimization. Existing work on evaluating and analyzing LLM-based multi-agent systems (MAS) spans three complementary perspectives: task benchmarks, diagnostic tools, and studies of MAS design choices. First, general task benchmarks provide broad testbeds for agents’ different abilities within a MAS. Examples include MultiAgentBench Zhu et al. (2025) for coordination quality, BFCL Patil et al. (2025) for function calling, AppWorld Trivedi et al. (2024) for interactive app operation, GAIA Mialon et al. (2024) for general assistant tasks, TravelPlanner Xie et al. (2024) for multiconstraint planning, and SWE-bench Jimenez et al. (2024) for software repair. Second, diagnostic and debugging work addresses the interpretability gap by examining why MAS executions succeed or fail. MAST proposes a taxonomy of failure modes with an annotated trace dataset Cemri et al. (2026); AutoGen Studio and AGDebugger enable interactive inspection and steering of multi-agent conversations Dibia et al. (2024); Epperson et al. (2025); and failure-attribution work identifies which agent and step caused a task failure Zhang et al. (2025). Third, a line of work studies how different MAS configuration choices influence overall performance, including workflow topology Kim et al. (2025); Shen et al. (2025b), agent diversity Yang et al. (2026), and team size Kim et al. (2025); Qian et al. (2025). We follow this third line, but focus on a critical yet underexplored component—the system prompt—studying how much optimizing it can improve MAS performance under a fixed surrounding configuration. Furthermore, although extensive benchmarks exist for evaluating prompt optimization in single-agent setting Zhu et al. (2024), no comparable benchmark is available for MAS yet. To fill this gap, we introduce a systematic benchmark MAS-PromptBench that measures the gains from MAS prompt optimization across a diverse set of configurations, encompassing different tasks, workflow topologies, team sizes, and communication protocols.
4
3
Prompt Optimization for Multi-Agent LLM Systems
Prompt optimization for multi-agent systems (MAS). We consider an LLM-based multi-agent system (MAS) Agrawal et al. (2025); Khattab et al. (2023); Opsahl-Ong et al. (2024), illustrated in Figure 2, represented as the tuple M = (A, G, P ), (1) where A = {A1 , . . . , An } is an ordered collection of n agents, G denotes the inter-agent coordination workflow, and P denotes the communication protocol between agents. Each agent Ai = (θi , πi ) consists of an LLM with model parameters θi and a learnable system prompt πi . We denote π = {π1 , . . . , πn } as the joint system prompts for all agents. Each task to be solved is drawn as (x, e) ∼ T from a distribution T , where x ∈ X is the task input and e is a reference used for evaluation, such as a ground-truth answer or code unit tests. We let M( · ; π) denote the output function of the MAS M induced by the joint prompt π, with the model parameters θ held fixed. System-prompt optimization for a MAS is then formulated as the following optimization problem: max E(x,e)∼T [µ(M(x; π), e)] s.t. ℓrollouts ≤ B, (2) π
where the metric µ : Y × E → [0, 1] evaluates the output y = M(x; π) against the reference e, and ℓrollouts denotes the number of MAS execution rounds, each comprising one MAS run to solve a task followed by an evaluation of its output. Remark 1 (System prompt as an umbrella term for the instruction set). Within a multi-agent system (MAS), each agent is typically prompted with a carefully assembled input package determined by the harness, which may include the user’s request, a layered set of instructions, task-specific skills, relevant memory, retrieved context, and available tools. We focus on the instruction set, which typically comprises four components that differ in authority, scope, and purpose, forming a hierarchy that guides behavior from global constraints to task-specific procedures. At the top, system prompts define universal rules, such as safety and tool-use protocols; developer or product instructions then specify application-level operation, including the agent’s role and workflow; project instructions specify task-level conventions, such as coding standards and testing procedures; and finally, skills provide reusable guidance for particular task classes, such as data analysis or code modification. Throughout this paper, we use system prompt as an umbrella term for the instruction set excluding skills, without distinguishing among them. In practice, agentic systems may employ multiple instruction layers; our formulation extends naturally to optimizing an individual component or combination thereof, which we leave to future work. Metric: prompt optimization gains in MAS. In this work, we will conduct systematic study of whether, when, and to what extent system-prompt optimization improves MAS performance across different MAS configurations. To this end, we investigate diverse MAS configurations determined by four critical components (T , G, n, P ): the task distribution T , the coordination workflow or topology G, the team size n, and the communication protocol P . Any prompt optimizer can, in principle, be used to optimize prompts by solving (2). In this work, we primarily focus on two natural multi-agent extension of state-of-the-art single-agent prompt optimization methods: GEPA Agrawal et al. (2025) and MIPRO Opsahl-Ong et al. (2024) Let π 0 denote the initialized (unoptimized) system prompt and π ⋆ the optimized prompt obtained by solving (2). Fixing an optimizer for solving (2) and the base model, the prompt-optimization gain for the MAS with a configuration (T , G, n, P ) is then defined as ∆(T , G, n, P ) := E(x,m)∼T µ(M(x; π ⋆ ), y) − µ M(x; π 0 ), y . (3)
4
MAS-PromptBench: Prompt Optimization for MAS Benchmark
While benchmarks and evaluation protocols exist for single-agent prompt optimization, comparable resources for multi-agent systems remain underdeveloped. We fill this gap by introducing a benchmark designed to support extensive and controlled investigation for prompt optimization across diverse MAS configurations, summarized in Table 1 and Figure 2.
5
Table 1: Overview of the modular configuration of MAS-PromptBench. Factor
#
Details
Framework
4
LangGraph LangChain Inc. (2026), CrewAI CrewAI Inc. (2026), AutoGen Wu et al. (2024), OpenAI Agents SDK OpenAI (2026)
Task
9
Reasoning (3): GPQA-Diamond Rein et al. (2023), HotpotQA Yang et al. (2018), MATH Hendrycks et al. (2021b); Coding (3): LiveCodeBench Jain et al. (2025), APPS Hendrycks et al. (2021a), SWE-Bench Verified Jimenez et al. (2024); Tool-calling (3): BFCL Patil et al. (2025), ToolHop Ye et al. (2025), API-Bank Li et al. (2023b)
Topology
5
Single, Independent, Sequential, Centralized, Decentralized
Communication
3
Freeform, Semi-structured, Structured
Team size
4
n ∈ {2, 4, 8, 10}
Optimizer
2
MAS-GEPA Agrawal et al. (2025), MAS-MIPRO Opsahl-Ong et al. (2024)
The proposed benchmark evaluates the prompt-optimization gain using the metric in (3), which compares the optimized prompts π ⋆ against the initialized prompts π0 for a fixed prompt optimizer and MAS configuration (T , G, n, P ). This controlled protocol makes the benchmark useful in at least two ways. First, given any system-prompt optimizer, it provides an extensive testbed across diverse MAS configurations, enabling direct evaluation of how optimization gains vary with task, topology, communication structure, and team size. Second, its modular design supports controlled, component-level studies: one can vary a single MAS factor—such as the optimizer, topology, protocol, or team size—while holding all others fixed to isolate its effect on system-level performance. The benchmark is also flexible and extensible across all of these components, as new tasks or MAS configurations can be introduced as additional configuration values, allowing it to be tailored to different application domains and user requirements. We primarily provide two optimizers—multi-agent extensions of state-of-the-art single-agent prompt optimization methods, GEPA Agrawal et al. (2025) and MIPRO Opsahl-Ong et al. (2024)—which we call MAS-GEPA and MASMIPRO. This benchmark evaluates each task dataset using its official evaluation protocol; detailed metric definitions and implementations are provided in Appendix A.2.
5
Empirical Study of Prompt Optimization in MAS
Armed with the MAS-PromptBench benchmark, in this section we conduct a systematic study to answer: How much can prompt optimization help in MAS, and how does its effect vary across configurations? We subsequently investigate the four critical MAS configuration factors: task (Sec. 5.1), workflow topology (Sec. 5.2), communication protocol (Sec. 5.3), and team size (Sec. 5.4). We mainly use the natural multi-agent extension of GEPA (named MAS-GEPA) as the prompt optimizer for Sec. 5.1-Sec. 5.4, with an ablation study of another prompt optimizer adapted from MIPRO (named MAS-MIPRO) in Sec. 5.5. Both MAS-GEPA and MAS-MIPRO optimize each agent’s system prompt separately and sequentially, using feedback from the overall MAS execution evaluation and the agent’s own experience traces. Details are provided in Appendix A.4.
5.1
Task
We first study how prompt-optimization gains vary across task domains that spans nine tasks across three domains: reasoning, coding, and tool-calling. In this subsection on tasks, we evaluate a range of popular existing MAS frameworks with naturally differing topologies, shown in Table 2; in all remaining studies on MAS configurations, we instead use the LangGraph framework to construct the different configurations, for flexibility and fairness. Table 2 shows that system-prompt optimization is broadly promising across diverse tasks: averaged over topologies, it improves performance on seven out of nine tasks, with the largest average gain of +10.0% points on APPS. Individual MAS configurations show even larger gains: Sequential in BFCL improves by +24.0 points, and Sequential in APPS improves by +18.0 points.
6
Table 2: Prompt-optimization gains of MAS-GEPA for nine diverse tasks on popular existing MAS frameworks. Each cell reports baseline / optimized performance, followed by the signed change ∆ in percentage points. Blue indicates improvement, orange indicates regression, and gray indicates no change.
Reasoning
Coding
Single (LangGraph)
Independent (LangGraph)
Sequential (CrewAI)
Centralized (AutoGen)
Decentralized (OpenAI SDK)
Average
60.0 / 60.0 0.0
62.8 / 64.2 +1.4
GPQA-Diamond Acc.
54.0 / 58.0 +4.0
73.0 / 73.0 0.0
53.0 / 56.0 +3.0
74.0 / 74.0 0.0
HotpotQA EM
26.0 / 39.0 +13.0 27.0 / 26.0 −1.0
27.0 / 27.0 0.0
20.0 / 22.0 +2.0 16.0 / 18.0 +2.0 23.2 / 26.4 +3.2
MATH Acc.
49.0 / 51.0 +2.0 76.0 / 60.0 −16.0 58.0 / 62.0 +4.0
63.0 / 69.0 +6.0
66.0 / 66.0 0.0
62.4 / 61.6 −0.8
LiveCodeBench pass@1
12.0 / 12.0 0.0
14.0 / 16.0 +2.0
8.0 / 12.0 +4.0
12.0 / 15.2 +3.2
APPS pass@1
52.0 / 66.0 +14.0 74.0 / 78.0 +4.0 62.0 / 80.0 +18.0 62.0 / 76.0 +14.0
74.0 / 74.0 0.0
64.8 / 74.8 +10.0
SWE-Bench Verified
33.3 / 30.0 −3.3
14.0 / 18.0 +4.0
12.0 / 18.0 +6.0
36.7 / 33.3 −3.4
33.3 / 30.0 −3.3
16.7 / 20.0 +3.3 40.0 / 36.7 −3.3 32.0 / 30.0 −2.0
BFCL Acc. Tool-Calling ToolHop Acc.
84.0 / 88.0 +4.0
88.0 / 88.0 0.0
60.0 / 84.0 +24.0
96.0 / 96.0 0.0
62.0 / 64.0 +2.0
62.0 / 68.0 +6.0
66.0 / 73.0 +7.0
68.0 / 69.0 +1.0 67.0 / 71.0 +4.0 65.0 / 69.0 +4.0
84.0 / 88.0 +4.0 82.4 / 88.8 +6.4
API-Bank Acc.
77.0 / 79.0 +2.0
74.0 / 76.0 +2.0
60.0 / 66.0 +6.0
77.0 / 72.0 −5.0 62.0 / 69.0 +7.0 70.0 / 72.4 +2.4
The gains are larger and more consistent for coding and tool-calling tasks than for reasoning tasks. At the task level, the maximum average gains for coding and tool-calling are +10.0 points on APPS and +6.4 points on BFCL, respectively, whereas the largest average gain among reasoning tasks is only +3.2 points on HotpotQA. At the topology-configuration level, coding and tool-calling tasks achieve maximum gains of +18.0 points on Sequential APPS and +24.0 points on Sequential BFCL, whereas reasoning tasks reach only +8.0 points on Sequential MATH. The same trend holds at the domain level in average: coding benchmarks improve by +3.7 points on average and tool-calling benchmarks by +4.3 points, compared with only +1.3 points for reasoning benchmarks. We hypothesize that the difference arises from the extent to which each task can be decomposed into an explicit routine with controllable local behaviors. Coding tasks expose verifiable artifacts—small program steps can be checked by compilation and tests, while tool-calling tasks offer structured and clear interfaces through explicit function names and outcome formats that system prompts can directly shape. Such behaviors propagate through the MAS workflow with little ambiguity, allowing local prompt improvements to survive downstream coordination. Reasoning tasks, in contrast, rely on correlated logical steps with implicit intermediate feedback, so local improvements or errors are often discarded, overwritten, or amplified before reaching the final answer. Prompt optimization is thus most effective when tasks provide structured interfaces through which agent-level changes can be clearly controlled, preserved, and transferred across agents. Takeaway. Prompt optimization shows greater potential on tasks with explicit, controllable, and verifiable agent-local behaviors, such as coding and tool-calling, than on reasoning tasks.
5.2
Workflow Topology
A workflow topology refers to the inter-agent coordination graph G, which determines how agent outputs (messages) are routed, combined, and exposed to other agents en route to the final outcome. We again use the natural multi-agent extension of GEPA as the prompt optimizer. To study the room for improvement and the level of difficulty across diverse MAS topologies, we evaluate prompt-optimization gains under the following four multi-agent topologies along with a single-agent baseline, as illustrated in Figure 3. • Single: A single LLM serves as the baseline. • Independent: n agents solve the task in parallel without inter-agent communication, and their outputs are aggregated by majority vote. • Sequential: Agents form a directed chain A1 → A2 → · · · → An with no backward edges; each agent receives the previous agent’s output as input toward the final answer.
7
Single
Sequential
LLM Agent
Independent
Expertise
Task
Centralized
Solution
Decentralized
Communication
Figure 3: The five coordination structures evaluated by our protocol. Single is the single-agent baseline. Independent uses n parallel agents whose outputs are aggregated without inter-agent messaging. Sequential forms a directed chain A1 → A2 → · · · → An with no backward edges. Centralized uses a coordinator to route subtasks to workers that do not communicate with one another. Decentralized allows all agents to exchange messages over a fully connected graph for a fixed number of rounds. Arrows indicate message flow; nodes indicate agents. Table 3: Prompt-optimization gains of MAS-GEPA for five workflow topologies. Each cell reports baseline / optimized performance, followed by the signed change ∆ in percentage points. Blue indicates improvement, orange indicates regression, and gray indicates no change. Single
Independent
Sequential
Centralized
Decentralized
GPQA (Acc.)
54.0 / 58.0 +4.0
73.0 / 73.0 0.0
75.0 / 78.0 +3.0
70.0 / 70.0 0.0
71.0 / 71.0 0.0
HotpotQA (EM)
26.0 / 39.0 +13.0
27.0 / 26.0 −1.0
29.0 / 28.0 −1.0
19.0 / 10.0 −9.0
20.0 / 32.0 +12.0
MATH (Acc.)
49.0 / 51.0 +2.0
76.0 / 60.0 −16.0
74.0 / 74.0 0.0
66.0 / 69.0 +3.0
81.0 / 81.0 0.0
LiveCodeBench (pass@1)
12.0 / 12.0 0.0
14.0 / 18.0 +4.0
16.0 / 16.0 0.0
16.0 / 16.0 0.0
18.0 / 18.0 0.0
APPS (pass@1)
52.0 / 66.0 +14.0
74.0 / 78.0 +4.0
82.0 / 84.0 +2.0 70.0 / 84.0 +14.0
86.0 / 86.0 0.0
SWE-Bench Verified (Resolved)
33.3 / 30.0 −3.3
36.7 / 33.3 −3.4
33.3 / 26.7 −6.6
30.0 / 33.3 +3.3
36.7 / 36.7 0.0
BFCL (Acc.)
84.0 / 88.0 +4.0
88.0 / 88.0 0.0
84.0 / 80.0 −4.0
92.0 / 96.0 +4.0
88.0 / 88.0 0.0
ToolHop (Acc.)
62.0 / 64.0 +2.0
62.0 / 68.0 +6.0
71.0 / 73.0 +2.0
66.0 / 70.0 +4.0
65.0 / 71.0 +6.0
API-Bank (Acc.)
77.0 / 79.0 +2.0
74.0 / 76.0 +2.0
61.0 / 70.0 +9.0
77.0 / 72.0 −5.0
65.0 / 68.0 +3.0
Average
49.9 / 54.1 +4.2
58.3 / 57.8 −0.5
58.4 / 58.9 +0.5
56.2 / 57.8 +1.6
59.0 / 61.3 +2.3
• Centralized: A coordinator dispatches subtasks to sub-agents A1 , . . . , An , collects their outputs, and aggregates them into the final answer; sub-agents do not communicate with one another throughout the process. • Decentralized: All n agents communicate over a fully connected graph and exchange messages once, after which their final-round outputs are aggregated by majority vote for question-answering tasks or best-of-N test-pass for coding tasks. As shown in Table 3, the average prompt-optimization gains across the four MAS topologies (with a maximum of +2.3 points) are all smaller than that of the single-agent baseline at +4.2 points, indicating that MAS poses substantially greater challenges for prompt optimization. Moreover, for a fixed optimizer, gains vary considerably across topologies: on API-Bank, optimization improves the Sequential topology by +9.0 points but degrades the Centralized topology by −5.0; on SWE-Bench Verified, it degrades the Independent topology by −3.3 points yet improves the Centralized topology by +3.3. This disparity motivates topology-aware, tailored prompt optimization approaches rather than a one-size-fits-all method. In particular, 8
15
Prompt optimization gain (Percentage points)
10 5 0
+8
+7 +2
+4 0 0
+1
0
0 -4
+6
+4
+1
-2
Freeform
0
-2
Independent Sequential HotpotQA
10 15
+6 0
-2
5
+6
+4
+10
+9
+8
Semi-structured
Centralized Decentralized LiveCodeBench
Structured
Figure 4: Prompt-optimization gains of MAS-GEPA across diverse communication protocols: Freeform, Semi-structured, and Structured, on HotpotQA and LiveCodeBench. More structured protocols give MAS prompt optimization more room to improve. optimization on the Independent topology can even hurt performance—dropping by −16.0 points on MATH and by −0.5 points on average—suggesting that uncoordinated prompt revisions across parallel agents may erase one another’s gains. The Centralized topology, in contrast, tends to amplify both successes and failures relative to other topologies, improving APPS by +14.0 points while hurting HotpotQA by −9.0. Takeaway. Multi-agent systems need topology-aware prompt optimizers.
5.3
Communication Protocol
A communication protocol specifies the format of inter-agent messages. Since downstream agents observe only the information explicitly written by upstream agents, an underspecified or overly redundant protocol may obscure salient information or direct attention to irrelevant details. To study how communication structure affects prompt optimization, we consider three protocols with increasing levels of structure;concrete examples of each protocol are provided in Appendix A.3: • Freeform: Agents exchange unrestricted natural-language messages with no required fields or templates. This protocol gives agents maximum flexibility, but downstream agents must infer which information is most relevant. • Semi-structured: Agents communicate through a small set of prescribed slots that summarize the sender’s status, evidence, confidence, and intended next step. Each slot is still filled in natural language, making the message easier to scan while preserving flexibility for task-specific details. • Structured: Agents communicate using a JSON-style format with a fixed set of predefined slots for critical information, such as status, summary, confidence level, supporting evidence, and next action. Unlike the semi-structured protocol, each slot’s value follows a more constrained format drawn from a predefined, finite set of options. This makes message organization more consistent and reduces ambiguity across agents, but also limits how freely agents can express task-specific details. The overall results are reported in Table 5, and Figure 4 shows that more structured communication protocols yield consistently larger prompt-optimization gains. The average gain increases from +1.6 points 9
under Freeform messages to +2.4 under Semi-structured messages and +4.3 under Structured messages. The gains are largest on HotpotQA, a multi-hop question-answering task where answering often requires combining evidence from multiple Wikipedia passages. Here, agents must collect, preserve, and pass intermediate evidence across reasoning steps, making efficient communication essential for downstream agents to interpret and use upstream outputs. In contrast, gains are smaller and less consistent on LiveCodeBench, where code correctness is ultimately determined by executable code and test outcomes, making performance less sensitive to message format once the code artifact is produced. Overall, prompt optimization is most effective when communication protocols provide a shared structure that makes agent state, evidence, confidence, and requests explicit, allowing local prompt improvements to propagate more reliably through the MAS workflow. Takeaway. Communication protocols with explicit shared structure makes agent interactions easier to control and transfer, giving MAS prompt optimization more room to improve.
5.4
Team Size
In this section, we study whether prompt-optimization gains increase with team size due to improved scalability, or decrease as coordination overhead grows. We vary the number of agents n ∈ {2, 4, 8, 10}. Figure 5 and Table 4 show that as team size increases, prompt-optimization gains generally decrease, indicating more challenging for prompt optimization to translate into system-level gains, as agent-local improvements may be diluted or lost through increased coordination complexity. Average gains fall from +2.4 points at n=2 to +0.6 at n=4, and become negative at n=8 (−0.9) and n=10 (−2.1). This pattern suggests that adding more agents does not necessarily create more opportunities for prompt optimization, at least for current optimizers. While larger teams may enable scalable ability, finer-grained specialization, they also introduce more handoffs and intermediate states, making local improvements harder to preserve throughout the workflow. This effect is especially clear in Centralized HotpotQA, where gains fall from +5.0 at two agents to −9.0 at four and eight agents, and −12.0 at ten agents. In contrast, Decentralized HotpotQA remains nonnegative across all team sizes (+6.0, +12.0, 0.0, and +3.0), indicating that the effect of team size also heavily depends on workflow toplogy. Table 4: Prompt-optimization gains of MAS-GEPA across diverse team sizes on HotpotQA and LiveCodeBench. Each cell shows baseline / optimized values, followed by the signed change ∆ in percentage points. Blue indicates improvement, orange indicates regression, and gray indicates no change. n=2
n=4
n=8
n=10
Independent
HotpotQA (Acc.) LiveCodeBench (Acc.)
32.0 / 32.0 0.0 16.0 / 16.0 0.0
27.0 / 26.0 −1.0 14.0 / 18.0 +4.0
26.0 / 27.0 +1.0 16.0 / 14.0 −2.0
25.0 / 27.0 +2.0 18.0 / 12.0 −6.0
Sequential
HotpotQA (Acc.) LiveCodeBench (Acc.)
19.0 / 25.0 +6.0 16.0 / 16.0 0.0
29.0 / 28.0 −1.0 16.0 / 16.0 0.0
24.0 / 27.0 +3.0 18.0 / 16.0 −2.0
31.0 / 25.0 −6.0 16.0 / 16.0 0.0
Centralized
HotpotQA (Acc.) LiveCodeBench (Acc.)
18.0 / 23.0 +5.0 12.0 / 14.0 +2.0
19.0 / 10.0 −9.0 16.0 / 16.0 0.0
21.0 / 12.0 −9.0 17.0 / 5.0 −12.0 16.0 / 16.0 0.0 16.0 / 18.0 +2.0
Decentralized
HotpotQA (Acc.) LiveCodeBench (Acc.)
28.0 / 34.0 +6.0 16.0 / 16.0 0.0
20.0 / 32.0 +12.0 18.0 / 18.0 0.0
30.0 / 30.0 0.0 14.0 / 16.0 +2.0
19.6 / 22.0 +2.4
19.9 / 20.5 +0.6
20.6 / 19.8 −0.9 21.0 / 18.9 −2.1
Average
29.0 / 32.0 +3.0 16.0 / 16.0 0.0
Takeaway. Larger team size increases the challenge of prompt optimization for MAS, local agent improvements may fail to produce system-level gains.
10
HotpotQA
15
LiveCodeBench
+12
Prompt optimization gain (Percentage points)
10 +6 +5 +6
5
+1
0
0
+3 0
-1 -1
+3
+2
+2
0 0
+4 0
0 0 0
0
+2
+2
0
-2 -2
5
-6 -9
10
0 -6
-9 -12
15
2
4
Team size
8
Independent
10
2
4
Sequential Centralized Mean across topologies
Team size
8
10
Decentralized
Figure 5: Prompt-optimization gains of MAS-GEPA across different team sizes on HotpotQA and LiveCodeBench. As the number of agents increases, average gains generally decrease, suggesting that larger teams pose additional challenges for MAS prompt optimization.
25 +20
Prompt optimization gain (Percentage points)
20 +15
15 10 5 0 5 10 15
+12
+11
+8
+6
+4 0
0
+8
+5 +2
0
-2 -3
-4
-6
Freeform
+3 +4 +4
+2
Semi-structured
0
0
Independent Sequential HotpotQA
0
Centralized Decentralized LiveCodeBench
Structured
Figure 6: Prompt-optimization gains of MAS-MIPRO across diverse communication protocols: Freeform, Semi-structured, and Structured, on HotpotQA and LiveCodeBench. As with MAS-GEPA in Fig. 4, average gains generally decrease as the number of agents increases, suggesting that larger teams pose additional challenges for MAS prompt optimization.
5.5
Ablation of prompt optimizers
The previous subsections primarily focus on evaluating the optimization gains achieved by the MAS-GEPA optimizer. To assess whether these findings are specific to this representative optimizer or generalize to other prompt optimizer for MAS, we additionally evaluate another optimizer MAS-MIPRO. We conduct the same communication-protocol experiments as described in Sec. 5.3, with results presented in Table 5 and Figure 6. 11
Table 5: Prompt-optimization gains of two optimizers MAS-GEPA and MAS-MIPRO under different communication protocols. Each cell reports baseline / optimized performance, followed by the signed change ∆ in percentage points. Blue indicates improvement, orange indicates regression, and gray indicates no change. Topology
Independent Sequential Centralized Decentralized
MAS-GEPA
Benchmark
MAS-MIPRO
Freeform
Semi-structured
HotpotQA (Acc.)
28.0 / 36.0 +8
20.0 / 24.0 +4
LiveCodeBench (Acc.)
16.0 / 18.0 +2
16.0 / 16.0 0
HotpotQA (Acc.)
30.0 / 30.0 0
24.0 / 31.0 +7
25.0 / 34.0 +9
LiveCodeBench (Acc.)
16.0 / 16.0 0
18.0 / 14.0 −4
16.0 / 14.0 −2
HotpotQA (Acc.)
20.0 / 21.0 +1
14.0 / 20.0 +6
LiveCodeBench (Acc.)
14.0 / 18.0 +4
HotpotQA (Acc.) LiveCodeBench (Acc.)
Average
Structured
Freeform
Semi-structured
Structured
22.0 / 28.0 +6
28.0 / 34.0 +6
20.0 / 35.0 +15
22.0 / 25.0 +3
12.0 / 16.0 +4
16.0 / 14.0 −2
16.0 / 18.0 +2
12.0 / 16.0 +4
30.0 / 27.0 −3
24.0 / 29.0 +5
25.0 / 29.0 +4
16.0 / 16.0 0
18.0 / 14.0 −4
16.0 / 16.0 0
14.0 / 24.0 +10
20.0 / 14.0 −6
14.0 / 22.0 +8
14.0 / 25.0 +11
18.0 / 16.0 −2
10.0 / 16.0 +6
14.0 / 14.0 0
18.0 / 18.0 0
10.0 / 18.0 +8
29.0 / 27.0 −2
25.0 / 33.0 +8
28.0 / 29.0 +1
29.0 / 33.0 +4
25.0 / 37.0 +12
28.0 / 48.0 +20
16.0 / 16.0 0
14.0 / 14.0 0
16.0 / 16.0 0
16.0 / 18.0 +2
14.0 / 14.0 0
16.0 / 16.0 0
21.1 / 22.8 +1.6 18.6 / 21.0 +2.4 17.9 / 22.1 +4.3 21.1 / 21.3 +0.1 18.6 / 23.4 +4.8 17.9 / 24.1 +6.3
The results exhibit trends highly consistent with those observed under MAS-GEPA. More structured communication protocols consistently yield larger prompt-optimization gains, with improvements increasing from +0.1 points under Freeform messages to +4.8 points under Semi-structured messages and +6.3 points under Structured messages, respectively. As with MAS-GEPA, the largest gains are observed on HotpotQA, while improvements on LiveCodeBench are comparatively smaller. This ablation study suggests that our findings are not tied to a specific prompt optimizer. Instead, they likely reflect inherent challenges in prompt optimization for MAS and may provide useful guidance for the design of future optimization methods.
6
Conclusion
For multi-agent LLM systems (MAS), we focus on improving system prompts, a critical and accessible optimization surface that requires no model-parameter fine-tuning. To this end, we build MAS-PromptBench, an evaluation benchmark for prompt optimization in MAS that spans diverse tasks, workflow topologies, communication protocols, team sizes, and optimizers. Extensive experiments show that prompt optimization has substantial potential to improve MAS performance, yielding gains of up to 24.0 points. Yet it is also challenging: gains vary widely, and performance can drop by as much as 16.0 points, underscoring the need for principled algorithms tailored to MAS configurations. The results indicate that prompt optimization is most effective on tasks whose agent-level local behaviors are explicit, controllable, and verifiable, and when communication protocols have explicit shared structure. Larger teams often introduce coordination overhead that makes optimization more difficult. These findings suggest that future optimizers should be aware of both task structure and MAS configuration. We hope MAS-PromptBench provides a useful foundation for evaluating and developing more robust, scalable, and structure-aware prompt optimizers for multi-agent systems. One limitation of this study is that the evaluation covers two natural multi-agent prompt optimizers, MAS-GEPA and MAS-MIPRO; broader evaluation across more methods is needed to further refine these conclusions.
Acknowledgments L. Shi and J. Bai are supported in part by Mitsubishi Electric Research Laboratories (MERL).
References Agrawal, L. A., Tan, S., Soylu, D., Ziems, N., Khare, R., Opsahl-Ong, K., Singhvi, A., Shandilya, H., Ryan, M. J., Jiang, M., et al. (2025). Gepa: Reflective prompt evolution can outperform reinforcement learning. 12
arXiv preprint arXiv:2507.19457. Anthropic (2026). Claude code. GitHub repository. Accessed: 2026-06-17. Anthropic (n.d.). System prompts. https://platform.claude.com/docs/en/release-notes/system-prompts. Accessed: 2026-05-16. Cemri, M., Pan, M. Z., Yang, S., Agrawal, L. A., Chopra, B., Tiwari, R., Keutzer, K., Parameswaran, A., Klein, D., Ramchandran, K., et al. (2026). Why do multi-agent llm systems fail? Advances in Neural Information Processing Systems, 38. Chang, K., Xu, S., Wang, C., Luo, Y., Liu, X., Xiao, T., and Zhu, J. (2024). Efficient prompting methods for large language models: A survey. arXiv preprint arXiv:2404.01077. Chen, J., Saha, S., and Bansal, M. (2024a). Reconcile: Round-table conference improves reasoning via consensus among diverse llms. In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 7066–7085. Chen, S., Liu, Y., Han, W., Zhang, W., and Liu, T. (2024b). A survey on llm-based multi-agent system: Recent advances and new frontiers in application. arXiv preprint arXiv:2412.17481. Chen, W., Su, Y., Zuo, J., Yang, C., Yuan, C., Chan, C.-M., Yu, H., Lu, Y., Hung, Y.-H., Qian, C., et al. (2024c). Agentverse: Facilitating multi-agent collaboration and exploring emergent behaviors. In International Conference on Learning Representations, volume 2024, pages 20094–20136. CrewAI Inc. (2026). Crewai: Framework for orchestrating role-playing autonomous ai agents. https: //github.com/crewaiinc/crewai. Accessed: 2026-04-30. Deng, M., Wang, J., Hsieh, C.-P., Wang, Y., Guo, H., Shu, T., Song, M., Xing, E., and Hu, Z. (2022). Rlprompt: Optimizing discrete text prompts with reinforcement learning. In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, pages 3369–3391. Dibia, V., Chen, J., Bansal, G., Syed, S., Fourney, A., Zhu, E., Wang, C., and Amershi, S. (2024). Autogen studio: A no-code developer tool for building and debugging multi-agent systems. In Proceedings of the 2024 Conference on Empirical Methods in Natural Language Processing: System Demonstrations, pages 72–79. Du, Y., Li, S., Torralba, A., Tenenbaum, J. B., and Mordatch, I. (2023). Improving factuality and reasoning in language models through multiagent debate. arXiv preprint arXiv:2305.14325. Epperson, W., Bansal, G., Dibia, V. C., Fourney, A., Gerrits, J., Zhu, E., and Amershi, S. (2025). Interactive debugging and steering of multi-agent ai systems. In Proceedings of the 2025 CHI Conference on Human Factors in Computing Systems, pages 1–15. Fernando, C., Banarse, D., Michalewski, H., Osindero, S., and Rocktäschel, T. (2023). Promptbreeder: Self-referential self-improvement via prompt evolution. arXiv preprint arXiv:2309.16797. Genewein, T., Franklin, M., Lerchner, A., Orseau, L., Albanie, S., Bales, A., Wyeth, C., Chan, S., Gabriel, I., Leibo, J. Z., et al. (2026). From agi to asi. arXiv preprint arXiv:2606.12683. Google (n.d.). Gemini generatecontent api. https://ai.google.dev/gemini-api/docs/text-generation. Accessed: 2026-05-16. Guo, Q., Wang, R., Guo, J., Li, B., Song, K., Tan, X., Liu, G., Bian, J., and Yang, Y. (2024). Connecting large language models with evolutionary algorithms yields powerful prompt optimizers. In International Conference on Learning Representations, volume 2024, pages 34133–34156. Hendrycks, D., Basart, S., Kadavath, S., Mazeika, M., Arora, A., Guo, E., Burns, C., Puranik, S., He, H., Song, D., et al. (2021a). Measuring coding challenge competence with apps. arXiv preprint arXiv:2105.09938.
13
Hendrycks, D., Burns, C., Kadavath, S., Arora, A., Basart, S., Tang, E., Song, D., and Steinhardt, J. (2021b). Measuring mathematical problem solving with the math dataset. arXiv preprint arXiv:2103.03874. Hong, S., Zhuge, M., Chen, J., Zheng, X., Cheng, Y., Wang, J., Zhang, C., Yau, S., Lin, Z., Zhou, L., et al. (2024). Metagpt: Meta programming for a multi-agent collaborative framework. In International Conference on Learning Representations, volume 2024, pages 23247–23275. Hong, Z., Zhang, Q., Sun, J., Shang, Z., Kong, M., Wang, X., Shu, Y., and Dai, Z. (2026). Maspob: Bandit-based prompt optimization for multi-agent systems with graph neural networks. arXiv preprint arXiv:2603.02630. Hu, S., Lu, C., and Clune, J. (2025). Automated design of agentic systems. In International Conference on Learning Representations, volume 2025, pages 21344–21377. Jain, N., Gu, A., Li, W.-D., Yan, F., Zhang, T., Wang, S., Solar-Lezama, A., Sen, K., and Stoica, I. (2025). Livecodebench: Holistic and contamination free evaluation of large language models for code. In International Conference on Learning Representations, volume 2025, pages 58791–58831. Jimenez, C. E., Yang, J., Wettig, A., Yao, S., Pei, K., Press, O., and Narasimhan, K. (2024). Swe-bench: Can language models resolve real-world github issues? In International Conference on Learning Representations, volume 2024, pages 54107–54157. Khattab, O., Singhvi, A., Maheshwari, P., Zhang, Z., Santhanam, K., Vardhamanan, S., Haq, S., Sharma, A., Joshi, T. T., Moazam, H., et al. (2023). Dspy: Compiling declarative language model calls into self-improving pipelines. arXiv preprint arXiv:2310.03714. Kim, Y., Gu, K., Park, C., Park, C., Schmidgall, S., Heydari, A. A., Yan, Y., Zhang, Z., Zhuang, Y., Liu, Y., et al. (2025). Towards a science of scaling agent systems. arXiv preprint arXiv:2512.08296. LangChain Inc. (2026). Langgraph: Build resilient language agents as stateful graph workflows. https: //github.com/langchain-ai/langgraph. Accessed: 2026-04-30. Li, G., Hammoud, H., Itani, H., Khizbullin, D., and Ghanem, B. (2023a). Camel: Communicative agents for" mind" exploration of large language model society. Advances in neural information processing systems, 36:51991–52008. Li, M., Zhao, Y., Yu, B., Song, F., Li, H., Yu, H., Li, Z., Huang, F., and Li, Y. (2023b). Api-bank: A comprehensive benchmark for tool-augmented llms. In Proceedings of the 2023 conference on empirical methods in natural language processing, pages 3102–3116. Li, W., Song, Y., Zhao, M., Jin, B., and Li, W. (2026). Unifying temporal and structural credit assignment in llm-based multi-agent prompt optimization. arXiv preprint arXiv:2605.30227. Liang, T., He, Z., Jiao, W., Wang, X., Wang, Y., Wang, R., Yang, Y., Shi, S., and Tu, Z. (2024). Encouraging divergent thinking in large language models through multi-agent debate. In Proceedings of the 2024 conference on empirical methods in natural language processing, pages 17889–17904. Lu, C., Lu, C., Lange, R. T., Foerster, J., Clune, J., and Ha, D. (2024). The ai scientist: Towards fully automated open-ended scientific discovery. arXiv preprint arXiv:2408.06292. Madaan, A., Tandon, N., Gupta, P., Hallinan, S., Gao, L., Wiegreffe, S., Alon, U., Dziri, N., Prabhumoye, S., Yang, Y., et al. (2023). Self-refine: Iterative refinement with self-feedback. Advances in neural information processing systems, 36:46534–46594. Meta (n.d.). Llama 4: Model cards and prompt formats. model-cards-and-prompt-formats/llama4/. Accessed: 2026-05-16.
https://www.llama.com/docs/
Mialon, G., Fourrier, C., Wolf, T., LeCun, Y., and Scialom, T. (2024). Gaia: a benchmark for general ai assistants. In International Conference on Learning Representations, volume 2024, pages 9025–9049.
14
OpenAI (2025). Model spec. https://model-spec.openai.com/2025-12-18.html. Accessed: 2026-05-16. OpenAI (2026). The next evolution of the agents the-next-evolution-of-the-agents-sdk/. Accessed: 2026-04-30.
sdk.
https://openai.com/index/
Opsahl-Ong, K., Ryan, M. J., Purtell, J., Broman, D., Potts, C., Zaharia, M., and Khattab, O. (2024). Optimizing instructions and demonstrations for multi-stage language model programs. In Proceedings of the 2024 Conference on Empirical Methods in Natural Language Processing, pages 9340–9366. Patil, S. G., Mao, H., Yan, F., Ji, C. C.-J., Suresh, V., Stoica, I., and Gonzalez, J. E. (2025). The berkeley function calling leaderboard (bfcl): From tool use to agentic evaluation of large language models. In Forty-second International Conference on Machine Learning. Plaat, A., van Duijn, M., Van Stein, N., Preuss, M., van der Putten, P., and Batenburg, K. J. (2025). Agentic large language models, a survey. Journal of Artificial Intelligence Research, 84. Prasad, A., Hase, P., Zhou, X., and Bansal, M. (2023). Grips: Gradient-free, edit-based instruction search for prompting large language models. In Proceedings of the 17th Conference of the European Chapter of the Association for Computational Linguistics, pages 3845–3864. Pryzant, R., Iter, D., Li, J., Lee, Y., Zhu, C., and Zeng, M. (2023). Automatic prompt optimization with “gradient descent” and beam search. In Proceedings of the 2023 conference on empirical methods in natural language processing, pages 7957–7968. Qian, C., Liu, W., Liu, H., Chen, N., Dang, Y., Li, J., Yang, C., Chen, W., Su, Y., Cong, X., et al. (2024). Chatdev: Communicative agents for software development. In Proceedings of the 62nd annual meeting of the association for computational linguistics (volume 1: Long papers), pages 15174–15186. Qian, C., Xie, Z., Wang, Y., Liu, W., Zhu, K., Xia, H., Dang, Y., Du, Z., Chen, W., Yang, C., et al. (2025). Scaling large language model-based multi-agent collaboration. In International Conference on Learning Representations, volume 2025, pages 41488–41505. Ramnath, K., Zhou, K., Guan, S., Mishra, S. S., Qi, X., Shen, Z., Wang, S., Woo, S., Jeoung, S., Wang, Y., et al. (2025). A systematic survey of automatic prompt optimization techniques. In Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing, pages 33066–33098. Rein, D., Hou, B. L., Stickland, A. C., Petty, J., Pang, R. Y., Dirani, J., Michael, J., and Bowman, S. R. (2023). Gpqa: A graduate-level google-proof q&a benchmark. arXiv preprint arXiv:2311.12022. Shen, M., Shu, R., Pratik, A., Gung, J., Ge, Y., Sunkara, M., and Zhang, Y. (2025a). Optimizing llmbased multi-agent system with textual feedback: A case study on software development. arXiv preprint arXiv:2505.16086. Shen, X., Liu, Y., Dai, Y., Wang, Y., Miao, R., Tan, Y., Pan, S., and Wang, X. (2025b). Understanding the information propagation effects of communication topologies in llm-based multi-agent systems. In Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing, pages 12358– 12372. Shinn, N., Cassano, F., Gopinath, A., Narasimhan, K., and Yao, S. (2023). Reflexion: Language agents with verbal reinforcement learning. Advances in neural information processing systems, 36:8634–8652. Trivedi, H., Khot, T., Hartmann, M., Manku, R., Dong, V., Li, E., Gupta, S., Sabharwal, A., and Balasubramanian, N. (2024). Appworld: A controllable world of apps and people for benchmarking interactive coding agents. In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 16022–16076. Wang, J., Wang, J., Athiwaratkun, B., Zhang, C., and Zou, J. Y. (2025). Mixture-of-agents enhances large language model capabilities. In International Conference on Learning Representations, volume 2025, pages 33944–33963. 15
Wang, X., Li, C., Wang, Z., Bai, F., Luo, H., Zhang, J., Jojic, N., Xing, E., and Hu, Z. (2024). Promptagent: Strategic planning with language models enables expert-level prompt optimization. In International Conference on Learning Representations, volume 2024, pages 23967–24001. Wang, Y., Kordi, Y., Mishra, S., Liu, A., Smith, N. A., Khashabi, D., and Hajishirzi, H. (2023). Self-instruct: Aligning language models with self-generated instructions. In Proceedings of the 61st annual meeting of the association for computational linguistics (volume 1: long papers), pages 13484–13508. Wang, Z., Liu, X., Wang, L., Shan, Z., Wang, Y., Song, Z., and Zhang, M. (2026). MASPO: Joint prompt optimization for llm-based multi-agent systems. arXiv preprint arXiv:2605.06623. Wu, Q., Bansal, G., Zhang, J., Wu, Y., Li, B., Zhu, E., Jiang, L., Zhang, X., Zhang, S., Liu, J., et al. (2024). Autogen: Enabling next-gen llm applications via multi-agent conversations. In First conference on language modeling. Xia, Y., Wang, T., Zhang, S., Weng, Z., Cao, B., and Liew, S. C. (2026). Hivemind: Contribution-guided online prompt optimization of llm multi-agent systems. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 40, pages 29767–29774. Xie, J., Zhang, K., Chen, J., Zhu, T., Lou, R., Tian, Y., Xiao, Y., and Su, Y. (2024). Travelplanner: A benchmark for real-world planning with language agents. arXiv preprint arXiv:2402.01622. Yang, C., Wang, X., Lu, Y., Liu, H., Le, Q. V., Zhou, D., and Chen, X. (2024). Large language models as optimizers. In International Conference on Learning Representations, volume 2024, pages 12028–12068. Yang, Y., Qu, C., Wen, M., Shi, L., Wen, Y., Zhang, W., Wierman, A., and Gu, S. (2026). Understanding agent scaling in llm-based multi-agent systems via diversity. arXiv preprint arXiv:2602.03794. Yang, Z., Qi, P., Zhang, S., Bengio, Y., Cohen, W., Salakhutdinov, R., and Manning, C. D. (2018). Hotpotqa: A dataset for diverse, explainable multi-hop question answering. In Proceedings of the 2018 conference on empirical methods in natural language processing, pages 2369–2380. Ye, J., Du, Z., Yao, X., Lin, W., Xu, Y., Chen, Z., Wang, Z., Zhu, S., Xi, Z., Yuan, S., et al. (2025). Toolhop: A query-driven benchmark for evaluating large language models in multi-hop tool use. In Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 2995–3021. Yuksekgonul, M., Bianchi, F., Boen, J., Liu, S., Huang, Z., Guestrin, C., and Zou, J. (2024). Textgrad: Automatic" differentiation" via text. arXiv preprint arXiv:2406.07496. Zhang, S., Yin, M., Zhang, J., Liu, J., Han, Z., Zhang, J., Li, B., Wang, C., Wang, H., Chen, Y., et al. (2025). Which agent causes task failures and when? on automated failure attribution of llm multi-agent systems. arXiv preprint arXiv:2505.00212. Zhang, Z., Ge, L., Li, H., Zhu, W., Zhang, C., and Ye, Y. (2026). Mapro: Recasting multi-agent prompt optimization as maximum a posteriori inference. In Findings of the Association for Computational Linguistics: EACL 2026, pages 4458–4480. Zhao, J., Xie, H., Lei, Y., Song, X., Shi, Z., Li, L., Liu, S., and Zhang, H. (2025). Connecting the dots: A chain-of-collaboration prompting framework for llm agents. arXiv preprint arXiv:2505.10936. Zhou, H., Wan, X., Sun, R., Palangi, H., Iqbal, S., Vulić, I., Korhonen, A., and Arık, S. Ö. (2025). Multi-agent design: Optimizing agents with better prompts and topologies. arXiv preprint arXiv:2502.02533. Zhou, Y., Muresanu, A. I., Han, Z., Paster, K., Pitis, S., Chan, H., and Ba, J. (2022). Large language models are human-level prompt engineers. In The eleventh international conference on learning representations. Zhu, K., Du, H., Hong, Z., Yang, X., Guo, S., Wang, D. Z., Wang, Z., Qian, C., Tang, R., Ji, H., et al. (2025). Multiagentbench: Evaluating the collaboration and competition of llm agents. In Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 8580–8622. 16
Zhu, K., Zhao, Q., Chen, H., Wang, J., and Xie, X. (2024). Promptbench: A unified library for evaluation of large language models. Journal of Machine Learning Research, 25(254):1–22.
17
Appendix Contents A Benchmark Details 18 A.1 Frameworks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 A.2 Task Datasets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 A.3 Communication Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 A.4 Prompt Optimizers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 A.5 Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 B Prompt Examples 22 B.1 Meta Prompt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 B.2 Initial and Optimized System Prompt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
A
Benchmark Details
A.1
Frameworks
We instantiate MAS configurations using four public frameworks: LangGraph LangChain Inc. (2026), CrewAI CrewAI Inc. (2026), AutoGen Wu et al. (2024), and OpenAI Agents SDK OpenAI (2026). Together, these frameworks span graph-based orchestration, role-based collaboration, conversational multi-agent systems, and production-oriented agent workflows, allowing us to evaluate prompt optimization across diverse execution environments. LangGraph LangChain Inc. (2026) is a graph-based framework for building stateful language-agent workflows. Agents are represented as nodes and information flow is defined through directed graph edges, making it well suited for implementing sequential, branching, and cyclic coordination structures. We use LangGraph to instantiate topologies where explicit control over routing and state propagation is required. CrewAI CrewAI Inc. (2026) is a role-based multi-agent framework that organizes agents around specialized responsibilities and task delegation. Agents collaborate through predefined roles, goals, and communication patterns, providing a natural abstraction for workflows that emphasize specialization and hierarchical coordination. We use CrewAI to study how prompt optimization interacts with structured role assignments. AutoGen Wu et al. (2024) is a conversational multi-agent framework in which agents interact through iterative message exchange. It provides flexible support for debate, reflection, collaboration, and tool use, making it a common platform for research on LLM-based agent societies. We use AutoGen to instantiate communication-intensive workflows where performance depends heavily on inter-agent interaction. OpenAI Agents SDK OpenAI (2026) is a production-oriented framework for building tool-using agents with tracing, handoffs, and structured execution. The framework provides native support for agent delegation, tool invocation, and workflow monitoring, making it representative of modern agent-engineering practice. We use it to evaluate prompt optimization in realistic agent pipelines that combine reasoning, coordination, and external tool use.
A.2
Task Datasets
We choose benchmarks to cover three main regimes where MAS are commonly used: reasoning, coding, and tool use. This mix lets us test whether prompt optimization helps only on tasks with explicit artifacts, such as code, patches, or function calls, or also on tasks where agents mainly exchange rationales and final answers. For each dataset, we use its native evaluation metric, reported as accuracy, pass rate, or resolve rate depending on the benchmark. GPQA-Diamond Rein et al. (2023) is the Diamond subset of GPQA, a graduate-level, Google-proof multiple-choice benchmark written by domain experts in biology, physics, and chemistry. The questions are designed to be difficult even for highly capable language models and resistant to retrieval-based shortcuts. We use it to evaluate scientific reasoning under a constrained multiple-choice format. We report multiple-choice
18
answer accuracy: the model’s final selected option is extracted and compared with the gold option, and a prediction is correct only when the selected option exactly matches the reference answer. HotpotQA Yang et al. (2018) is a multi-hop question-answering benchmark built from Wikipedia. Answering a question typically requires combining evidence from multiple documents rather than retrieving a single supporting passage. We use it to evaluate evidence integration and multi-step reasoning in collaborative agent workflows. We use SQuAD-style exact match: both prediction and reference answer are normalized by lowercasing, removing punctuation and articles, and standardizing whitespace, and a prediction is correct only if the normalized prediction exactly matches the normalized reference answer. MATH Hendrycks et al. (2021b) contains competition-level mathematics problems spanning algebra, geometry, number theory, probability, and calculus. Solving these problems often requires long chains of symbolic reasoning and precise intermediate calculations. We use it to evaluate mathematical reasoning. We report math-equivalence accuracy on the extracted final answer: following the benchmark format, we extract the answer from \boxed{} when available, otherwise from the final answer span, and count a prediction as correct if the extracted answer is mathematically equivalent to the ground-truth answer. LiveCodeBench Jain et al. (2025) is a contamination-resistant coding benchmark built from recent programming-contest problems. Because the tasks are collected after the training cutoff of many language models, they provide a stronger test of generalization than static coding benchmarks. We use it to evaluate code generation under executable test cases. We report all-tests-pass accuracy: the generated program is executed against the benchmark test suite, and an instance is counted as correct only if all hidden test cases pass. APPS Hendrycks et al. (2021a) evaluates code generation from natural-language programming specifications. The benchmark spans introductory, interview-level, and competition-style programming problems with hidden test cases. We use it to test whether agents can synthesize correct programs from problem descriptions alone. We also report all-tests-pass accuracy: the generated solution is run against the benchmark test cases, and an instance is correct only when the program passes the full test suite; passing public examples alone is not sufficient. SWE-bench Verified Jimenez et al. (2024) is a human-validated subset of SWE-bench built from real GitHub issues and software repositories. Each instance requires understanding an existing codebase, modifying repository files, and generating a patch that resolves the reported issue. We use it to evaluate repository-level software engineering tasks under executable verification. We report resolve rate: the generated patch is applied to the target repository and evaluated with the benchmark’s issue-resolution tests, and an instance is counted as resolved only if the patch applies successfully and all required FAIL_TO_PASS and PASS_TO_PASS tests pass. BFCL Patil et al. (2025) evaluates function-calling ability across realistic tool-use settings. Tasks require selecting the correct function and generating valid arguments that satisfy the API specification. We use it to evaluate structured tool invocation and argument generation, measured with AST-based matching. We report AST-based function-call correctness: the predicted function call is parsed into an abstract syntax tree and compared with the reference call by function name and argument values, accepting formatting differences that do not change the function call semantics. ToolHop Ye et al. (2025) evaluates multi-hop tool use, where solving a query requires selecting and composing multiple locally executable tools. The output of one tool often serves as the input to another, creating dependencies across tool calls. We use it to evaluate sequential tool planning and execution. We report answer accuracy: the agent must select and compose the required tools, then return a final answer, and a prediction is correct when the final answer after tool execution matches the benchmark reference answer. API-Bank Li et al. (2023b) evaluates tool-augmented dialogue agents in a runnable API environment. Tasks require planning, API retrieval, parameter selection, and API execution within multi-turn interactions. We use it to evaluate end-to-end tool-use behavior in interactive settings. We report API-call accuracy: a prediction is correct when the model selects the correct API and provides the required arguments according to the annotated reference call, evaluating both API retrieval and parameter generation.
A.3
Communication Formats
We compare three inter-agent communication formats using the same HotPotQA example, in which an agent reports evidence for whether Scott Derrickson and Ed Wood share the same nationality. The freeform 19
format provides only the question and answer context, leaving downstream agents to infer which facts are important. The semi-structured format exposes the agent’s status, summary, evidence, confidence, next step, entities, reasoning hops, and answer candidate through explicit tags. The structured format encodes the same information as a JSON-style report, making the message easier to parse and validate automatically. Across all three examples, only the communication format changes; the task, topology, team size, agent roles, and scoring rule remain fixed. HotPotQA—multi-hop comparison Question: Were Scott Derrickson and Ed Wood of the same nationality? Gold answer: yes
Freeform Message researcher: I looked up both people. Scott Derrickson is an American director (born in Denver, Colorado), and Ed Wood was an American filmmaker (born in Poughkeepsie, New York). Since both are American, they share the same nationality--so the answer is yes.
Semi-structured Message [STATUS] completed [SUMMARY] Both individuals are American, so they share the same nationality. [EVIDENCE_OR_TESTS] • Scott Derrickson (Wikipedia): • Ed Wood (Wikipedia):
American director, born in Denver, Colorado.
American filmmaker, born in Poughkeepsie, New York.
[CONFIDENCE] high [NEXT] Hand off to the writer to emit the final yes/no answer. [ENTITIES] Scott Derrickson, Ed Wood [HOPS] Find Scott Derrickson’s nationality; find Ed Wood’s nationality; compare. [ANSWER_CANDIDATE] yes
Structured Message Example JSON_REPORT: { "status": "completed", "summary": "Both individuals are American, so they share the same nationality.", "confidence": "high", "next": "Hand off to the writer to emit the final yes/no answer.", "payload": { "entities": ["Scott Derrickson", "Ed Wood"], "hops": [ "Find Scott Derrickson’s nationality", "Find Ed Wood’s nationality", "Compare the two" ], "evidence": [ { "source": "Scott Derrickson (Wikipedia)", "fact": "American director, born in Denver, Colorado" }, { "source": "Ed Wood (Wikipedia)", "fact": "American filmmaker, born in " "Poughkeepsie, New York"
20
} ], "answer_candidate": "yes" } } END_JSON_REPORT
A.4
Prompt Optimizers
Multi-agent extension of GEPA. GEPA Agrawal et al. (2025) is a state-of-the-art prompt optimization framework originally designed for single-agent LLM systems. It improves prompts through a reflection-based optimization procedure that leverages natural-language feedback to iteratively revise prompts based on execution traces, while keeping the underlying model weights fixed. Specifically, GEPA maintains a pool of candidate prompts. In each optimization iteration, it selects a candidate from the Pareto frontier of the current prompt pool, executes the corresponding system on a minibatch of training tasks, and records the resulting execution traces, including intermediate reasoning steps, tool invocations, tool outputs, and final answers. A feedback function then evaluates each rollout and produces both a scalar task score and textual feedback. Together with the associated execution trace, this information is provided to a reflection model, which analyzes the observed failures and generates a revised prompt candidate that is added back to the candidate pool. This process repeats until the rollout budget is exhausted. We extend this reflective prompt-evolution framework to multi-agent LLM systems. Each agent maintains its own pool of candidate prompts. During each optimization round, GEPA updates agents sequentially, optimizing one agent’s prompt at a time while keeping all others fixed. For the selected agent, the reflection model receives the agent’s execution trace, the surrounding interaction context, the final team-level outcome, and feedback produced by the evaluation function. Based on this information, it revises only the selected agent’s system prompt, leaving the prompts of all other agents unchanged. For all experiments, we use a 25-example training split and a 25-example validation split for each combination of dataset and topology, together with GEPA’s medium optimization budget. At each iteration, GEPA samples a candidate prompt configuration and evaluates it on a minibatch of three training examples; using a round-robin policy, it then reflects on the resulting traces and feedback to revise one agent’s system prompt at a time. We disable perfect-score skipping so that optimization continues on easy datasets where minibatches may already score perfectly, and we terminate optimization after five full-validation iterations without improvement. After optimization, we adopt a conservative prompt-selection strategy at the system level. The optimized multi-agent prompt configuration is used only if it outperforms the original seed configuration on the GEPA validation split; otherwise, the seed configuration is retained. Final benchmark evaluation is performed separately from optimization, and all examples used during prompt optimization are excluded from later evaluation. Multi-agent extension of MIPRO. MIPRO Opsahl-Ong et al. (2024) is a prompt optimizer originally proposed for single-agent LM programs, where a program may contain one or multiple LLM modules arranged as a multi-stage pipeline. We directly adapt MIPRO to multi-agent LLM systems by treating each agent as an optimizable module. For each dataset and collaboration topology, we keep the original multi-agent execution engine and inter-agent communication structure unchanged, and optimize only the system prompt of each agent. This allows MIPRO to jointly search over prompt configurations across agents using end-to-end task performance as the optimization signal. For all experiments, MIPRO uses the same 25-example training split and 25-example validation split as GEPA. For each agent, it proposes three candidate instructions and three bootstrapped demonstration sets of up to four demonstrations each, using no manually labeled examples, and searches over their combinations for three optimization trials. Candidate multi-agent prompt configurations are evaluated on the full validation set rather than minibatches, and both instruction candidates and rendered few-shot demonstrations are selected based on validation performance. After optimization, we adopt the same conservative prompt-selection strategy used for GEPA.
21
A.5
Models
Table 6 summarizes the models used throughout the benchmark. We use Qwen/Qwen3.5-9B as the task model for all benchmark execution and Qwen/Qwen3.5-122B-A10B-FP8 as the reflection model for prompt optimization. This separation follows the design of modern prompt optimizers: the task model executes the benchmark under a given prompt configuration, while the reflection model analyzes failures and proposes prompt updates. All reported results are produced by re-running the benchmark with the resulting optimized prompts. Disable Thinking Mode. We disable thinking mode for task model to maintain a controlled and reproducible evaluation protocol. This avoids differences in hidden reasoning budgets across tasks, topologies, communication protocols, and team sizes, ensuring that comparisons reflect visible agent behavior and coordination rather than variation in model-internal reasoning. Therefore, the reported scores should be interpreted as performance under a controlled agentic protocol rather than the maximum achievable performance of the underlying model. Table 6: Models used for task execution and prompt optimization, with decoding configurations. Values report the GEPA configuration unless otherwise noted.
Configuration
Model ID Temperature Top-p Seed Max output tokens Thinking mode
B
Prompt Examples
B.1
Meta Prompt
Task model
Reflection model
Qwen/Qwen3.5-9B 0.2 0.9 0 32,768 Disabled
Qwen/Qwen3.5-122B-A10B-FP8 1.0 1.0 (default) — (unset) 48,000 Enabled
We use a meta prompt to generate role-specific seed prompts for each benchmark and topology. The meta prompt specifies the task, metric, topology, communication protocol, and the agent’s position in the workflow. Meta Prompt Template You are designing a system prompt for one agent in a multi-agent LLM system. Given the benchmark, scoring metric, topology, communication protocol, agent role, and neighboring agents, write a concise system prompt that defines: - the agent’s responsibility; - the local procedure it should follow; - the information it should send to other agents; - the final-output constraint required by the benchmark. Do not change the topology, tools, number of agents, or aggregation rule.
B.2
Initial and Optimized System Prompt
This section presents representative baseline and optimized system prompts from our experiments. For each benchmark and multi-agent configuration, we report the original role-specific prompt used as the seed and the corresponding prompt selected after system-prompt optimization. These examples show how optimization changes agent instructions by clarifying task requirements, tool-use procedures, output constraints, and coordination behavior, while keeping the benchmark, topology, available tools, number of agents, and aggregation rule fixed.
22
B.2.1
HotPotQA under Independent Topology
Baseline System Prompt—Solver You are a specialized agent designed to answer multi-hop questions using Wikipedia. Your objective is to retrieve accurate information and provide a concise, final answer suitable for consensus aggregation. You have access to the following tools: 1. wikipedia_search: Searches Wikipedia and returns titles and short summaries of top matching articles. 2. wikipedia_page: Returns the full text of a Wikipedia article given its exact title. Follow these steps to solve the task: 1. Analyze the question to identify the entities and relationships involved. 2. Use wikipedia_search to find articles related to the identified entities. 3. Use wikipedia_page to read the full text of articles that contain the necessary information. Output your response in the following format: Reasoning: [Describe your search strategy, findings, and logical steps] Answer: [The final short-form answer]
Optimized System Prompt—Solver You are a specialized agent designed to answer multi-hop questions using Wikipedia. Your objective is to retrieve accurate information and provide a concise, final answer suitable for consensus aggregation. Task Description: You will be given multi-hop questions that require searching Wikipedia to find interconnected pieces of information. Each question typically involves at least two reasoning steps (hops) where information from one search must be used to inform the next search or the final answer. Available Tools: wikipedia_search: Searches Wikipedia and returns titles and short summaries of top matching articles. Use this to identify relevant topics and entities related to the question. wikipedia_page: Returns the full text of a Wikipedia article given its exact title. Use this to read detailed content for fact verification. Critical Requirements: MUST USE TOOLS: You must call the provided tools (wikipedia_search and wikipedia_page) to gather information. Do not rely on internal knowledge or make assumptions without verification. Multi-Hop Verification: For each reasoning hop, perform a wikipedia_search first, then use wikipedia_page to read the relevant article content before drawing conclusions. Entity Disambiguation: When searching for entities, ensure you identify the correct one by checking relevant Wikipedia page details (e.g., population figures, dates, locations).
23
Answer Normalization: Provide the final answer in a normalized format that matches potential gold standard formats (e.g., full official names like "Cincinnati metropolitan area" rather than just "Cincinnati", or full names like "Janet Damita Jo Jackson" when precision is required). Evidence-Based Reasoning: Your reasoning must explicitly reference information found in the Wikipedia pages you retrieve, including specific details like dates, populations, rankings, or names. Step-by-Step Process: Analyze the question to identify all entities, relationships, and intermediate facts needed. Use wikipedia_search to find articles related to each identified entity. Use wikipedia_page to read the full text of articles that contain the necessary information. Synthesize the information from the retrieved pages, ensuring you verify each fact before proceeding to the next reasoning hop. Format your final answer as a short, normalized value that could be used for consensus voting. Output Format: Reasoning: [Describe your search strategy, what tools you called with which queries, what information you found on each page, and the logical steps connecting them to the answer] Answer: [The final short-form answer - normalized to match gold standard format] Common Pitfalls to Avoid: Do not answer without actually calling the tools (tool_calls must not be empty) Do not assume facts without verification from Wikipedia pages Do not provide partial names when full names are standard (e.g., use "Cincinnati metropolitan area" not "Cincinnati") Do not confuse similar entities (e.g., different metropolitan areas, different years for lists) Verify population figures, dates, and rankings directly from Wikipedia page text before stating them
B.2.2
SWE under Centralized Topology
Baseline System Prompt—Manager You are the Manager agent in a multi-agent system designed to resolve GitHub issues by generating code patches. You operate in a Star topology consisting of yourself and 3 Specialist Workers. You are the central coordinator; Workers do not communicate with each other and only see your current delegation instructions. You have access to the full conversation history. Your primary responsibilities are: Plan the investigation strategy. Delegate reading, searching, editing, and testing tasks to Workers. Validate results using your available tools. Loop until the task is complete and verified. Assemble the final diff.
24
AVAILABLE TOOLS: file_read: Read content from a file in the repository working directory. list_dir: List directory entries in the repository working directory. search_repo: Perform regex-style grep search under the repository working directory. delegate_to_navigator_worker: Ask the navigator worker to inspect files, directories, or code patterns. delegate_to_patcher_worker: Ask the patcher worker to apply a targeted code edit. delegate_to_tester_worker: Ask the tester worker to run a lightweight verification command. OPERATIONAL GUIDELINES: Use list_dir and search_repo to understand the repository structure and locate relevant code. Use file_read to inspect specific files before delegating edits or validating changes. Delegate tests, linters, or build commands to the tester worker. Delegate edits to the patcher worker; the patcher uses targeted str_replace edits. Do not invent tools. Do not use web search or external resources. Ensure all changes are validated via tester output and file_read content checks before finalizing. If validation fails, analyze the error, adjust the plan, and delegate a correction to a Worker. WORKFLOW: Analyze the GitHub issue. Explore the repo using list_dir, search_repo, file_read. Formulate a plan and delegate specific subtasks to Workers (e.g., "Worker 1: Analyze file X", "Worker 2: Implement fix in file Y"). Receive Worker outputs. Validate outputs using file_read and tester-worker reports. If valid, assemble the final patch. If invalid, loop back to step 3. Confirm task completion. REMEMBER: You are the only agent with full visibility. Workers are isolated; you must provide clear, self-contained instructions. Rely strictly on the tools listed above for all repository interactions.
Optimized System Prompt—Manager You are the Manager agent in a multi-agent system designed to resolve GitHub issues by generating code patches. You operate in a Star topology consisting of yourself and 3 Specialist Workers. You are the central coordinator; Workers do not communicate with each other and only see your current delegation instructions. You have access to the full conversation history. Your primary responsibilities are: Plan the investigation strategy. Delegate reading, searching, editing, and testing tasks to Workers. Validate results using your available tools.
25
Loop until the task is complete and verified. Assemble the final diff. AVAILABLE TOOLS: file_read: Read content from a file in the repository working directory. file_write: Overwrite or create a file in the repository working directory. list_dir: List directory entries in the repository working directory. search_repo: Perform regex-style grep search under the repository working directory. shell_exec: Run shell commands in the repository working directory (returns stdout, stderr, exit code). OPERATIONAL GUIDELINES: Use list_dir and search_repo to understand the repository structure and locate relevant code. Use file_read to inspect specific files before delegating edits or validating changes. Use shell_exec to run tests, linters, or build commands to verify the patch correctness. Use file_write to apply patches if necessary, or instruct Workers to do so. Do not invent tools. Do not use web search or external resources. Ensure all changes are validated via shell_exec (tests) and file_read (content check) before finalizing. If validation fails, analyze the error, adjust the plan, and delegate a correction to a Worker. WORKFLOW: Analyze the GitHub issue. Explore the repo using list_dir, search_repo, file_read. Formulate a plan and delegate specific subtasks to Workers (e.g., "Worker 1: Analyze file X", "Worker 2: Implement fix in file Y"). Receive Worker outputs. Validate outputs using file_read and shell_exec. If valid, assemble the final patch. If invalid, loop back to step 3. Confirm task completion. REMEMBER: You are the only agent with full visibility. Workers are isolated; you must provide clear, self-contained instructions. Rely strictly on the 5 tools listed above for all repository interactions.
Baseline System Prompt—Navigator_Worker You are the navigator_worker, a specialist agent within a multi-agent system designed to resolve GitHub issues that require code patches. You operate in a star topology consisting of one manager and three specialist workers. Topology and Communication Constraints: You receive instructions exclusively from the central manager. You do not communicate with other workers.
26
You only see the manager’s current delegation message. You do not have access to the conversation history, the outputs of other workers, or their interaction histories. The manager sees the whole conversation and may loop tasks until completion. Role Objective: Your primary function is to navigate the repository codebase based on the manager’s instructions. You will read files, search for code patterns, or explore directories to gather necessary information. Upon completing a task, you must return a concise summary of your findings. Available Tools: You are permitted to use only the following tools: file_read: read a file from the repository working directory. list_dir: list entries in a directory under the repository workdir. search_repo: grep-style regex search under the repository workdir. Operational Guidelines: Analyze the manager’s current instruction carefully. Use the available tools to retrieve the requested information or perform the requested action. Ensure all file paths and commands are relative to the repository working directory. Provide a concise summary of your results. Avoid unnecessary verbosity. Do not attempt to use tools or capabilities not listed above. Do not edit files. Do not attempt to communicate with other workers or reference their outputs.
Optimized System Prompt—Navigator_Worker You are the navigator_worker, a specialist agent within a multi-agent system designed to resolve GitHub issues that require code patches. You operate in a star topology consisting of one manager and three specialist workers. Topology and Communication Constraints: You receive instructions exclusively from the central manager. You do not communicate with other workers. You only see the manager’s current delegation message. You do not have access to the conversation history, the outputs of other workers, or their interaction histories. The manager sees the whole conversation and may loop tasks until completion. Role Objective: Your primary function is to navigate the repository codebase based on the manager’s instructions. You will read files, search for code patterns, or explore directories to gather necessary information. Upon completing a task, you must return a concise summary of your findings. Available Tools: You are permitted to use only the following tools:
27
file_read: read a file from the repository working directory. file_write: overwrite or create a file in the repository working directory. list_dir: list entries in a directory under the repository workdir. search_repo: grep-style regex search under the repository workdir. shell_exec: run a shell command in the repository working directory; returns stdout, stderr, and exit code. Operational Guidelines: Analyze the manager’s current instruction carefully. Use the available tools to retrieve the requested information or perform the requested action. Ensure all file paths and commands are relative to the repository working directory. Provide a concise summary of your results. Avoid unnecessary verbosity. Do not attempt to use tools or capabilities not listed above. Do not attempt to communicate with other workers or reference their outputs.
Baseline System Prompt—Patcher_Worker You are a patcher_worker agent operating within a multi-agent star topology system. Your primary objective is to resolve GitHub issues by implementing targeted code patches in the repository working directory. Topology and Context: You are one of three specialist workers managed by a single Manager agent. You communicate exclusively with the Manager. You do not have access to other workers’ outputs, histories, or internal states. You only see the Manager’s current delegation instruction. Do not attempt to coordinate with other agents or reference their work. The Manager sees the full conversation history; you must rely on the current instruction provided by the Manager. Available Tools: You have access to the following tools only. Do not invent, assume, or use any other tools (e.g., web search, external APIs, or unlisted commands). file_read: Read the content of a file from the repository working directory. str_replace: Replace exactly one occurrence of an old substring with a new substring in a file. Use enough surrounding context in old so the match is unique. Workflow Instructions: Analyze: Carefully read the Manager’s instruction to understand the specific code change required. Inspect: Use file_read to examine the current code state before making changes. Edit: Implement the minimal, targeted code edit required to resolve the issue. Apply: Use str_replace to save the modified region. If the old text is missing or ambiguous, call file_read again and retry with more precise context. Report: Return the resulting patch fragment and a summary of the changes in your response. Guidelines: Make minimal changes that strictly address the Manager’s instruction.
28
Ensure all code syntax is correct and consistent with the existing codebase. Do not modify files unrelated to the specific instruction. If a file path is ambiguous, ask the Manager to delegate additional localization to the navigator worker. If you encounter an error, report it to the Manager via your response; do not attempt to bypass the instruction. Output Format: After applying the patch using str_replace, clearly state the file modified and describe the nature of the change in your text response.
Optimized System Prompt—Patcher_Worker You are a patcher_worker agent operating within a multi-agent star topology system. Your primary objective is to resolve GitHub issues by implementing targeted code patches in the repository working directory. Topology and Context: You are one of three specialist workers managed by a single Manager agent. You communicate exclusively with the Manager. You do not have access to other workers’ outputs, histories, or internal states. You only see the Manager’s current delegation instruction. Do not attempt to coordinate with other agents or reference their work. The Manager sees the full conversation history; you must rely on the current instruction provided by the Manager. Available Tools: You have access to the following tools only. Do not invent, assume, or use any other tools (e.g., web search, external APIs, or unlisted commands). file_read: Read the content of a file from the repository working directory. file_write: Overwrite or create a file in the repository working directory. list_dir: List entries in a directory under the repository workdir. search_repo: Perform a grep-style regex search under the repository workdir. shell_exec: Run a shell command in the repository working directory; returns stdout, stderr, and exit code. Workflow Instructions: Analyze: Carefully read the Manager’s instruction to understand the specific code change required. Locate: If the file path is not provided, use search_repo or list_dir to find the relevant files. Inspect: Use file_read to examine the current code state before making changes. Edit: Implement the minimal, targeted code edit required to resolve the issue. Apply: Use file_write to save the modified file. If creating a new file, use file_write with the full content. Verify: If necessary, use shell_exec to run tests or commands to verify the change (e.g., syntax check, unit tests). Report: Return the resulting patch fragment and a summary of the changes in your response. Guidelines: Make minimal changes that strictly address the Manager’s instruction.
29
Ensure all code syntax is correct and consistent with the existing codebase. Do not modify files unrelated to the specific instruction. If a file path is ambiguous, use search_repo to confirm the correct location. If you encounter an error, report it to the Manager via your response; do not attempt to bypass the instruction. Output Format: After applying the patch using file_write, clearly state the file modified and describe the nature of the change (the patch fragment) in your text response.
Baseline System Prompt—Tester_Worker You are the tester_worker agent within a star-topology multi-agent system focused on resolving GitHub issues. Your specific role is to validate candidate patches by executing the repository’s test suite and reporting the results to the Manager agent. Operational Constraints: Topology: You operate in isolation. You only receive instructions from the Manager. You do not see or communicate with other worker agents. Environment: You are working in a repository working directory that may contain a candidate patch applied to the codebase. Tools: You may ONLY use the following tools: file_read, shell_exec. Do not attempt to use any other tools or external resources. Task Workflow: Analyze Delegation: Read the Manager’s instructions to understand which tests need to be run or if the full suite is required. Inspect Test Configuration: Use file_read on manager-provided files if needed to determine the correct command to invoke the test runner. Execute Tests: Use shell_exec to run the test commands. Capture the stdout, stderr, and exit_code. Evaluate Results: If exit_code is 0 and no test failures are reported in stdout/stderr, the patch is considered valid. If exit_code is non-zero or test failures are present, the patch is considered invalid. Report: Provide a concise summary to the Manager including the test command used, the exit code, and a summary of any failures. Tool Usage Guidelines: shell_exec: Use this for running test commands (e.g., pytest, npm test, go test). Ensure commands are run in the repository root unless specified otherwise. file_read: Use this to inspect test configuration files or specific test files named by the Manager. Output Format: When responding to the Manager, structure your response clearly: Status: PASS or FAIL Command Executed: [The shell command run] Exit Code: [Integer] Summary: [Brief explanation of success or specific failure details]
30
Logs: [Relevant excerpts from stdout/stderr if failure occurred] Adhere strictly to these guidelines. Do not hallucinate tools or capabilities.
Optimized System Prompt—Tester_Worker You are the tester_worker agent within a star-topology multi-agent system focused on resolving GitHub issues. Your specific role is to validate candidate patches by executing the repository’s test suite and reporting the results to the Manager agent. Operational Constraints: Topology: You operate in isolation. You only receive instructions from the Manager. You do not see or communicate with other worker agents. Environment: You are working in a repository working directory that may contain a candidate patch applied to the codebase. Tools: You may ONLY use the following tools: file_read, file_write, list_dir, search_repo, shell_exec. Do not attempt to use any other tools or external resources. Task Workflow: Analyze Delegation: Read the Manager’s instructions to understand which tests need to be run or if the full suite is required. Discover Test Configuration: Use list_dir and file_read to locate test configuration files (e.g., package.json, pytest.ini, Makefile, setup.py) to determine the correct command to invoke the test runner. Locate Tests: If specific tests are requested, use search_repo or list_dir to find the relevant test files. Execute Tests: Use shell_exec to run the test commands. Capture the stdout, stderr, and exit_code. Evaluate Results: If exit_code is 0 and no test failures are reported in stdout/stderr, the patch is considered valid. If exit_code is non-zero or test failures are present, the patch is considered invalid. Report: Provide a concise summary to the Manager including the test command used, the exit code, and a summary of any failures. Tool Usage Guidelines: shell_exec: Use this for running test commands (e.g., pytest, npm test, go test). Ensure commands are run in the repository root unless specified otherwise. file_read: Use this to inspect test configuration files or specific test files to understand expected behavior. list_dir: Use this to explore the directory structure to find test folders (e.g., tests/, spec/). search_repo: Use this to grep for specific test functions or classes related to the issue. file_write: Use this only if you need to create a temporary test script or modify a configuration file to enable testing. Do not modify the source code being patched unless explicitly instructed to fix a test setup issue. Output Format: When responding to the Manager, structure your response clearly:
31
Status: PASS or FAIL Command Executed: [The shell command run] Exit Code: [Integer] Summary: [Brief explanation of success or specific failure details] Logs: [Relevant excerpts from stdout/stderr if failure occurred] Adhere strictly to these guidelines. Do not hallucinate tools or capabilities.
B.2.3
BFCL under Independent Topology
Baseline System Prompt—Caller You are a function-calling agent operating within a parallel ensemble topology. Your task is to emit exactly one function call matching the provided tool schemas. Tool schemas are supplied dynamically per task. You must strictly adhere to the provided schemas. Do not invent, assume, or use any tools that are not explicitly listed in the current context. If tool schemas are provided: Analyze the request and select the single most appropriate tool. Construct the function call with arguments that strictly match the schema’s types and requirements. Output the call in a canonical, structured format to ensure compatibility with ensemble AST-match consensus. Do not include conversational filler or explanations. If no tool schemas are provided (list is "None"): Do not attempt to call any function. Reason directly from the prompt and provide the final answer. Your output must be precise to facilitate consensus aggregation across the ensemble.
Optimized System Prompt—Caller You are a function-calling agent operating within a parallel ensemble topology. Your primary objective is to emit exactly one valid function call that aligns with the provided tool schemas, ensuring structural and typological precision for ensemble consensus aggregation. Operational Guidelines Tool Selection and Schema Adherence Dynamic Tools: Tool schemas are supplied dynamically per task in the input context. Analyze the request and select the single most appropriate tool from the provided list. No Invention: Do not invent, assume, or use tools or parameters that are not explicitly listed in the current context. Schema Compliance: Arguments must strictly match the data types and structure defined in the tool’s schema properties. Argument Construction & Type Safety
32
To pass the ensemble’s AST-match consensus and validation logic, you must adhere to these strict type rules: Float Precision: If a schema parameter is defined as float, you must provide a numeric value with a decimal point (e.g., 3.0, -1.0, 2.5). Do not use integers (e.g., 3) where floats are required, even if the value is a whole number. Array/Collection Structure: If a schema parameter is defined as array or list, provide a native JSON list structure (e.g., ["value1", "value2"]). Do not serialize lists into JSON strings (e.g., do not output ’["value1", "value2"]’). Parameter Names: Use exact parameter names as defined in the schema (case-sensitive). Required Arguments: Include every argument listed in the required field of the schema. Output Formatting Canonical Structure: Output the function call in a canonical, structured JSON format compatible with the ensemble’s aggregation system. The output must be a list containing a single dictionary where the key is the tool name and the value is the arguments object: [{"tool_name": {"arg1": value1, ...}}]. Zero Filler: Do not include conversational text, markdown code blocks, explanations, or preambles. Output only the structured function call data. Consensus Aggregation: Your output precision is vital. Variations in type or structure will be rejected during the ensemble voting process. No-Tool Scenario If the provided tool schemas list is "None": Do not attempt to call any function. Reason directly from the prompt and provide the final answer clearly. Common Pitfalls to Avoid: Numeric Types: Passing 3 instead of 3.0 for float parameters. Serialization: Passing ’["a", "b"]’ instead of ["a", "b"] for array parameters. Missing Fields: Omitting required arguments defined in the schema. Proceed by analyzing the input, selecting the correct tool, and emitting the strictly typed function call in the specified format.
33