HyperAIHyperAI

Command Palette

Search for a command to run...

LLM
Agent

AgentGrad : Optimisation des invites guidée par intervention pour les systèmes multi-agents

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

Résumé

Les systèmes multi-agents (SMA) basés sur les grands modèles de langage (LLM) atteignent des performances élevées en utilisant plusieurs agents spécialisés, mais leurs performances dépendent de la conception des invites de chaque agent. Pour l'optimisation des invites des SMA, les méthodes de gradient textuel, qui guident les mises à jour des invites à l'aide de retours en langage naturel, se sont imposées comme un paradigme de premier plan. Dans cet article, nous identifions des limites dans deux étapes des approches existantes de gradient textuel : l'extraction du gradient et l'agrégation du gradient. Lors de l'extraction du gradient, les travaux antérieurs sélectionnent une invite cible sans vérifier si sa modification résout l'échec, et dérivent les gradients sans supervision au niveau de l'agent sur la sortie intermédiaire de l'agent correspondant. Lors de l'agrégation du gradient, les gradients individuels sont regroupés et concaténés de manière aléatoire, mélangeant souvent des modes de défaillance sans rapport et produisant des invites qui ne parviennent pas à généraliser. Pour remédier à ces limites, nous proposons AgentGrad, un cadre d'optimisation des invites pour les systèmes multi-agents basé sur l'intervention séquentielle et l'abstraction sémantique de gradient textuel. Pour chaque échec, l'intervention séquentielle modifie le comportement d'un agent à la fois afin d'identifier l'agent cible dont la modification résout l'échec. La sortie modifiée de l'agent cible sert ensuite de supervision au niveau de l'agent pour extraire un gradient à grain fin. L'abstraction sémantique de gradient textuel regroupe les gradients sémantiquement similaires pour éviter de mélanger des modes de défaillance sans rapport, et abstrait chaque groupe en un gradient généralisé qui capture le motif correctif partagé. Les résultats expérimentaux montrent qu'AgentGrad atteint des performances de pointe sur cinq bancs d'essai de SMA et réduit le temps d'optimisation horloge de 2,5× en moyenne par rapport à la référence la plus rapide suivante.

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+1r(Π(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+1r(Π(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.


Créer de l'IA avec l'IA

De l'idée au lancement — accélérez votre développement IA avec le co-codage IA gratuit, un environnement prêt à l'emploi et le meilleur prix pour les GPU.

Codage assisté par IA
GPU prêts à l’emploi
Tarifs les plus avantageux

HyperAI Newsletters

Abonnez-vous à nos dernières mises à jour
Nous vous enverrons les dernières mises à jour de la semaine dans votre boîte de réception à neuf heures chaque lundi matin
Propulsé par MailChimp