Search papers, labs, and topics across Lattice.
This paper introduces CausalRepair, a novel framework that addresses the causality gap in Large Language Model (LLM)-based Automated Program Repair (APR) by utilizing a dual-slicing strategy. By combining context-aware static slicing and execution-trace-based dynamic slicing, CausalRepair effectively purifies test semantics and captures precise runtime dependencies, leading to more accurate identification of root causes in program failures. The evaluation on Defects4J demonstrates that CausalRepair successfully fixes 313 bugs, significantly outperforming existing methods while reducing repair costs to $0.029 per bug.
CausalRepair fixes 313 bugs with a cost of just $0.029 per bug, outpacing state-of-the-art APR methods by leveraging minimal causal context.
Automated Program Repair (APR) has recently benefited from Large Language Models (LLMs), yet their effectiveness heavily depends on repair context. Existing LLM-based APR methods suffer from a causality gap: test contexts can be noisy or incomplete, while source contexts derived from static analysis often contain irrelevant and unexecuted code, misleading LLMs from identifying the true root cause. To address this issue, we propose CausalRepair, a conversation-driven APR framework based on minimal causal context, i.e., the essential dependencies required to explain a failure. CausalRepair employs a dual-slicing strategy: context-aware static slicing purifies test semantics, while execution-trace-based dynamic slicing captures precise runtime dependencies in source code. Together, they construct compact, causally relevant contexts to guide iterative repair. We evaluate CausalRepair on Defects4J V1.2, V2.0, and Defects4J-Trans using DeepSeek-V3. CausalRepair correctly fixes 313 bugs on Defects4J, outperforming state-of-the-art approaches such as ReinFix and TSAPR, while reducing the average repair cost to $0.029 per bug.