RepairLLaMA: Efficient Representations and Fine-Tuned Adapters for Program Repair

André Silva, Sen Fang, Martin Monperrus
12/25/2023
133 citations
cs.SEcs.LG
lora-peft-merging

Official code: ASSERT-KTH/repairllama (44 stars, Jupyter Notebook, last commit 2025-09-05).

Abstract

Automated Program Repair (APR) has evolved significantly with the advent of Large Language Models (LLMs). Fine-tuning LLMs for program repair is a recent avenue of research, with many dimensions which have not been explored.

Show full abstract

Existing work mostly fine-tune LLMs with naive code representations and does not scale to frontier models. To address this problem, we propose RepairLLaMA, a novel program repair approach that 1) identifies optimal code representations for APR with fine-tuned models, and 2) pioneers state-of-the-art parameter-efficient fine-tuning technique (PEFT) for program repair. This results in RepairLLaMA producing a highly effective `program repair adapter' for fixing bugs with AI. Our experiments demonstrate the validity of both concepts. First, fine-tuning adapters with program repair specific code representations enables the model to use meaningful repair signals and produce better patches. Second, parameter-efficient fine-tuning helps fine-tuning to converge and clearly contributes to the effectiveness of RepairLLaMA in fixing bugs outside the fine-tuning data distribution. Overall, RepairLLaMA correctly fixes 144 Defects4J v2, 109 HumanEval-Java, and 20 GitBug-Java bugs, outperforming all baselines.

View on arXivView PDF

Code Implementations(1)

RepairLLaMA: Efficient Representations and Fine-Tuned Adapters for Program Repair http://arxiv.org/pdf/2312.15698

4410Jupyter Notebook, PythonOct 2, 20231 years ago
aprcodellamallamallmslora+1 more

Similar Papers

Cite this paper

@article{silva2023repairllama,
  title  = {RepairLLaMA: Efficient Representations and Fine-Tuned Adapters for Program Repair},
  author = {André Silva and Sen Fang and Martin Monperrus},
  year   = {2023},
  eprint = {2312.15698},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2312.15698v6}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2312.15698.svg)](https://codeofpaper.com/paper/2312.15698)

Discussion