arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2503.14201cs.SE
收藏

为什么个性化基于深度学习的代码补全工具至关重要

Why Personalizing Deep Learning-Based Code Completion Tools Matters

Alessandro Giagnorio, Alberto Martin-Lopez, Gabriele Bavota

AI总结:

本文通过 Apache、Spring 的 136 名开发者及 T5、Code Llama 多规模模型实验,证明组织与开发者个性化微调可提升代码补全性能,并使小模型达到约 10 倍大模型的效果。

摘要:

基于深度学习(DL)的代码补全工具通过实现先进的代码生成,已经变革了软件开发。这些工具利用在来自众多代码仓库的大量代码上训练出的模型,捕捉通用编码模式。然而,为特定组织或开发者微调这些模型以提升其在此类主体上的性能所产生的影响,仍未得到探索。在本工作中,我们通过提供可靠的实证证据来回答这一问题,从而填补这一空白。更具体地说,我们考察了来自两个组织(Apache 和 Spring)的 136 名开发者、两种模型架构(T5 和 Code Llama)以及三种模型规模(60M、750M 和 7B 个可训练参数)。T5 模型(60M、750M)在 2,000 多个开源项目上进行了预训练和微调,排除了目标组织的数据,并与在组织特定和开发者特定数据集上微调的版本进行比较。对于 Code Llama 模型(7B),我们将公开在线可用的、已经预训练的模型,与通过参数高效微调在组织特定和开发者特定数据集上微调的同一模型进行性能比较。我们的结果表明,组织特定和开发者特定的额外微调都能提升预测能力,其中前者表现尤其出色。这一发现在以下两方面均具有普适性:(i) 两个目标组织(即 Apache 和 Spring),以及 (ii) 规模完全不同的模型(从 60M 到 7B 个可训练参数)。最后,我们表明,在组织特定数据集上微调的 DL 模型能够达到开箱即用的预训练代码模型相同的补全性能,而后者大约大 10 倍,从而相应节省部署和推理成本(例如,所需 GPU 更小)。

英文摘要:

Deep learning (DL)-based code completion tools have transformed software development by enabling advanced code generation. These tools leverage models trained on vast amounts of code from numerous repositories, capturing general coding patterns. However, the impact of fine-tuning these models for specific organizations or developers to boost their performance on such subjects remains unexplored. In this work, we fill this gap by presenting solid empirical evidence answering this question. More specifically, we consider 136 developers from two organizations (Apache and Spring), two model architectures (T5 and Code Llama), and three model sizes (60M, 750M, and 7B trainable parameters). T5 models (60M, 750M) were pre-trained and fine-tuned on over 2,000 open-source projects, excluding the subject organizations' data, and compared against versions fine-tuned on organization- and developer-specific datasets. For the Code Llama model (7B), we compared the performance of the already pre-trained model publicly available online with the same model fine-tuned via parameter-efficient fine-tuning on organization- and developer-specific datasets. Our results show that there is a boost in prediction capabilities provided by both an organization-specific and a developer-specific additional fine-tuning, with the former being particularly performant. Such a finding generalizes across (i) the two subject organizations (i.e., Apache and Spring) and (ii) models of completely different magnitude (from 60M to 7B trainable parameters). Finally, we show that DL models fine-tuned on an organization-specific dataset achieve the same completion performance of pre-trained code models used out of the box and being $\sim$10$\times$ larger, with consequent savings in terms of deployment and inference cost (e.g., smaller GPUs needed).

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

↑