mlsanityData to 7 Oct 2026

Aligning the Objective of LLM-based Program Repair

arXiv 2404.08877 ↗First posted 13 Apr 2024cs.SE cs.CL cs.LGcited by 12

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

  1. 2017Attention Is All You Needcited by 59,932
  2. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
  3. 2020Language Models are Few-Shot Learnerscited by 32,199
  4. 2023GPT-4 Technical Reportcited by 18,132
  5. 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
  6. 2023LLaMA: Open and Efficient Foundation Language Modelscited by 13,958
  7. 2022Self-Consistency Improves Chain of Thought Reasoning in Language Modelscited by 5,601
  8. 2014Sequence to Sequence Learning with Neural Networkscited by 2,974
  9. 2023Sparks of Artificial General Intelligence: Early experiments with GPT-4cited by 2,579
  10. 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
  11. 2023Teaching Large Language Models to Self-Debugcited by 963
  12. 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 890
25 more
  1. 2022InCoder: A Generative Model for Code Infilling and Synthesiscited by 492
  2. 2018SequenceR: Sequence-to-Sequence Learning for End-to-End Program Repaircited by 144
  3. 2022Practical Program Repair in the Era of Large Pre-trained Language Modelscited by 133
  4. 2021Adapting Language Models for Zero-shot Learning by Meta-tuning on Dataset and Prompt Collectionscited by 128
  5. 2023InferFix: End-to-End Program Repair with LLMscited by 113
  6. 2021CURE: Code-Aware Neural Machine Translation for Automatic Program Repaircited by 85
  7. 2023Impact of Code Language Models on Automated Program Repaircited by 85
  8. 2022Less Training, More Repairing Please: Revisiting Automated Program Repair via Zero-shot Learningcited by 76
  9. 2024DebugBench: Evaluating Debugging Capability of Large Language Modelscited by 74
  10. 2022Automated Repair of Programs from Large Language Modelscited by 71
  11. 2022Repair Is Nearly Generation: Multilingual Program Repair with LLMscited by 68
  12. 2019TBar: Revisiting Template-based Automated Program Repaircited by 64
  13. 2021A Syntax-Guided Edit Decoder for Neural Program Repaircited by 57
  14. 2023A Survey of Learning-based Automated Program Repaircited by 55
  15. 2023Copiloting the Copilots: Fusing Large Language Models with Completion Engines for Automated Program Repaircited by 55
  16. 2021Neural Program Repair with Execution-based Backpropagationcited by 50
  17. 2023RAP-Gen: Retrieval-Augmented Patch Generation with CodeT5 for Automatic Program Repaircited by 43
  18. 2023Conversational Automated Program Repaircited by 41
  19. 2022SelfAPR: Self-supervised Program Repair with Test Execution Diagnosticscited by 33
  20. 2018Nopol: Automatic Repair of Conditional Statement Bugs in Java Programscited by 32
  21. 2023Better patching using LLM prompting, via Self-Consistencycited by 29
  22. 2017ARJA: Automated Repair of Java Programs via Multi-Objective Genetic Programmingcited by 26
  23. 2018Automatic Software Repair: a Bibliographycited by 24
  24. 2024A Spectrum Evaluation Benchmark for Medical Multi-Modal Large Language Modelscited by 16
  25. 2018You Cannot Fix What You Cannot Find! An Investigation of Fault Localization Bias in Benchmarking Automated Program Repair Systemscited by 13

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2025: 5; 2026: 7.

12 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2025Unlocking LLM Repair Capabilities Through Cross-Language Translation and Multi-Agent Refinement
  2. 2025The Art of Repair: Optimizing Iterative Program Repair with Instruction-Tuned Models
  3. 2025Enhancing Automated Program Repair via Faulty Token Localization and Quality-Aware Patch Refinement ↗
  4. 2026Refine After Generation: Toward Correct and Concise Patches in LLM-based Program Repair
  5. 2025Large Language Models for Fault Localization: An Empirical Study ↗
  6. 2024MORepair: Teaching LLMs to Repair Code via Multi-Objective Fine-tuning
  7. 2026Rethinking Automated Program Repair: The Impact of Bug Complexity, Fault Localization, and LLM Cost-efficiency
  8. 2025Automated Repair of C Programs Using Large Language Models