Seedlabs
Source research

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

Jiaqing Wu, Tong Wu, Manqing Zhang, Yunwei Dong, Bo Shen · 2026 · 11 citationsRead the paper

Automated Program Repair (APR) aims to resolve software bugs without human intervention. However, handling complex logic errors, especially silent failures that produce incorrect outputs without any explicit crash signals, remains a significant challenge. Current LLM-based APR approaches attempt to address this issue through conversational feedback, retrieval-augmented generation, or static analysis tools. However, these methods are fundamentally static, relying only on source code and basic test outputs, and thus struggle to capture complex runtime behaviors and dynamic data dependencies accurately. Inspired by human debugging practice, incorporating runtime evidence into APR provides direct access to program behavior through execution traces, which expose concrete state transitions and data dependencies. However, even with such runtime evidence, a single LLM interpreting it in isolation tends to commit to a specific repair hypothesis, leading to test overfitting and producing patches that satisfy the observed traces and test suite by coincidence rather than correct logic. This observation suggests that runtime evidence should not be treated merely as additional input, but as objective constraints that candidate patches must satisfy. Building on this insight, we propose TraceRepair, a multi-agent framework that leverages runtime facts as shared constraints for patch validation. A probe agent captures execution snapshots of critical variables, forming an objective basis for repair, while a committee of specialized agents cross-verifies candidate patches to expose inconsistencies and iteratively refine them. Evaluated on the Defects4J benchmark, TraceRepair substantially improves repair effectiveness, correctly fixing 392 defects and outperforming existing LLM-based approaches. Extensive experiments further demonstrate improved efficiency and strong generalization on a newly constructed dataset of recent bugs, suggesting that the performance gains arise from dynamic reasoning rather than memorization.

What the full text shows

Working prototype
  • TraceRepair (DeepSeek-V3.2) correctly resolved a total of 392 defects on Defects4J. — 392 correct fixes (Defects4J v1.2 and v2.0 under Perfect Fault Localization (PFL))
  • TraceRepair (GPT-3.5) outperformed most baselines, including those using GPT-4, while remaining slightly behind REINFIX (GPT-3.5). — 224 correct fixes vs 241 for REINFIX (GPT-3.5 backbone, PFL setting)
  • The framework uniquely fixed a significant number of defects missed by all other baselines. — 107 unique fixes (TraceRepair (DeepSeek-V3.2) compared to four representative baselines)
  • TraceRepair showed high robustness to degraded fault localization compared to static approaches. — 3.39% drop in performance (177 to 171 fixes) (Transition from PFL to Method-Level Fault Localization (MFL) on Defects4J v1.2 SF bugs)
  • The multi-agent debate mechanism provided a measurable increase in correct fixes over one-shot generation. — 20.2% improvement (66 additional fixes) (TraceRepair (DeepSeek-V3.2) on Defects4J v1.2 SF bugs)
  • TraceRepair demonstrated generalization to post-cutoff bugs on the Recent-Java benchmark. — 10/21 defects fixed (GPT-3.5) and 6/21 (DeepSeek-Coder) (Recent-Java benchmark (bugs from Sept 2023 to Dec 2025))
Setup
Evaluated on Defects4J v1.2, v2.0 (673 single-file bugs) and a custom Recent-Java dataset (21 bugs). Backbones used include DeepSeek-V3.2, GPT-3.5-Turbo, and DeepSeek-Coder.
How
The framework uses a Probe Agent to collect runtime execution traces via instrumentation, followed by a multi-agent debate (Defensive, Causal, and Semantic strategies) to iteratively refine patches. A Judge Agent then synthesizes the final patch based on the debate summaries and runtime observations.
Limitations
Instrumentation may fail, forcing the system to fall back to static reasoning. · Performance on post-cutoff bugs is limited by a small sample size (21 bugs) in the Recent-Java dataset.

Summarized by Gemma 4 from the open-access full text · 14 Nov 2026. Read it