The Art of Repair: Optimizing Iterative Program Repair with Instruction-Tuned Models
Not on the map. Why?
Abstract (arXiv)
Automatic program repair (APR) aims to reduce the manual efforts required to identify and fix errors in source code. Before the rise of LLM-based agents, a common strategy was to increase the number of generated patches, sometimes to the thousands, to achieve better repair results on benchmarks. More recently, self-iterative capabilities enabled LLMs to refine patches over multiple rounds guided by feedback. However, literature often focuses on many iterations and disregards different numbers of outputs. We investigate an APR pipeline that balances these two approaches, the generation of multiple outputs and multiple rounds of iteration, while imposing a limit of 10 total patches per bug. We apply three SOTA instruction-tuned LLMs - DeepSeekCoder-Instruct, Codellama-Instruct, Llama3.1-Instruct - to the APR task. We further fine-tune each model on an APR dataset with three sizes (1K, 30K, 65K) and two techniques (Full Fine-Tuning and LoRA), allowing us to assess their repair capabilities on two APR benchmarks: HumanEval-Java and Defects4J. Our results show that by using only a fraction (<1%) of the fine-tuning dataset, we can achieve improvements of up to 78% in the number of plausible patches generated, challenging prior studies that reported limited gains using Full Fine-Tuning. However, we find that exceeding certain thresholds leads to diminishing outcomes, likely due to overfitting. Moreover, we show that base models greatly benefit from creating patches in an iterative fashion rather than generating them all at once. In addition, the benefit of iterative strategies becomes more pronounced in complex benchmarks. Even fine-tuned models, while benefiting less from iterations, still gain advantages, particularly on complex benchmarks. The research underscores the need for balanced APR strategies that combine multi-output generation and iterative refinement.
Key facts. Cited by 7 papers in the map (data through 14 Oct 2026). Builds on 49 of its 64 references that are in the map. First posted on arXiv 5 May 2025.
Builds on
49 of 64 references.
References · 49
- 2024The Llama 3 Herd of Modelscited by 14,715
- 2021LoRA: Low-Rank Adaptation of Large Language Modelscited by 14,380
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 14,132
- 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 13,028
- 2021Finetuned Language Models Are Zero-Shot Learnerscited by 3,780
- 2022Training Compute-Optimal Large Language Modelscited by 3,019
- 2023Code Llama: Open Foundation Models for Codecited by 2,139
- 2024DeepSeek-Coder: When the Large Language Model Meets Programming -- The Rise of Code Intelligencecited by 1,181
- 2023Teaching Large Language Models to Self-Debugcited by 988
- 2023WizardCoder: Empowering Code Large Language Models with Evol-Instructcited by 733
- 2024DeepSeek LLM: Scaling Open-Source Language Models with Longtermismcited by 642
- 2023Instruction Tuning for Large Language Models: A Surveycited by 623
37 more
- 2023CodeT5+: Open Code Large Language Models for Code Understanding and Generationcited by 333
- 2023Magicoder: Empowering Code Generation with OSS-Instructcited by 256
- 2024OpenCodeInterpreter: Integrating Code Generation with Execution and Refinementcited by 247
- 2024RepairAgent: An Autonomous, LLM-Based Agent for Program Repaircited by 232
- 2023OctoPack: Instruction Tuning Code Large Language Modelscited by 189
- 2022Practical Program Repair in the Era of Large Pre-trained Language Modelscited by 133
- 2023An Analysis of the Automatic Bug Fixing Performance of ChatGPTcited by 110
- 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
- 2023PanGu-Coder2: Boosting Large Language Models for Code with Ranking Feedbackcited by 69
- 2024Instruction Tuning for Secure Code Generationcited by 68
- 2019TBar: Revisiting Template-based Automated Program Repaircited by 65
- 2021A Syntax-Guided Edit Decoder for Neural Program Repaircited by 57
- 2023A Survey of Learning-based Automated Program Repaircited by 55
- 2023Evaluating Instruction-Tuned Large Language Models on Code Comprehension and Generationcited by 50
- 2023RepairLLaMA: Efficient Representations and Fine-Tuned Adapters for Program Repaircited by 50
- 2023Can It Edit? Evaluating the Ability of Large Language Models to Follow Code Editing Instructionscited by 48
- 2023LLaMA-Reviewer: Advancing Code Review Automation with Large Language Models through Parameter-Efficient Fine-Tuningcited by 47
- 2023WaveCoder: Widespread And Versatile Enhancement For Code Large Language Models By Instruction Tuningcited by 42
- 2023Conversational Automated Program Repaircited by 41
- 2017ARJA: Automated Repair of Java Programs via Multi-Objective Genetic Programmingcited by 26
- 2024Astraios: Parameter-Efficient Instruction Tuning Code Large Language Modelscited by 23
- 2018FixMiner: Mining Relevant Fix Patterns for Automated Program Repaircited by 22
- 2018AVATAR : Fixing Semantic Bugs with Fix Patterns of Static Analysis Violationscited by 22
- 2021Trust Enhancement Issues in Program Repaircited by 22
- 2022Less is More: Summary of Long Instructions is Better for Program Synthesiscited by 17
- 2021Elixir: Effective object-oriented program repaircited by 16
- 2023ITER: Iterative Neural Repair for Multi-Location Patchescited by 16
- 2024How Far Can We Go with Practical Function-Level Program Repair?cited by 16
- 2024CigaR: Cost-efficient Program Repair with LLMscited by 15
- 2024RGD: Multi-LLM Based Agent Debugger via Refinement and Generation Guidancecited by 12
- 2024Are Large Language Models Memorizing Bug Benchmarks?cited by 12
- 2020Better Automatic Program Repair by Using Bug Reports and Tests Togethercited by 10
- 2021Megadiff: A Dataset of 600k Java Source Code Changes Categorized by Diff Sizecited by 10
- 2017Ultra-Large Repair Search Space with Automatically Mined Templates: the Cardumen Mode of Astorcited by 9
- 2024Semi-Instruct: Bridging Natural-Instruct and Self-Instruct for Code Large Language Modelscited by 3
- 2025Fully Autonomous Programming using Iterative Multi-Agent Debugging with Large Language Modelscited by 3
Built on by
Citing papers per year: 2025: 4; 2026: 3.
7 papers.
- 2025VisCoder: Fine-Tuning LLMs for Executable Python Visualization Code Generationcited by 17
- 2025From Code Foundation Models to Agents and Applications: A Comprehensive Survey and Practical Guide to Code Intelligencecited by 15
- 2025How Safe Are AI-Generated Patches? A Large-scale Study on Security Risks in LLM and Agentic Automated Program Repair on SWE-benchcited by 5
- 2025Wisdom and Delusion of LLM Ensembles for Code Generation and Repaircited by 3
- 2026MANGO: Automated Multi-Agent Test Oracle Generation for Vision-Language-Action Modelscited by 1
- 2026SAFEdit: Does Multi-Agent Decomposition Resolve the Reliability Challenges of Instructed Code Editing?cited by 0
- 2026Diffs vs. Whole Files: An Empirical Comparison of Iterative Edit-Based and Direct Generation for Flutter/Dart Code Modelscited by 0
- 2026Diffs vs. Whole Files: An Empirical Comparison of Iterative Edit-Based and Direct Generation for Flutter/Dart Code Models5 Sep 2026
- 2026MANGO: Automated Multi-Agent Test Oracle Generation for Vision-Language-Action Models23 Jun 2026
- 2026SAFEdit: Does Multi-Agent Decomposition Resolve the Reliability Challenges of Instructed Code Editing?28 Apr 2026
- 2025From Code Foundation Models to Agents and Applications: A Comprehensive Survey and Practical Guide to Code Intelligence23 Nov 2025
- 2025Wisdom and Delusion of LLM Ensembles for Code Generation and Repair24 Oct 2025
- 2025How Safe Are AI-Generated Patches? A Large-scale Study on Security Risks in LLM and Agentic Automated Program Repair on SWE-bench30 Jun 2025
- 2025VisCoder: Fine-Tuning LLMs for Executable Python Visualization Code Generation4 Jun 2025
Similar, not cited
Close in wording, no citation either way
- 2025Accelerating Automatic Program Repair with Dual Retrieval-Augmented Fine-Tuning and Patch Generation on Large Language Models
- 2026Rethinking Automated Program Repair: The Impact of Bug Complexity, Fault Localization, and LLM Cost-efficiency
- 2026If It's Not Buggy, Don't Fix It: On the Dynamics of Iterative Bug-fixing with LLMs
- 2026Refine After Generation: Toward Correct and Concise Patches in LLM-based Program Repair
- 2025Enhancing Automated Program Repair via Faulty Token Localization and Quality-Aware Patch Refinement ↗
- 2025FeedbackEval: A Benchmark for Evaluating Large Language Models in Feedback-Driven Code Repair Tasks
- 2024Aligning the Objective of LLM-based Program Repair
- 2025REFINE: Enhancing Program Repair Agents through Context-Aware Patch Refinement