HyperAIHyperAI

Command Palette

Search for a command to run...

AgentGrad: 다중 에이전트 시스템을 위한 개입 기반 프롬프트 최적화

Jaewon Chu Jinwoo Seo Jaewon Cho Jeehye Na Yunyang Xiong Youngdae Kim Hyunwoo J. Kim

초록

대규모 언어 모델(LLM) 기반 다중 에이전트 시스템(MAS)은 특화된 여러 에이전트를 활용하여 높은 성능을 달성하지만, 그 성능은 각 에이전트의 프롬프트 설계에 의존한다. MAS 프롬프트 최적화를 위해 자연어 피드백을 사용하여 프롬프트 업데이트를 안내하는 텍스트 기울기 방법이 주요 패러다임으로 부상했다. 본 논문에서는 기존 텍스트 기울기 접근법의 두 단계인 기울기 추출과 기울기 집계에서의 한계점을 규명한다. 기울기 추출 단계에서 기존 연구들은 대상 프롬프트를 수정하는 것이 실패를 해결하는지 검증하지 않고 선택하며, 해당 에이전트의 중간 출력에 대한 에이전트 수준의 지도 없이 기울기를 도출한다. 기울기 집계 단계에서는 개별 기울기가 무작위로 그룹화되고 연결되어 종종 관련 없는 실패 모드를 혼합하고 일반화에 실패하는 프롬프트를 생성한다. 이러한 한계를 해결하기 위해 우리는 순차적 개입과 의미적 텍스트 기울기 추상화에 기반한 다중 에이전트 시스템용 프롬프트 최적화 프레임워크인 AgentGrad를 제안한다. 각 실패에 대해 순차적 개입은 한 번에 한 에이전트의 동작을 수정하여 어떤 에이전트의 수정이 실패를 해결하는지 식별한다. 그런 다음 대상 에이전트의 수정된 출력은 세분화된 기울기를 추출하기 위한 에이전트 수준의 지도로 사용된다. 의미적 텍스트 기울기 추상화는 의미적으로 유사한 기울기를 군집화하여 관련 없는 실패 모드의 혼합을 방지하고, 각 군집을 공유된 교정 패턴을 포착하는 일반화된 기울기로 추상화한다. 실험 결과, AgentGrad는 다섯 개의 MAS 벤치마크에서 최첨단 성능을 달성했으며, 다음으로 빠른 기준선 대비 평균 2.5배의 실제 최적화 시간을 단축했다.

One-sentence Summary

Researchers from Korea University, KAIST, Meta AI, and UNIST propose AgentGrad, a prompt optimization framework for multi-agent systems that employs sequential intervention to pinpoint target agents and agent-level supervision to extract fine-grained gradients, then clusters and abstracts semantically similar gradients into generalized corrections, achieving state-of-the-art performance across five benchmarks and reducing optimization time by 2.5×2.5\times2.5× on average.

Key Contributions

  • AgentGrad introduces sequential intervention, which identifies the agent responsible for each failure by modifying one agent at a time and uses the corrected agent output as agent-level supervision to extract fine-grained textual gradients.
  • It proposes semantic textual gradient abstraction, which clusters sample-level gradients by semantic similarity to avoid mixing unrelated failure modes and abstracts each cluster into a generalized gradient that captures a shared corrective pattern.
  • Experiments across five multi-agent benchmarks show that AgentGrad achieves state-of-the-art performance with both GPT-5-mini and Qwen3-8B, outperforming MIPROv2, TextGrad, and GEPA, while reducing wall-clock optimization time by 2.5× on average over the next-fastest baseline.

Introduction

Multi-agent systems that coordinate multiple large language models are a powerful way to tackle complex tasks, but their effectiveness depends critically on prompt design. Automatic prompt optimization via textual gradients—natural-language critiques that guide prompt updates—has become a leading method. However, prior textual gradient approaches have systematic flaws: they select which agent prompt to update without verifying that the change can actually resolve a failure, and they aggregate sample-level gradients by simply concatenating them, mixing unrelated failure modes and producing prompts that generalize poorly. The authors propose AgentGrad, a framework that addresses both stages. It introduces sequential intervention to identify the specific agent responsible for a failure and generate an agent-level pseudo-label for fine-grained gradient extraction. It then uses semantic textual gradient abstraction to cluster gradients that share a corrective pattern into semantic minibatches and distill each cluster into a single generalized update. Across five benchmarks spanning question answering, verification, instruction following, delegation, and math reasoning, AgentGrad outperforms strong baselines and reduces wall-clock optimization time by 2.5× on average.

Method

The authors present AgentGrad, a prompt optimization framework for multi-agent systems that leverages sequential intervention and semantic textual gradient abstraction. The overall pipeline is designed to systematically identify failure points, extract fine-grained update signals, and generalize these signals to improve system performance.

To identify the specific prompts responsible for system failures, the authors employ a sequential intervention mechanism. Given a current prompt set P\mathcal{P}P comprising NNN agents and a set of failures F\mathcal{F}F from the training data, the framework modifies one agent at a time to verify whether its correction resolves the failure.

As shown in the figure below, the process begins with failure set construction, where the current prompt set is executed on the training data to obtain the initial failure set F\mathcal{F}F. The framework then applies sequential intervention in reverse execution order. At each step nnn, a hint H\mathcal{H}H is injected into the prompt of agent πn\pi^nπn to guide it toward a corrected intermediate output. The subset of failures resolved by this intervention is denoted as Tn\mathcal{T}^nTn, defined as:

Tn={(xi,yi)∈Fn+1∣r(Π(n,H)(xi;P),yi)=rmax⁡}\mathcal{T}^n = \left\{(x_i, y_i) \in \mathcal{F}^{n+1} \mid r\left(\Pi^{(n, \mathcal{H})}(x_i; \mathcal{P}), y_i\right) = r_{\max}\right\}Tn={(xi​,yi​)∈Fn+1∣r(Π(n,H)(xi​;P),yi​)=rmax​}

where Fn+1\mathcal{F}^{n+1}Fn+1 represents the failures still unresolved at step n+1n+1n+1. The resolved failures Tn\mathcal{T}^nTn are removed from the unresolved set, and the procedure proceeds to the next agent. Failures remaining after step n=1n=1n=1 are treated as hard cases and excluded from the current training round.

Once the target agent is identified for each failure, the authors extract textual gradients using agent-level supervision. For a target agent πn\pi^nπn and a failure sample (xi,yi)∈Tn(x_i, y_i) \in \mathcal{T}^n(xi​,yi​)∈Tn, the framework compares the original output y^in\hat{y}_i^ny^​in​ with the corrected output y~in\tilde{y}_i^ny~​in​ obtained via intervention:

y^in=πn(xin;pn),y~in=πn(xin;pn,H)\hat{y}_i^n = \pi^n(x_i^n; p^n), \quad \tilde{y}_i^n = \pi^n(x_i^n; p^n, \mathcal{H})y^​in​=πn(xin​;pn),y~​in​=πn(xin​;pn,H)

The difference between these outputs isolates the behavioral change induced by the intervention. The corrected output y~in\tilde{y}_i^ny~​in​ serves as an agent-level pseudo-label. A gradient extractor LLM then processes the current prompt, input context, original output, and pseudo-label to produce a sample-level textual gradient δin\delta_i^nδin​:

δin=LLM∇(pn,xin,y^in,y~in)\delta_i^n = \mathrm{LLM}_{\nabla}(p^n, x_i^n, \hat{y}_i^n, \tilde{y}_i^n)δin​=LLM∇​(pn,xin​,y^​in​,y~​in​)

This approach bypasses the need for an explicit system-level loss function by implicitly leveraging the contrast between the original and corrected outputs.

To ensure coherent update directions, the framework introduces semantic textual gradient abstraction. Instead of aggregating gradients from random minibatches, an aggregator LLM clusters the sample-level gradients Ωn={δin}\Omega^n = \{\delta_i^n\}Ωn={δin​} into semantic minibatches based on shared corrective patterns. The aggregator simultaneously performs clustering and abstraction, generating a generalized textual gradient δˉjn\bar{\delta}_j^nδˉjn​ for each cluster:

{δˉjn}j=1Mn=LLMAggregator(Ωn)\{\bar{\delta}_j^n\}_{j=1}^{M_n} = \mathrm{LLM}_{\text{Aggregator}}(\Omega^n){δˉjn​}j=1Mn​​=LLMAggregator​(Ωn)

The clustering process is guided by a cyclic schedule for the minimum cluster size, encouraging the model to alternate between broad, shared patterns and fine-grained corrections across optimization iterations.

Finally, the authors update the agent prompts using the generalized gradients. The updates are applied in decreasing order of semantic minibatch size, prioritizing broader corrections. A prompt optimizer LLM generates a candidate prompt pnewnp_{\text{new}}^npnewn​ based on the generalized gradient δˉjn\bar{\delta}_j^nδˉjn​ and the current prompt pnp^npn:

pnewn=LLMPromptOptimizer(pn,δˉjn)p_{\text{new}}^n = \mathrm{LLM}_{\text{PromptOptimizer}}(p^n, \bar{\delta}_j^n)pnewn​=LLMPromptOptimizer​(pn,δˉjn​)

Each candidate prompt is first evaluated on its corresponding semantic minibatch. If performance improves, it is subsequently evaluated on a held-out validation set. The update is accepted and replaces the current prompt only if it passes both evaluation stages.

Experiment

AgentGrad is evaluated against three prompt optimization algorithms and a no-optimization baseline across five diverse multi-agent benchmarks using two LLM backbones. It consistently achieves state-of-the-art performance, with ablation studies confirming that its three components—target identification, agent-level supervision, and semantic textual gradient abstraction—each contribute complementary gains. AgentGrad also optimizes faster than baselines due to higher-quality gradient signals that lead to more efficient rollout usage and better generalization, and its optimized prompts transfer effectively to unseen benchmarks within the same domain.

AgentGrad sets a new state of the art across five multi-agent benchmarks with GPT-5-mini, outperforming all baselines and achieving an average improvement of 11.76 points over the no-optimization baseline. The largest gains appear on HotpotQA and PUPA, while the method is also the fastest optimizer, completing runs 2.5× faster than the next-fastest baseline and 4.7× faster than TextGrad. These results demonstrate that AgentGrad jointly improves task performance and optimization efficiency. AgentGrad achieves the highest scores on every benchmark, with an average gain of 11.76 points over the no-optimization baseline, compared to 9.24 for the next-best method GEPA. The largest performance margins are on HotpotQA (73.89 vs. 68.33 for GEPA) and PUPA (95.17 vs. 91.87). AgentGrad is the fastest optimizer, finishing 2.5× faster than GEPA and 4.7× faster than TextGrad, while simultaneously delivering the best task performance.

AgentGrad with Qwen3-8B achieves the highest average improvement over the no-optimization baseline, gaining +9.67 points across five multi-agent benchmarks and outperforming all other prompt optimization methods. It ranks first on four of the five tasks, demonstrating consistent gains in multi-hop QA, claim verification, instruction following, and math reasoning with an open-source model. AgentGrad attains the best scores on HotpotQA (60.45), HoVer (52.11), PUPA (91.51), and MATH (85.81), while TextGrad edges ahead only on IFBench (42.52 vs. 41.42). The +9.67 point average improvement over the baseline is the largest among all compared methods, surpassing GEPA (+7.62) and MIPROv2 (+6.27).

An ablation study on HotpotQA and PUPA shows that each component of AgentGrad—target identification, agent-level supervision, and semantic textual gradient abstraction—improves performance over a vanilla baseline. The full combination yields the highest scores, confirming that the components address complementary aspects of prompt optimization. Adding target identification alone improves performance on both benchmarks, showing that identifying the responsible agent yields more effective gradients. Agent-level supervision and semantic textual gradient abstraction each provide further gains, and the full model combining all three achieves the best results.

AgentGrad is the fastest optimization method on all five benchmarks, averaging 136 minutes, which is 2.5 times faster than the next-best baseline GEPA and 4.7 times faster than TextGrad. The largest speedups appear on HotpotQA and IFBench, and AgentGrad remains faster even on MATH where TextGrad is relatively efficient. These wall-clock gains are achieved alongside the best task performance, showing that optimization quality and speed are jointly improved. AgentGrad records the lowest wall-clock time on every benchmark, with an average speedup of 2.5× over the next-fastest method. On HotpotQA and IFBench, AgentGrad finishes in under two hours while GEPA requires nearly six, yielding speedups of 3.2× and 3.0×. On MATH, AgentGrad completes in 88 minutes, outperforming TextGrad's 126 minutes despite TextGrad's unusual speed on that benchmark. AgentGrad's higher minibatch improvement ratio translates into more rollouts per unit time, and its higher validation improvement ratio ensures that accepted updates generalize more reliably.

Prompts optimized by AgentGrad transfer more effectively to unseen benchmarks within the same domain than those from all compared methods. On all five target benchmarks, AgentGrad achieves the highest mean performance, with the largest margins over the next-best method on 2WikiMultiHopQA and PUPA-TNB. This indicates that the prompts capture generalizable improvements rather than benchmark-specific patterns. AgentGrad's prompts achieve the highest transfer performance on every target benchmark, with margins of 6.33 points on 2WikiMultiHopQA and 2.87 points on PUPA-TNB over the next-best method. The transfer results show that AgentGrad's optimization yields prompts that remain effective without further tuning, outperforming GEPA, TextGrad, and MIPROv2 on all unseen benchmarks.

AgentGrad is evaluated across five multi-agent benchmarks using both GPT-5-mini and the open-source Qwen3-8B, where it sets new state-of-the-art results and achieves the largest average improvements over no-optimization baselines. The method is consistently the fastest optimizer, completing runs up to 4.7 times faster than alternatives while delivering top task performance. Ablation studies confirm that target identification, agent-level supervision, and semantic gradient abstraction each contribute complementary gains, and prompts optimized by AgentGrad transfer more effectively to unseen benchmarks, demonstrating generalizable improvements.


AI로 AI 구축

아이디어에서 출시까지 — 무료 AI 코코딩, 즉시 사용 가능한 환경, 최적의 GPU 가격으로 AI 개발을 가속화하세요.

AI 협업 코딩
바로 사용 가능한 GPU
최적의 가격

HyperAI Newsletters

최신 정보 구독하기
한국 시간 매주 월요일 오전 9시 에 이번 주의 최신 업데이트를 메일로 발송합니다
이메일 서비스 제공: MailChimp