CausalFlow: Causal Attribution and Counterfactual Repair for LLM Agent Failures
On the map: LLM agents and tool use → Software engineering coding agents
Abstract (arXiv)
Large language model (LLM) agents frequently fail on multi-step tasks involving reasoning, tool use, and environment interaction. While such failures are typically logged or retried heuristically, they contain structured signals about where execution broke down. We introduce CausalFlow, an interventional framework that converts failed agent traces into minimal counterfactual repairs and reusable supervision. CausalFlow models execution traces as sequential chains of dependent steps and computes Causal Responsibility Scores(CRS) via step-level counterfactual intervention to identify failure-inducing steps. For these steps, we generate minimally edited repairs that flip the final outcome to success, producing validated contrastive pairs of the form (wrong step, corrected step). CausalFlow supports two complementary uses: targeted test-time repair that recovers from failures with minimal behavioral drift, and training-time supervision suitable for offline preference optimization or reward modeling. Across four benchmarks spanning mathematical reasoning, code generation, question answering, and medical browsing, CausalFlow converts failed executions into validated minimal repairs with high minimality and causal-consensus scores, and demonstrates that causal attribution is necessary for reliable improvement across diverse agent tasks, outperforming heuristic refinement in complex retrieval settings while producing more localized repairs throughout. These results demonstrate that interventional analysis over structured execution traces provides a principled and scalable mechanism for transforming agent failures into reliability gains and learning-ready supervision.
Key facts. Cited by 18 papers in the map (data through 14 Oct 2026). Placed in Software engineering coding agents, one of 16 directions in LLM agents and tool use. Builds on 32 of its 42 references that are in the map. First posted on arXiv 25 May 2026.
Builds on
32 of 42 references.
Closest ancestors · 3
Same direction, newest first
- 2025Which Agent Causes Task Failures and When? On Automated Failure Attribution of LLM Multi-Agent Systems30 Apr
- 2025Why Do Multi-Agent LLM Systems Fail?17 Mar
- 2024SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineering6 May
Other references · 29
- 2022Training language models to follow instructions with human feedbackcited by 15,971
- 2021Training Verifiers to Solve Math Word Problemscited by 10,109
- 2022ReAct: Synergizing Reasoning and Acting in Language Modelscited by 8,695
- 2023Direct Preference Optimization: Your Language Model is Secretly a Reward Modelcited by 8,065
- 2023Reflexion: Language Agents with Verbal Reinforcement Learningcited by 4,276
- 2023Let's Verify Step by Stepcited by 3,789
- 2021Program Synthesis with Large Language Modelscited by 3,637
- 2023Self-Refine: Iterative Refinement with Self-Feedbackcited by 3,442
- 2023Tree of Thoughts: Deliberate Problem Solving with Large Language Modelscited by 3,211
- 2022Locating and Editing Factual Associations in GPTcited by 2,691
- 2023Voyager: An Open-Ended Embodied Agent with Large Language Modelscited by 2,191
- 2023AgentBench: Evaluating LLMs as Agentscited by 1,267
17 more
- 2023Encouraging Divergent Thinking in Large Language Models through Multi-Agent Debatecited by 1,011
- 2022Mass-Editing Memory in a Transformercited by 1,001
- 2023Teaching Large Language Models to Self-Debugcited by 988
- 2023CRITIC: Large Language Models Can Self-Correct with Tool-Interactive Critiquingcited by 783
- 2024ORPO: Monolithic Preference Optimization without Reference Modelcited by 562
- 2023RRHF: Rank Responses to Align Language Models with Human Feedback without tearscited by 463
- 2023Causal Reasoning and Large Language Models: Opening a New Frontier for Causalitycited by 353
- 2023A Survey of Reinforcement Learning from Human Feedbackcited by 264
- 2023Causal Abstraction: A Theoretical Foundation for Mechanistic Interpretabilitycited by 205
- 2022Offline RL for Natural Language Generation with Implicit Language Q Learningcited by 138
- 2024StableToolBench: Towards Stable Large-Scale Benchmarking on Tool Learning of Large Language Modelscited by 132
- 2025SealQA: Raising the Bar for Reasoning in Search-Augmented Language Modelscited by 75
- 2025Unveiling Causal Reasoning in Large Language Models: Reality or Mirage?cited by 38
- 2025GraphTracer: Graph-Guided Failure Tracing in LLM Agents for Robust Multi-Turn Deep Searchcited by 23
- 2025Towards Safer Social Media Platforms: Scalable and Performant Few-Shot Harmful Content Moderation Using Large Language Modelscited by 5
- 2024NLP4Gov: A Comprehensive Library for Computational Policy Analysiscited by 4
- 2026STABLEVAL: Disagreement-Aware and Stable Evaluation of AI Systemscited by 3
Built on by
Citing papers per year: 2026: 18.
18 papers.
Sort:
By area:
- 2026MemTrace: Tracing and Attributing Errors in Large Language Model Memory Systemscited by 6
- 2026Graph Engineering in the Era of LLM Agents: From Individual Intelligence to System Intelligencecited by 3
- 2026Agent Hacks Agent: Autoresearch for Production-Agent Red-Teamingcited by 2
- 2026Cost-Utility Alignment in LLM Agent Trajectories:Profiling,Attribution,Diagnosis,Adaptation,and Evaluationcited by 2
- 2026What if LLMs Ate Their Words: Causal History Effects in Multi-Turn Interactioncited by 1
- 2026TwinCheck: Evidence-Grounded Negative-Twin Verification for Stateful Tool Agentscited by 1
- 2026DeFA: Dependency-Guided Failure Attribution for LLM Agentscited by 1
- 2026AUDITA: certified auditing and causal attribution of adverse outcomes in autonomous multi-agent systemscited by 0
- 2026Localizing Emergent Failures in Agentic AI: Recovering Minimal Repair Families via Counterfactual Replaycited by 0
- 2026Causal Attribution for Agentic Decisions: Estimators, Coupling, and a Traceability Specificationcited by 0
- 2026CausalLoss-Fin: Attributing Financial-Agent Loss to Decisions and Infrastructure Faultscited by 0
- 2026DAAF: From Failure Localization to Editable System Assets in LLM Agentscited by 0
6 more
- 2026The Right Lesson at the Right Step: Deriving Control Updates for Self-Evolving Agentscited by 0
- 2026Towards Reliable AI Data Scientists: Data Agents with Workflow Harnessescited by 0
- 2026EvoSteer: Online Self-Evolving Graph Orchestration via Reference-Anchored Credit Assignmentcited by 0
- 2026Where MLLMs Fail and Why: Causal Task Decomposition for Capability Failure Diagnosiscited by 0
- 2026When Harnesses Lose the Signal: Causal Evaluation of Recovery in LLM Agentscited by 0
- 2026Dream2Discern: Learning from Hard Latent Variants for Runtime Failure Prediction in Multi-Agent Systemscited by 0
- 2026Dream2Discern: Learning from Hard Latent Variants for Runtime Failure Prediction in Multi-Agent Systems12 Oct 2026
- 2026DeFA: Dependency-Guided Failure Attribution for LLM Agents1 Oct 2026
- 2026When Harnesses Lose the Signal: Causal Evaluation of Recovery in LLM Agents30 Sep 2026
- 2026Where MLLMs Fail and Why: Causal Task Decomposition for Capability Failure Diagnosis30 Sep 2026
- 2026EvoSteer: Online Self-Evolving Graph Orchestration via Reference-Anchored Credit Assignment29 Sep 2026
- 2026Towards Reliable AI Data Scientists: Data Agents with Workflow Harnesses28 Sep 2026
- 2026The Right Lesson at the Right Step: Deriving Control Updates for Self-Evolving Agents28 Sep 2026
- 2026DAAF: From Failure Localization to Editable System Assets in LLM Agents26 Sep 2026
- 2026TwinCheck: Evidence-Grounded Negative-Twin Verification for Stateful Tool Agents22 Sep 2026
- 2026CausalLoss-Fin: Attributing Financial-Agent Loss to Decisions and Infrastructure Faults22 Sep 2026
- 2026Causal Attribution for Agentic Decisions: Estimators, Coupling, and a Traceability Specification6 Sep 2026
- 2026What if LLMs Ate Their Words: Causal History Effects in Multi-Turn Interaction5 Sep 2026
6 more
- 2026Localizing Emergent Failures in Agentic AI: Recovering Minimal Repair Families via Counterfactual Replay29 Aug 2026
- 2026Cost-Utility Alignment in LLM Agent Trajectories:Profiling,Attribution,Diagnosis,Adaptation,and Evaluation25 Aug 2026
- 2026AUDITA: certified auditing and causal attribution of adverse outcomes in autonomous multi-agent systems23 Aug 2026
- 2026Graph Engineering in the Era of LLM Agents: From Individual Intelligence to System Intelligence21 Aug 2026
- 2026Agent Hacks Agent: Autoresearch for Production-Agent Red-Teaming13 Jul 2026
- 2026MemTrace: Tracing and Attributing Errors in Large Language Model Memory Systems27 May 2026
- 2026Graph Engineering in the Era of LLM Agents: From Individual Intelligence to System Intelligencecited by 3
- 2026Agent Hacks Agent: Autoresearch for Production-Agent Red-Teamingcited by 2
- 2026Cost-Utility Alignment in LLM Agent Trajectories:Profiling,Attribution,Diagnosis,Adaptation,and Evaluationcited by 2
- 2026TwinCheck: Evidence-Grounded Negative-Twin Verification for Stateful Tool Agentscited by 1
- 2026DeFA: Dependency-Guided Failure Attribution for LLM Agentscited by 1
- 2026Localizing Emergent Failures in Agentic AI: Recovering Minimal Repair Families via Counterfactual Replaycited by 0
- 2026Causal Attribution for Agentic Decisions: Estimators, Coupling, and a Traceability Specificationcited by 0
- 2026DAAF: From Failure Localization to Editable System Assets in LLM Agentscited by 0
- 2026Towards Reliable AI Data Scientists: Data Agents with Workflow Harnessescited by 0
- 2026EvoSteer: Online Self-Evolving Graph Orchestration via Reference-Anchored Credit Assignmentcited by 0
- 2026When Harnesses Lose the Signal: Causal Evaluation of Recovery in LLM Agentscited by 0
- 2026Dream2Discern: Learning from Hard Latent Variants for Runtime Failure Prediction in Multi-Agent Systemscited by 0
- 2026Dream2Discern: Learning from Hard Latent Variants for Runtime Failure Prediction in Multi-Agent Systems12 Oct 2026
- 2026DeFA: Dependency-Guided Failure Attribution for LLM Agents1 Oct 2026
- 2026When Harnesses Lose the Signal: Causal Evaluation of Recovery in LLM Agents30 Sep 2026
- 2026EvoSteer: Online Self-Evolving Graph Orchestration via Reference-Anchored Credit Assignment29 Sep 2026
- 2026Towards Reliable AI Data Scientists: Data Agents with Workflow Harnesses28 Sep 2026
- 2026DAAF: From Failure Localization to Editable System Assets in LLM Agents26 Sep 2026
- 2026TwinCheck: Evidence-Grounded Negative-Twin Verification for Stateful Tool Agents22 Sep 2026
- 2026Causal Attribution for Agentic Decisions: Estimators, Coupling, and a Traceability Specification6 Sep 2026
- 2026Localizing Emergent Failures in Agentic AI: Recovering Minimal Repair Families via Counterfactual Replay29 Aug 2026
- 2026Cost-Utility Alignment in LLM Agent Trajectories:Profiling,Attribution,Diagnosis,Adaptation,and Evaluation25 Aug 2026
- 2026Graph Engineering in the Era of LLM Agents: From Individual Intelligence to System Intelligence21 Aug 2026
- 2026Agent Hacks Agent: Autoresearch for Production-Agent Red-Teaming13 Jul 2026
- 2026What if LLMs Ate Their Words: Causal History Effects in Multi-Turn Interactioncited by 1
- 2026AUDITA: certified auditing and causal attribution of adverse outcomes in autonomous multi-agent systemscited by 0
- 2026CausalLoss-Fin: Attributing Financial-Agent Loss to Decisions and Infrastructure Faultscited by 0
- 2026The Right Lesson at the Right Step: Deriving Control Updates for Self-Evolving Agentscited by 0
- 2026Where MLLMs Fail and Why: Causal Task Decomposition for Capability Failure Diagnosiscited by 0
- 2026Where MLLMs Fail and Why: Causal Task Decomposition for Capability Failure Diagnosis30 Sep 2026
- 2026The Right Lesson at the Right Step: Deriving Control Updates for Self-Evolving Agents28 Sep 2026
- 2026CausalLoss-Fin: Attributing Financial-Agent Loss to Decisions and Infrastructure Faults22 Sep 2026
- 2026What if LLMs Ate Their Words: Causal History Effects in Multi-Turn Interaction5 Sep 2026
- 2026AUDITA: certified auditing and causal attribution of adverse outcomes in autonomous multi-agent systems23 Aug 2026
Similar, not cited
Close in wording, no citation either way
- 2026DCFA: Dual-view Causal-inspired Attribution for Failure Reasoning in LLM-based Multi-agent Systems
- 2026From Flat Logs to Causal Graphs: Hierarchical Failure Attribution for LLM-based Multi-Agent Systems
- 2026Causal Agent Replay: Counterfactual Attribution for LLM-Agent Failures
- 2026Repair or Resample? Rethinking Failure Debugging in LLM Multi-Agent Systems
- 2025Abduct, Act, Predict: Scaffolding Causal Inference for Automated Failure Attribution in Multi-Agent Systems
- 2026Seeing the Whole Elephant: A Benchmark for Failure Attribution in LLM-based Multi-Agent Systems
- 2025AgenTracer: Who Is Inducing Failure in the LLM Agentic Systems?
- 2025Toward Causal-Visual Programming: Enhancing Agentic Reasoning in Low-Code Environments