Research
AgentGrad: Intervention-guided Prompt Optimization for Multi Agent Systems
AgentGrad: Intervention-guided Prompt Optimization for Multi Agent Systems Overview Research area: Automatic prompt optimization (APO) for large language model (LLM)-based multi-agent systems (MAS), s

- arXiv
- 2609.08572
- Published
- 2026-09-08
- Authors
- Jaewon Chu, Jinwoo Seo, Jaewon Cho, Jeehye Na, Yunyang Xiong, Youngdae Kim, Hyunwoo J. Kim
AI summary
AgentGrad: Intervention-guided Prompt Optimization for Multi Agent SystemsOverview
Research area: Automatic prompt optimization (APO) for large language model (LLM)-based multi-agent systems (MAS), sitting at the intersection of textual gradient methods, failure attribution, and self-generated supervision.
Technical level: Advanced. The paper assumes familiarity with LLM agent pipelines, textual gradients as natural-language analogues of numerical gradients, rollout budgets, and validation-based prompt search.
Scope: The paper diagnoses two failure points in existing textual gradient pipelines — how the gradient is extracted and how gradients are aggregated — and proposes a framework, AgentGrad, that resolves them via sequential intervention and semantic textual gradient abstraction, evaluated on five MAS benchmarks with two backbones.
What This Paper Is About
Multi-agent systems built from LLMs solve hard tasks by splitting them among specialized agents, but each agent's behavior is controlled by its prompt, so system performance hinges on prompt design. Existing "textual gradient" methods try to improve those prompts automatically using natural-language feedback, yet they pick which agent's prompt to edit without checking whether that edit will actually fix the failure, and they derive feedback without any supervision on the intermediate agent output that went wrong. AgentGrad's goal is to make both steps accountable: verify which agent's correction repairs a failure, extract a localized gradient from the corrected behavior, and aggregate gradients by shared corrective pattern rather than by random grouping.
Key Contributions
-
A framework addressing both failure points. AgentGrad is a prompt optimization framework for MAS that targets limitations in the two stages of existing textual gradient approaches — gradient extraction and gradient aggregation.
-
Sequential intervention for target identification and supervision. Applying interventions (for example, hint injection) to one agent at a time, in reverse execution order, identifies the target agent whose modification resolves a system-level failure and simultaneously produces an agent-level pseudo-label that supplies fine-grained supervision for gradient extraction.
-
Semantic textual gradient abstraction. Sample-level gradients are grouped into semantic minibatches that share a corrective pattern, and each cluster is abstracted into a single generalized textual gradient intended to generalize better than random concatenation.
-
State-of-the-art results and efficiency. Across five MAS benchmarks and two backbones, AgentGrad reports the best performance among the compared methods and reduces wall-clock optimization time by 2.5× on average over the next-fastest baseline.
Main Findings
-
GPT-5-mini results: AgentGrad leads on every reported benchmark — HotpotQA 73.89 (±1.09) versus 68.33 (±1.55) for GEPA; HoVer 64.78 (±1.44); PUPA 95.17 (±0.49) versus 91.87 (±1.55) for GEPA; IFBench 76.08 (±0.45); MATH 87.62 (±0.09) — for an average improvement of +11.76 points over the no-optimization baseline. MIPROv2 averaged +5.66, TextGrad +6.33, and GEPA +9.24 in this setting.
-
Qwen3-8B results: AgentGrad reports the largest average improvement of +9.67 points over the no-optimization baseline, ahead of GEPA (+7.62), MIPROv2 (+6.27), and TextGrad (+6.06). Scores were HotpotQA 60.45 (±1.68), HoVer 52.11 (±1.66), PUPA 91.51 (±0.72), IFBench 41.42 (±0.99), and MATH 85.81 (±0.25).
-
An unremarked detail in Table 2: On the Qwen3-8B IFBench setting, TextGrad's reported score of 42.52 (±0.45) is higher than AgentGrad's 41.42 (±0.99) and higher than the no-optimization baseline of 40.82 (±1.99), even though AgentGrad has the best average improvement. The paper does not comment on this individual benchmark.
-
Ablation on HotpotQA and PUPA (GPT-5-mini): All three components contribute. Target identification (TI) alone yields +1.44 and +3.84 points; adding agent-level supervision (AS) adds +1.56 and +2.65; semantic textual gradient abstraction (STGA) on top of TI contributes +2.56 and +3.55. The full model reaches 73.89 and 95.17.
-
Sample efficiency: On HotpotQA, AgentGrad reaches approximately 70% by 1,000 rollouts, while GEPA requires over 6,000 rollouts to approach a comparable level, and MIPROv2 and TextGrad plateau below that threshold.
-
Wall-clock speed: AgentGrad is fastest on all five benchmarks with GPT-5-mini — 109, 244, 151, 90, and 88 minutes — for a 136-minute average, 2.5× faster than GEPA (337-minute average, next-fastest) and 4.7× faster than TextGrad (647-minute average). Speedups over the next-best baseline were 3.2× (HotpotQA), 1.6× (HoVer), 2.0× (PUPA), 3.0× (IFBench), and 1.4× (MATH).
-
Update acceptance rates: Averaged over HotpotQA and PUPA, AgentGrad's minibatch improvement ratio is 0.72 versus 0.44 (TextGrad) and 0.28 (GEPA), and its validation improvement ratio is 0.27 versus 0.21 and 0.14. In the ablation, TI and AS raise the minibatch ratio from 0.51 to 0.87, while STGA trades a modest minibatch ratio reduction for a gain in validation ratio.
-
Prompt transfer: Prompts optimized on one benchmark transfer best on the paired unseen benchmark — HotpotQA to 2WikiMultiHopQA (51.22 versus 44.89 for GEPA), HoVer to EX-FEVER (33.11), PUPA to PUPA-TNB (94.38 versus 91.51), IFBench to IFEval (95.00), and MATH to OlympiadBench (68.33) — without any further optimization.
-
Qualitative example: In a privacy redaction task, the target agent leaked identifiers such as PTV News, Warsaw, Poland, and Mishaali Kapoor; intervention produced corrected outputs using placeholders, and AgentGrad abstracted gradients from in-cluster samples into a generalized redaction policy while excluding an out-of-cluster example with a different corrective signal.
Methodology in Plain English
The pipeline runs in repeated rounds until a rollout budget is exhausted. Each round starts by running the current multi-agent system on the training set and collecting every failed example. To decide which agent to fix, AgentGrad intervenes on one agent at a time, in reverse execution order, by appending a hint to that agent's prompt and checking whether the whole system now produces the correct answer. Because failures were observed to concentrate in later agents, working backward reduces the expected number of interventions. Failures the hint repairs are attributed to that agent and removed from the unresolved pool; anything still unresolved after reaching the first agent is treated as a hard case for that round, but is revisited next round because the failure set is rebuilt from scratch each time. The hint can be built from the ground-truth answer, from constraints the final output must satisfy, or from auxiliary context such as dataset, system, and agent-role descriptions — and it is used only during optimization, never at inference.
Once the target agent for a failure is known, AgentGrad compares that agent's original output with its intervention-adjusted output under the same input. Because the input context is identical, the difference isolates what the intervention changed, so the corrected output acts as an agent-level pseudo-label. A gradient extractor LLM turns the pair into a sample-level textual gradient, avoiding any need for an explicit loss function.
Instead of grouping these gradients randomly, an aggregator LLM clusters semantically similar ones into semantic minibatches and summarizes each cluster into one generalized gradient that captures the shared corrective pattern. Cluster size controls how general the resulting correction is, and a soft lower bound on cluster size follows a cyclic schedule (5 → 3 → 1 → 5 → …) so the aggregator alternates between broad patterns and finer corrections; the bound is a recommendation, not a hard rule. Prompts are then updated in decreasing order of minibatch size. Each candidate prompt must first improve performance on its own semantic minibatch, and only then must it improve on the held-out validation set; otherwise it is discarded.
Evaluation used five benchmarks — HotpotQA, HoVer, IFBench, PUPA, and MATH — with GPT-5-mini and Qwen3-8B, where the same backbone served as both the task LLM and all optimizer components. Baselines were MIPROv2, TextGrad, GEPA, and a no-optimization baseline; results are means ± standard error over three random seeds. Multi-agent systems, data splits, and reward functions were adopted from prior work for HotpotQA, HoVer, PUPA, and IFBench, and from a separate source for MATH.
Why This Matters
The paper reframes failure attribution in multi-agent systems from a diagnostic activity into an optimization signal. Rather than treating a failed trajectory as a system-level loss, it uses the corrected behavior revealed by intervention as localized supervision for the specific agent that needs to change. If the reported gains hold, this suggests that where a gradient is applied matters as much as what the gradient says, and that efficiency and quality in prompt optimization need not trade off. The work also connects two previously separate literatures — intervention-driven multi-agent debugging and textual gradient prompt optimization — and shows agent prompts optimized on one benchmark remain strongest on unseen benchmarks in the same task domain.
Real-world applications:
- Privacy-conscious delegation: The qualitative example shows an agent rewriting user queries to replace sensitive identifiers with placeholders, directly relevant to systems that must redact personal or organizational information before passing it downstream.
- Retrieval and knowledge workflows: Multi-hop QA and claim verification results (HotpotQA, HoVer) map onto pipelines that gather evidence, verify claims, and synthesize answers for research or fact-checking tooling.
- Instruction-following and compliance: Gains on IFBench and IFEval correspond to systems that must honor explicit formatting and behavioral constraints, such as regulated customer-facing assistants.
- Tool-using and math agents: Results on MATH and OlympiadBench point to agent stacks used in tutoring, quantitative analysis, and step-by-step problem solving.
Industry relevance: the wall-clock numbers matter for practitioners, since prompt optimization is typically constrained by rollout and compute budgets. AgentGrad's reported 136-minute average on GPT-5-mini, versus 337 minutes for GEPA and 647 for TextGrad, means optimization can fit into routine development cycles rather than being a one-off expense. Because the hint is only used at training time, the deployed system carries no extra inference cost, and the method applies to a proprietary backbone (GPT-5-mini) as well as an open-source one (Qwen3-8B) using the same model for task execution and optimization components.
Future Directions
- Reducing reliance on hints: How much of the benefit depends on hint quality and on access to ground-truth answers or output constraints? A systematic study of weaker or noisier hints would clarify how far the approach extends to unlabeled settings.
- Hard cases and the remaining gradient signal: Failures unsolved even with hint guidance are excluded from the current round and revisited later. Whether these cases can be handled explicitly (for example, by multi-agent or cross-agent corrections) is left open.
- Better attribution when no single agent suffices: Sequential intervention assumes some single agent's correction resolves the failure. Failures caused jointly by several agents need an extension beyond one-at-a-time intervention.
- Clustering and abstraction policy: The aggregator LLM decides the number of clusters and the soft cluster-size lower bound follows a hand-set cyclic schedule (5 → 3 → 1 → 5). Learning or adapting that schedule, and understanding when STGA's reduction in minibatch improvement ratio is worth the validation gain, remain open questions.
Target Audience
Researchers and engineers working on LLM agent systems, automatic prompt optimization, and multi-agent failure attribution, particularly those who already know textual gradient methods such as TextGrad and GEPA and want finer-grained, cheaper update signals. It is also useful for practitioners running multi-agent pipelines under rollout or compute budgets who need to know which agent's prompt to fix, and for anyone studying self-generated supervision as an alternative to human annotation.
Authors’ abstract
Large language model (LLM)-based multi-agent systems (MAS) achieve strong performance by employing specialized multiple agents, yet their performance depends on the prompt design of each agent. For MAS prompt optimization, textual gradient methods that guide prompt updates using natural-language feedback have emerged as a leading paradigm. In this paper, we identify limitations in two stages of existing textual gradient approaches: gradient extraction and gradient aggregation. In gradient extraction, previous works select a target prompt without verifying whether modifying it resolves the failure, and derive gradients without agent-level supervision over the corresponding agent's intermediate output. In gradient aggregation, individual gradients are randomly grouped and concatenated, often mixing unrelated failure modes and producing prompts that fail to generalize. To address these limitations, we propose \textbf{AgentGrad}, a prompt optimization framework for multi-agent systems based on sequential intervention and semantic textual gradient abstraction. For each failure, sequential intervention modifies the behavior of one agent at a time to identify the target agent whose modification resolves the failure. The modified output of the target agent then serves as agent-level supervision for extracting a fine-grained gradient. Semantic textual gradient abstraction clusters semantically similar gradients to prevent mixing unrelated failure modes, and abstracts each cluster into a generalized gradient that captures the shared corrective pattern. Experimental results show that AgentGrad achieves state-of-the-art performance across five MAS benchmarks and reduces wall-clock optimization time by $2.5\times$ on average compared to the next-fastest baseline.