Aligning the Objective of LLM-based Program Repair
Not on the map. Why?
Abstract (arXiv)
Large language models (LLMs) have achieved decent results on automated program repair (APR). However, the next token prediction training objective of decoder-only LLMs (e.g., GPT-4) is misaligned with the masked span prediction objective of current infilling-style methods, which impedes LLMs from fully leveraging pre-trained knowledge for program repair. In addition, while some LLMs can locate and repair bugs in certain functions using the related artifacts (e.g., test cases), existing methods still depend on statement-level fault localization methods to provide a list of buggy hunks for repair. This restriction hinders LLMs from exploring potential patches beyond the given locations. In this paper, we investigate a new approach to adapt LLMs to program repair. Our core insight is that LLM's APR capability can be greatly improved by simply aligning the output to their training objective and allowing them to refine the whole program without first identifying faulty statements. Based on this insight, we designed D4C, a straightforward prompting framework for APR. D4C can repair 180 bugs correctly in Defects4J, with each patch being sampled only 10 times. This surpasses the SOTA APR methods with perfect fault localization by 10% and reduces the patch sampling number by 90%. Our findings reveal that (1) objective alignment is crucial for fully exploiting LLM's pre-trained capability, and (2) replacing the traditional localize-buggy-hunks-then-repair workflow with direct debugging is more effective for LLM-based APR methods. Thus, we believe this paper introduces a new mindset for harnessing LLMs in APR.
Key facts. Cited by 12 papers in the map (data through 7 Oct 2026). Builds on 37 of its 76 references that are in the map. First posted on arXiv 13 Apr 2024.
Builds on
37 of 76 references.
References · 37
- 2017Attention Is All You Needcited by 59,932
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2023GPT-4 Technical Reportcited by 18,132
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 13,958
- 2022Self-Consistency Improves Chain of Thought Reasoning in Language Modelscited by 5,601
- 2014Sequence to Sequence Learning with Neural Networkscited by 2,974
- 2023Sparks of Artificial General Intelligence: Early experiments with GPT-4cited by 2,579
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
- 2023Teaching Large Language Models to Self-Debugcited by 963
- 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 890
25 more
- 2022InCoder: A Generative Model for Code Infilling and Synthesiscited by 492
- 2018SequenceR: Sequence-to-Sequence Learning for End-to-End Program Repaircited by 144
- 2022Practical Program Repair in the Era of Large Pre-trained Language Modelscited by 133
- 2021Adapting Language Models for Zero-shot Learning by Meta-tuning on Dataset and Prompt Collectionscited by 128
- 2023InferFix: End-to-End Program Repair with LLMscited by 113
- 2021CURE: Code-Aware Neural Machine Translation for Automatic Program Repaircited by 85
- 2023Impact of Code Language Models on Automated Program Repaircited by 85
- 2022Less Training, More Repairing Please: Revisiting Automated Program Repair via Zero-shot Learningcited by 76
- 2024DebugBench: Evaluating Debugging Capability of Large Language Modelscited by 74
- 2022Automated Repair of Programs from Large Language Modelscited by 71
- 2022Repair Is Nearly Generation: Multilingual Program Repair with LLMscited by 68
- 2019TBar: Revisiting Template-based Automated Program Repaircited by 64
- 2021A Syntax-Guided Edit Decoder for Neural Program Repaircited by 57
- 2023A Survey of Learning-based Automated Program Repaircited by 55
- 2023Copiloting the Copilots: Fusing Large Language Models with Completion Engines for Automated Program Repaircited by 55
- 2021Neural Program Repair with Execution-based Backpropagationcited by 50
- 2023RAP-Gen: Retrieval-Augmented Patch Generation with CodeT5 for Automatic Program Repaircited by 43
- 2023Conversational Automated Program Repaircited by 41
- 2022SelfAPR: Self-supervised Program Repair with Test Execution Diagnosticscited by 33
- 2018Nopol: Automatic Repair of Conditional Statement Bugs in Java Programscited by 32
- 2023Better patching using LLM prompting, via Self-Consistencycited by 29
- 2017ARJA: Automated Repair of Java Programs via Multi-Objective Genetic Programmingcited by 26
- 2018Automatic Software Repair: a Bibliographycited by 24
- 2024A Spectrum Evaluation Benchmark for Medical Multi-Modal Large Language Modelscited by 16
- 2018You Cannot Fix What You Cannot Find! An Investigation of Fault Localization Bias in Benchmarking Automated Program Repair Systemscited by 13
Built on by
Citing papers per year: 2025: 5; 2026: 7.
12 papers.
- 2025Repo2Run: Automated Building Executable Environment for Code Repository at Scalecited by 39
- 2025Seeing is Fixing: Cross-Modal Reasoning with Multimodal LLMs for Visual Software Issue Fixingcited by 11
- 2026TraceCoder: A Trace-Driven Multi-Agent Framework for Automated Debugging of LLM-Generated Codecited by 6
- 2025DynaFix: Iterative Automated Program Repair Driven by Execution-Level Dynamic Informationcited by 3
- 2026FailureMem: A Failure-Aware Multimodal Framework for Autonomous Software Repaircited by 2
- 2025From Empirical Evaluation to Context-Aware Enhancement: Repairing Regression Errors with LLMscited by 1
- 2025Collaborative Agents for Automated Program Repair in Rubycited by 1
- 2026QiMeng-PRepair: Precise Code Repair via Edit-Aware Reward Optimizationcited by 1
- 2026REFLEX: Reflective Evolution from LLM Experiencecited by 1
- 2026Coding in a Bubble? Evaluating LLMs in Resolving Context Adaptation Bugs During Code Adaptationcited by 0
- 2026AdaptAgent: A Multi-agent, Domain-Guided Reasoning Framework for Code Adaptationcited by 0
- 2026Does Fault Localization Beat a Fresh Attempt? A Placebo-Controlled Study of Test-Guided Code Repaircited by 0
- 2026Does Fault Localization Beat a Fresh Attempt? A Placebo-Controlled Study of Test-Guided Code Repair1 Sep 2026
- 2026AdaptAgent: A Multi-agent, Domain-Guided Reasoning Framework for Code Adaptation5 Aug 2026
- 2026REFLEX: Reflective Evolution from LLM Experience15 Jun 2026
- 2026QiMeng-PRepair: Precise Code Repair via Edit-Aware Reward Optimization7 Apr 2026
- 2026FailureMem: A Failure-Aware Multimodal Framework for Autonomous Software Repair18 Mar 2026
- 2026TraceCoder: A Trace-Driven Multi-Agent Framework for Automated Debugging of LLM-Generated Code6 Feb 2026
- 2026Coding in a Bubble? Evaluating LLMs in Resolving Context Adaptation Bugs During Code Adaptation10 Jan 2026
- 2025DynaFix: Iterative Automated Program Repair Driven by Execution-Level Dynamic Information31 Dec 2025
- 2025Collaborative Agents for Automated Program Repair in Ruby6 Nov 2025
- 2025Seeing is Fixing: Cross-Modal Reasoning with Multimodal LLMs for Visual Software Issue Fixing19 Jun 2025
- 2025From Empirical Evaluation to Context-Aware Enhancement: Repairing Regression Errors with LLMs16 Jun 2025
- 2025Repo2Run: Automated Building Executable Environment for Code Repository at Scale19 Feb 2025
Similar, not cited
Close in wording, no citation either way
- 2025Unlocking LLM Repair Capabilities Through Cross-Language Translation and Multi-Agent Refinement
- 2025The Art of Repair: Optimizing Iterative Program Repair with Instruction-Tuned Models
- 2025Enhancing Automated Program Repair via Faulty Token Localization and Quality-Aware Patch Refinement ↗
- 2026Refine After Generation: Toward Correct and Concise Patches in LLM-based Program Repair
- 2025Large Language Models for Fault Localization: An Empirical Study ↗
- 2024MORepair: Teaching LLMs to Repair Code via Multi-Objective Fine-tuning
- 2026Rethinking Automated Program Repair: The Impact of Bug Complexity, Fault Localization, and LLM Cost-efficiency
- 2025Automated Repair of C Programs Using Large Language Models