mlsanityData to 14 Oct 2026

Accelerating Automatic Program Repair with Dual Retrieval-Augmented Fine-Tuning and Patch Generation on Large Language Models

arXiv 2507.10103 ↗First posted 14 Jul 2025cs.SE cs.CRcited by 1

On the map: Retrieval-augmented generation → RAG for code

Abstract (arXiv)

Automated Program Repair (APR) is essential for ensuring software reliability and quality while enhancing efficiency and reducing developers' workload. Although rule-based and learning-based APR methods have demonstrated their effectiveness, their performance was constrained by the defect type of repair, the quality of training data, and the size of model parameters. Recently, Large Language Models (LLMs) combined with Retrieval-Augmented-Generation (RAG) have been increasingly adopted in APR tasks. However, current code LLMs and RAG designs neither fully address code repair tasks nor consider code-specific features. To overcome these limitations, we propose SelRepair, a novel APR approach with integration of a fine-tuned LLM with a newly-designed dual RAG module. This approach uses a bug-fix pair dataset for fine-tuning and incorporates semantic and syntactic/structural similarity information through an RAG selection gate. This design ensures relevant information is retrieved efficiently, thereby reducing token length and inference time. Evaluations on Java datasets show SelRepair outperforms other APR methods, achieving 26.29% and 17.64% in terms of exact match (EM) on different datasets while reducing inference time by at least 6.42% with controlled input lengths.

Key facts. Cited by 1 paper in the map (data through 14 Oct 2026). Placed in RAG for code, one of 15 directions in Retrieval-augmented generation. Builds on 38 of its 74 references that are in the map. First posted on arXiv 14 Jul 2025.

Builds on

38 of 74 references.

Closest ancestors · 1

Same direction, newest first

  1. 2023RAP-Gen: Retrieval-Augmented Patch Generation with CodeT5 for Automatic Program Repair12 Sep

Other references · 37

  1. 2014Adam: A Method for Stochastic Optimizationcited by 37,240
  2. 2021LoRA: Low-Rank Adaptation of Large Language Modelscited by 14,380
  3. 2019Parameter-Efficient Transfer Learning for NLPcited by 4,236
  4. 2023Code Llama: Open Foundation Models for Codecited by 2,139
  5. 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,310
  6. 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 906
  7. 2023StarCoder: may the source be with you!cited by 799
  8. 2023A Prompt Pattern Catalog to Enhance Prompt Engineering with ChatGPTcited by 619
  9. 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 609
  10. 2024StarCoder 2 and The Stack v2: The Next Generationcited by 502
  11. 2020CodeBLEU: a Method for Automatic Evaluation of Code Synthesiscited by 479
  12. 2024Agentless: Demystifying LLM-based Software Engineering Agentscited by 421
25 more
  1. 2022UniXcoder: Unified Cross-Modal Pre-training for Code Representationcited by 361
  2. 2023A Comprehensive Capability Analysis of GPT-3 and GPT-3.5 Series Modelscited by 246
  3. 2017Beam Search Strategies for Neural Machine Translationcited by 232
  4. 2023Full Parameter Fine-tuning for Large Language Models with Limited Resourcescited by 134
  5. 2018An Empirical Study on Learning Bug-Fixing Patches in the Wild via Neural Machine Translationcited by 108
  6. 2024Data-efficient Fine-tuning for LLM-based Recommendationcited by 104
  7. 2023DiverseVul: A New Vulnerable Source Code Dataset for Deep Learning Based Vulnerability Detectioncited by 102
  8. 2021CVEfixes: Automated Collection of Vulnerabilities and Their Fixes from Open-Source Softwarecited by 91
  9. 2021CURE: Code-Aware Neural Machine Translation for Automatic Program Repaircited by 86
  10. 2022Less Training, More Repairing Please: Revisiting Automated Program Repair via Zero-shot Learningcited by 76
  11. 2023Towards an Understanding of Large Language Models in Software Engineering Taskscited by 68
  12. 2023A Survey of Large Language Models for Code: Evolution, Benchmarking, and Future Trendscited by 66
  13. 2019TBar: Revisiting Template-based Automated Program Repaircited by 65
  14. 2023RepairLLaMA: Efficient Representations and Fine-Tuned Adapters for Program Repaircited by 50
  15. 2021Applying CodeBERT for Automated Program Repair of Java Simple Bugscited by 44
  16. 2024Fine-Tuning and Prompt Optimization: Two Great Steps that Work Better Togethercited by 40
  17. 2023Automatic Code Summarization via ChatGPT: How Far Are We?cited by 34
  18. 2022SelfAPR: Self-supervised Program Repair with Test Execution Diagnosticscited by 33
  19. 2024Teaching Code LLMs to Use Autocompletion Tools in Repository-Level Code Generationcited by 30
  20. 2023GAMMA: Revisiting Template-based Automated Program Repair via Mask Predictioncited by 23
  21. 2024Hybrid Automated Program Repair by Combining Large Language Models and Program Analysiscited by 22
  22. 2022Reprogramming Pretrained Language Models for Antibody Sequence Infillingcited by 20
  23. 2023One Adapter for All Programming Languages? Adapter Tuning for Code Search and Summarizationcited by 16
  24. 2024When Large Language Models Confront Repository-Level Automatic Program Repair: How Well They Done?cited by 12
  25. 2018How to Design a Program Repair Bot? Insights from the Repairnator Projectcited by 11

Built on by

Cited by year

Citing papers per year: 2025: 1.

1 paper.

Similar, not cited

Close in wording, no citation either way

  1. 2025The Art of Repair: Optimizing Iterative Program Repair with Instruction-Tuned Models
  2. 2026Rethinking Automated Program Repair: The Impact of Bug Complexity, Fault Localization, and LLM Cost-efficiency
  3. 2025MultiMend: Multilingual Program Repair with Context Augmentation and Multi-Hunk Patch Generation
  4. 2025Towards Effectively Leveraging Execution Traces for Program Repair with Code LLMs
  5. 2025FeedbackEval: A Benchmark for Evaluating Large Language Models in Feedback-Driven Code Repair Tasks
  6. 2025ReCode: Improving LLM-based Code Repair with Fine-Grained Retrieval-Augmented Generation
  7. 2025Unlocking LLM Repair Capabilities Through Cross-Language Translation and Multi-Agent Refinement
  8. 2026Refine After Generation: Toward Correct and Concise Patches in LLM-based Program Repair