Accelerating Automatic Program Repair with Dual Retrieval-Augmented Fine-Tuning and Patch Generation on Large Language Models
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
Other references · 37
- 2014Adam: A Method for Stochastic Optimizationcited by 37,240
- 2021LoRA: Low-Rank Adaptation of Large Language Modelscited by 14,380
- 2019Parameter-Efficient Transfer Learning for NLPcited by 4,236
- 2023Code Llama: Open Foundation Models for Codecited by 2,139
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,310
- 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 906
- 2023StarCoder: may the source be with you!cited by 799
- 2023A Prompt Pattern Catalog to Enhance Prompt Engineering with ChatGPTcited by 619
- 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 609
- 2024StarCoder 2 and The Stack v2: The Next Generationcited by 502
- 2020CodeBLEU: a Method for Automatic Evaluation of Code Synthesiscited by 479
- 2024Agentless: Demystifying LLM-based Software Engineering Agentscited by 421
25 more
- 2022UniXcoder: Unified Cross-Modal Pre-training for Code Representationcited by 361
- 2023A Comprehensive Capability Analysis of GPT-3 and GPT-3.5 Series Modelscited by 246
- 2017Beam Search Strategies for Neural Machine Translationcited by 232
- 2023Full Parameter Fine-tuning for Large Language Models with Limited Resourcescited by 134
- 2018An Empirical Study on Learning Bug-Fixing Patches in the Wild via Neural Machine Translationcited by 108
- 2024Data-efficient Fine-tuning for LLM-based Recommendationcited by 104
- 2023DiverseVul: A New Vulnerable Source Code Dataset for Deep Learning Based Vulnerability Detectioncited by 102
- 2021CVEfixes: Automated Collection of Vulnerabilities and Their Fixes from Open-Source Softwarecited by 91
- 2021CURE: Code-Aware Neural Machine Translation for Automatic Program Repaircited by 86
- 2022Less Training, More Repairing Please: Revisiting Automated Program Repair via Zero-shot Learningcited by 76
- 2023Towards an Understanding of Large Language Models in Software Engineering Taskscited by 68
- 2023A Survey of Large Language Models for Code: Evolution, Benchmarking, and Future Trendscited by 66
- 2019TBar: Revisiting Template-based Automated Program Repaircited by 65
- 2023RepairLLaMA: Efficient Representations and Fine-Tuned Adapters for Program Repaircited by 50
- 2021Applying CodeBERT for Automated Program Repair of Java Simple Bugscited by 44
- 2024Fine-Tuning and Prompt Optimization: Two Great Steps that Work Better Togethercited by 40
- 2023Automatic Code Summarization via ChatGPT: How Far Are We?cited by 34
- 2022SelfAPR: Self-supervised Program Repair with Test Execution Diagnosticscited by 33
- 2024Teaching Code LLMs to Use Autocompletion Tools in Repository-Level Code Generationcited by 30
- 2023GAMMA: Revisiting Template-based Automated Program Repair via Mask Predictioncited by 23
- 2024Hybrid Automated Program Repair by Combining Large Language Models and Program Analysiscited by 22
- 2022Reprogramming Pretrained Language Models for Antibody Sequence Infillingcited by 20
- 2023One Adapter for All Programming Languages? Adapter Tuning for Code Search and Summarizationcited by 16
- 2024When Large Language Models Confront Repository-Level Automatic Program Repair: How Well They Done?cited by 12
- 2018How to Design a Program Repair Bot? Insights from the Repairnator Projectcited by 11
Built on by
Citing papers per year: 2025: 1.
1 paper.
Similar, not cited
Close in wording, no citation either way
- 2025The Art of Repair: Optimizing Iterative Program Repair with Instruction-Tuned Models
- 2026Rethinking Automated Program Repair: The Impact of Bug Complexity, Fault Localization, and LLM Cost-efficiency
- 2025MultiMend: Multilingual Program Repair with Context Augmentation and Multi-Hunk Patch Generation
- 2025Towards Effectively Leveraging Execution Traces for Program Repair with Code LLMs
- 2025FeedbackEval: A Benchmark for Evaluating Large Language Models in Feedback-Driven Code Repair Tasks
- 2025ReCode: Improving LLM-based Code Repair with Fine-Grained Retrieval-Augmented Generation
- 2025Unlocking LLM Repair Capabilities Through Cross-Language Translation and Multi-Agent Refinement
- 2026Refine After Generation: Toward Correct and Concise Patches in LLM-based Program Repair