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

LLaMA-Reviewer:通过参数高效微调利用大型语言模型推进代码审查自动化

LLaMA-Reviewer: Advancing Code Review Automation with Large Language Models through Parameter-Efficient Fine-Tuning

Institute of Software, Chinese Academy of Sciences(中国科学院软件研究所);University of Chinese Academy of Sciences(中国科学院大学);School of Software, Tsinghua University(清华大学软件学院);Sinosoft Company Limited(中科软科技股份有限公司)

Junyi Lu, Lei Yu, Xiaojia Li, Li Yang, Chun Zuo

AI总结:

本文提出LLaMA-Reviewer框架,利用LLaMA大模型和参数高效微调(少于1%可训练参数)实现代码审查自动化,在公开数据集上达到与专用模型相当的性能,并开源代码和权重。

摘要:

代码审查活动的自动化是软件工程领域的一项长期追求,主要通过各种特定领域的预训练模型来实现。尽管这些模型取得了成功,但它们通常需要大量资源从头开始进行预训练。相比之下,大型语言模型(LLMs)提供了一种引人注目的替代方案,因为它们在补充领域特定知识后具有卓越的能力。然而,它们在自动化代码审查任务方面的潜力在很大程度上尚未被探索。针对这一研究空白,我们提出了LLaMA-Reviewer,一个创新框架,利用流行的LLM——LLaMA在代码审查领域的能力。考虑到资源限制,该框架采用参数高效微调(PEFT)方法,在可训练参数少于1%的情况下实现高性能。我们在两个不同的公开数据集上对LLaMA-Reviewer进行了广泛评估。值得注意的是,即使使用最小的LLaMA基础模型(包含6.7B参数)和有限的调优轮次,LLaMA-Reviewer也能达到现有代码审查专用模型的性能。消融实验提供了对各种微调过程组件影响的见解,包括输入表示、指令调优和不同的PEFT方法。为了促进该领域的持续进步,代码和所有PEFT权重插件均已开源。

英文摘要:

The automation of code review activities, a long-standing pursuit in software engineering, has been primarily addressed by numerous domain-specific pre-trained models. Despite their success, these models frequently demand extensive resources for pre-training from scratch. In contrast, Large Language Models (LLMs) provide an intriguing alternative, given their remarkable capabilities when supplemented with domain-specific knowledge. However, their potential for automating code review tasks remains largely unexplored. In response to this research gap, we present LLaMA-Reviewer, an innovative framework that leverages the capabilities of LLaMA, a popular LLM, in the realm of code review. Mindful of resource constraints, this framework employs parameter-efficient fine-tuning (PEFT) methods, delivering high performance while using less than 1% of trainable parameters. An extensive evaluation of LLaMA-Reviewer is conducted on two diverse, publicly available datasets. Notably, even with the smallest LLaMA base model consisting of 6.7B parameters and a limited number of tuning epochs, LLaMA-Reviewer equals the performance of existing code-review-focused models. The ablation experiments provide insights into the influence of various fine-tuning process components, including input representation, instruction tuning, and different PEFT methods. To foster continuous progress in this field, the code and all PEFT-weight plugins have been made open-source.

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

↑