Localizing Emergent Failures in Agentic AI: Recovering Minimal Repair Families via Counterfactual Replay
Organizations: School of Computer Science and Engineering, Northeastern University, Shenyang, China · Department of Computer Science, Aalborg University, Aalborg, Denmark · College of Computer Science and Technology, Zhejiang University, Hangzhou, China
Abstract
Failures in agentic AI systems can arise from interactions among messages exchanged by multiple large language model (LLM) agents. Pointwise attribution cannot distinguish a jointly necessary repair from alternative singleton repairs. We formulate Minimal Repair Family Recovery (MRFR): recovering all inclusion-minimal event sets whose counterfactual replay restores task success within a declared size bound. We propose Graph-Constrained Joint Replay (GCJR), which slices failure-relevant events from an execution dependency graph, constructs graph-feasible singleton and pair candidates, and verifies them by replay with paired clean counterparts. For fixed replay outcomes, GCJR is exact within its declared graph domain. On 90 in-scope cases from a 120-DAG controlled benchmark, GCJR achieves 1.000 Family Exact Match while reducing mean replay calls from 56.3 to 25.3 (55.1%) relative to exhaustive search. On a 24-case, four-agent LLM pilot, it again achieves 1.000 Family Exact Match and reduces mean model calls from 21.0 to 10.0 (52.4%); single-event replay misses jointly necessary repairs.
Figures & tables
| Statistic | Controlled-DAG | DualSolve-MAS |
|---|---|---|
| Cases | 120 | 24 |
| Schedules | 360 | – |
| Agents | 4 | 4 |
| Candidates | 6–14 | 3 |
| Families | S/J/A/SJ | S/J/A |
| Replay | Simulator | Qwen ( ) |
| Method | Family recovery | Replay efficiency | ||
|---|---|---|---|---|
| J FEM | Macro FEM | Calls | Matched saving | |
| Graph-blind exhaustive | 1.000 | 1.000 | 56.3 | 0.0% |
| Single-event replay | 0.000 | 0.667 | 10.7 | N/A |
| Execution-window replay | 0.100 | 0.700 | 14.4 | N/A |
| Exact Shapley top-2 | 1.000 | 0.333 | 3285.3 | N/A |
| Centrality top-2 | 0.033 | 0.011 | 0.0 | N/A |
| Method | Family recovery | LLM efficiency | ||
|---|---|---|---|---|
| J FEM | Macro FEM | Calls | Saving | |
| Exhaustive | 1.000 | 1.000 | 21.0 | 0.0% |
| Single-event | 0.000 | 0.667 | 12.0 | N/A |
| Execution-window | 0.000 | 0.667 | 13.0 | N/A |
| LLM log-only | 0.000 | 0.333 | 1.0 | N/A |
| GCJR (ours) | 1.000 | 1.000 | 10.0 | 52.4% |
Agent Failure Analysis
Agent failure analysis studies how and why AI agents make errors, traces causes through execution, and helps detect or prevent recurrence.
See all 154 papers