Search papers, labs, and topics across Lattice.
This paper introduces RETRACE, a novel post-generation verification framework for coding agents that independently assesses the correctness of generated code patches. By employing a bidirectional reconstruction approach, RETRACE not only builds a rationale for the patch based on the original issue but also infers the problem from the patch itself, allowing for a comprehensive alignment check. The framework significantly improves patch verification accuracy, achieving a 7.0% increase in Pass@1 on SWE-bench Verified with GPT-5-mini and 3.6% with MiniMax-2.5, demonstrating its effectiveness in enhancing coding agent reliability.
RETRACE achieves a 7% boost in patch verification accuracy by independently reconstructing and reconciling the problem and solution, ensuring coding agents generate reliable fixes.
Autonomous coding agents powered by large language models can now generate code patches directly from bug reports, but a fundamental gap remains: once a patch is produced, no mechanism independently verifies whether it truly resolves the reported problem. Prior work has sought to address this through iterative self-refinement and inference-time scaling, but these approaches either review the patch under the same interpretation that produced it or broaden candidate generation without verifying individual patches, and neither provides an explicit verification signal for assessing patch correctness. We propose RETRACE, a training-free post-generation verification framework that derives such a signal through bidirectional reconstruction and reconciliation. When a coding agent generates a candidate patch for an issue, RETRACE performs forward reconstruction to build an explicit repair rationale from the issue and the agent's trajectory; backward reconstruction then independently infers, from the patch and its trajectory alone and without access to the original issue, a description of the problem the patch appears to address, and compares this reconstruction against the original issue to produce an alignment verdict; a reconciliation stage then checks the consistency between the forward rationale and the patch, diagnoses the source of any misalignment, and either submits the patch or produces targeted revision guidance. Evaluated on SWE-bench Verified with two backbones (GPT-5-mini and MiniMax-2.5), RETRACE lifts Pass@1 by 7.0% and 3.6% respectively on the mini-SWE-agent scaffold, and delivers comparable gains on OpenHands without modification. Ablation experiments show that both the forward and backward stages contribute to the overall improvement and that adding reconciliation yields further gains.