arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2312.15698cs.SEcs.LG
收藏

RepairLLaMA:面向程序修复的高效表示与微调适配器

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

KTH Royal Institute of Technology(皇家理工学院);NC State University(北卡罗来纳州立大学)

André Silva, Sen Fang, Martin Monperrus

AI总结:

针对现有大语言模型程序修复方法代码表示朴素、无法扩展到前沿模型的问题,提出RepairLLaMA方法,通过最优代码表示和参数高效微调构建程序修复适配器,在多个基准上性能超越所有基线。

摘要:

自动化程序修复(Automated Program Repair,APR)随着大语言模型(Large Language Models,LLMs)的出现取得了显著发展。针对程序修复任务微调LLM是近期的一个研究方向,仍有诸多维度尚未被探索。现有工作大多采用朴素的代码表示对LLM进行微调,且无法扩展到前沿模型。为解决这一问题,我们提出RepairLLaMA,这是一种新颖的程序修复方法,其核心包括两点:1)为使用微调模型的APR确定最优代码表示;2)率先将前沿参数高效微调技术(parameter-efficient fine-tuning,PEFT)应用于程序修复任务。由此,RepairLLaMA生成了一种高效的“程序修复适配器”,可借助AI修复bug。我们的实验验证了这两个核心概念的有效性:首先,使用程序修复专用代码表示微调适配器,能让模型利用有意义的修复信号,生成更优的补丁;其次,参数高效微调有助于微调过程收敛,且明显提升了RepairLLaMA修复微调数据分布之外bug的效果。总体而言,RepairLLaMA正确修复了144个Defects4J v2 bug、109个HumanEval-Java bug以及20个GitBug-Java bug,性能优于所有基线模型。

英文摘要:

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. 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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑