Less Is More: Adaptive Program Repair with Bug Localization and Preference Learning
Zhenlong Dai, Bingrui Chen, Zhuoluo Zhao, Xiu Tang, Sai Wu, Chang Yao, Zhipeng Gao, Jingyuan Chen
Abstract
Automated Program Repair (APR) is a task to automatically generate patches for the buggy code. However, most research focuses on generating correct patches while ignoring the consistency between the fixed code and the original buggy code. How to conduct adaptive bug fixing and generate patches with minimal modifications have seldom been investigated. To bridge this gap, we first introduce a novel task, namely AdaPR (Adaptive Program Repair). We then propose a two-stage approach AdaP atcher (Adaptive Patch Generator) to enhance program repair while maintaining the consistency. In the first stage, we utilize a Bug Locator with self-debug learning to accurately pinpoint bug locations. In the second stage, we train a Program Modifier to ensure consistency between the post-modified fixed code and the premodified buggy code. The Program Modifier is enhanced with a location-aware repair learning strategy to generate patches based on identified buggy lines, a hybrid training strategy for selective reference and an adaptive preference learning to prioritize fewer changes. The experimental results show that our approach outperforms a set of baselines by a large margin, validating the effectiveness of our two-stage framework for the newly proposed AdaPR task. The code and dataset are available at https://github.com/zhenlongDai/ AdaPatcher.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 9ba08f6c-8790-4808-9df6-4b8377201008Cited by top-tier papers5
- Embracing Imperfection: Simulating Students with Diverse Cognitive Levels Using LLM-based AgentsTao Wu, Jingyuan Chen, Wang Lin, Mengze Li et al.ACL 2025 · 16 citations
- Learning from Long-Term Engagement: Adaptive Tutoring Dialogue Planning for Personalized EducationZhiang Dong, Zhenlong Dai, Xiangwei Lv, Jingyuan ChenAAAI 2026
- Automating Just-In-Time Python Type Annotation UpdatingZhipeng Xue, Zhipeng Gao, Xing Hu, Jingyuan Chen et al.ICSE 2026
- Learner-Tailored Program Repair: A Solution Generator with Iterative Edit-Driven Retrieval EnhancementZhenlong Dai, Zhuoluo Zhao, Hengning Wang, Xiu Tang et al.AAAI 2026
- Actionable Warning Is Not Enough: Recommending Valid Actionable Warnings with Weak SupervisionZhipeng Xue, Zhipeng Gao, Tongtong Xu, Xing Hu et al.ICSE 2026
Builds on15
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
- LoRA: Low-Rank Adaptation of Large Language ModelsEdward J. Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu et al.ICLR 2022 · 18,833 citations
- Direct Preference Optimization: Your Language Model is Secretly a Reward ModelRafael Rafailov, Archit Sharma, Eric Mitchell, Christopher D. Manning et al.NeurIPS 2023 · 10,924 citations
- Large Language Models are Zero-Shot ReasonersTakeshi Kojima, Shixiang Shane Gu, Machel Reid, Yutaka Matsuo et al.NeurIPS 2022 · 8,168 citations
- Self-Refine: Iterative Refinement with Self-FeedbackAman Madaan, Niket Tandon, Prakhar Gupta, Skyler Hallinan et al.NeurIPS 2023 · 4,972 citations
Related papers
- Fault localization to detect co-change fixing locationsYi Li, Shaohua Wang, Tien N. NguyenFSE 2022 · 25 citations
- DLFix: context-based code transformation learning for automated program repairYi Li, Shaohua Wang, Tien N. NguyenICSE 2020 · 201 citations
- One Size Does Not Fit All: Multi-granularity Patch Generation for Better Automated Program RepairBo Lin, Shangwen Wang, Ming Wen, Liqian Chen et al.ISSTA 2024 · 10 citations
- Practical Program Repair via Preference-based Ensemble StrategyWenkang Zhong, Chuanyi Li, Kui Liu, Tongtong Xu et al.ICSE 2024 · 8 citations
- A Bayesian Framework for Automated DebuggingSungmin Kang, Wonkeun Choi, Shin YooISSTA 2023 · 1 citation
