Enhancing Automated Program Repair via Faulty Token Localization and Quality-Aware Patch Refinement
Jiaolong Kong, Xiaofei Xie, Yiheng Xiong, Yuekun Wang, Jian Wang

TL;DR
TokenRepair introduces a two-level refinement framework that combines internal token-level analysis with external feedback to improve automated program repair, achieving state-of-the-art results on benchmark datasets.
Contribution
It presents a novel internal reflection method for localizing faulty tokens and integrates quality-aware external feedback for targeted patch refinement in APR.
Findings
Achieves 88 bugs fixed on Defects4J 1.2
Fixes 139 bugs on HumanEval-Java
Outperforms previous methods with 8.2%-34.9% improvements
Abstract
Large language models (LLMs) have recently demonstrated strong potential for automated program repair (APR). However, existing LLM-based techniques primarily rely on coarse-grained external feedback (e.g.,test results) to guide iterative patch generation, while lacking fine-grained internal signals that reveal why a patch fails or which parts of the generated code are likely incorrect. This limitation often leads to inefficient refinement, error propagation, and suboptimal repair performance. In this work, we propose TokenRepair, a novel two-level refinement framework that enhances APR by integrating internal reflection for localizing potentially faulty tokens with external feedback for quality-aware patch refinement. Specifically, TokenRepair first performs internal reflection by analyzing context-aware token-level uncertainty fluctuations to identify suspicious or low-confidence…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Testing and Debugging Techniques · Software Engineering Research · Security and Verification in Computing
