# From Guessing to Seeing: Enhancing LLM-Based Program Repair via Trace-Guided Multi-strategy Debate

arXiv: https://arxiv.org/abs/2604.02647 · HTML: https://mlsanity.com/paper/2604.02647/

## Key facts

- Cited by 6 papers in the map (data through 14 Oct 2026).
- First posted on arXiv 3 Apr 2026.

## Built on by (most cited first, 6 of 6)

- [Handoff Debt: The Rediscovery Cost When Coding Agents Take Over Interrupted Tasks](https://mlsanity.com/paper/2606.02875/) (2026)
- [Multi-Perspective Agentic Program Repair via Code Property Graphs and Temporal Execution Graphs](https://mlsanity.com/paper/2607.12605/) (2026)
- [AuditRepairBench: A Paired-Execution Trace Corpus for Evaluator-Channel Ranking Instability in Agent Repair](https://mlsanity.com/paper/2605.04624/) (2026)
- [Detecting Architectural Drift in Safety-Critical Firmware through Runtime Trace Analysis](https://mlsanity.com/paper/2607.03135/) (2026)
- [Reasoning from Traces: Divergence-Guided Agentic Repair of WebAssembly Discrepancies](https://mlsanity.com/paper/2608.05521/) (2026)
- [Better Understanding, Better Fixes? A Study of Hallucination in LLM-based Automated Program Repair](https://mlsanity.com/paper/2609.04909/) (2026)

## Abstract (arXiv)

Automated Program Repair (APR) aims to resolve software bugs without human intervention, but complex logic errors and silent failures remain challenging. Existing LLM-based APR methods mainly rely on source code and coarse test feedback, making it difficult to capture runtime behaviors and dynamic data dependencies. Execution traces expose concrete state transitions, yet a single LLM interpreting them in isolation may commit to an incorrect repair hypothesis and produce test-overfitting patches. We therefore treat runtime evidence as shared constraints for validating repair hypotheses rather than merely as additional prompt context. We propose TraceRepair, a multi-agent framework in which a Probe Agent captures execution snapshots of critical variables, while specialized repair agents generate, compare, and iteratively refine candidate patches against the observed runtime evidence. A Judge Agent then arbitrates the remaining hypotheses and synthesizes the final patch. Evaluated on Defects4J, TraceRepair correctly fixes 392 defects and outperforms existing LLM-based approaches. Further experiments demonstrate improved efficiency and strong generalization on a newly constructed dataset of recent bugs, suggesting that the gains arise from dynamic reasoning rather than memorization.
