arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2206.08574cs.SE
收藏

使用迁移学习进行代码相关任务

Using Transfer Learning for Code-Related Tasks

Antonio Mastropaolo, Nathan Cooper, David Nader Palacio, Simone Scalabrino, Denys Poshyvanyk, Rocco Oliveto, Gabriele Bavota

摘要:

深度学习(DL)技术已被用于支持若干与代码相关的任务,例如代码总结和错误修复。特别是,预训练的Transformer模型正在崛起,这也要归功于它们在自然语言处理(NLP)任务中取得的优异成绩。这些模型背后的基本思想是首先使用自监督任务(例如,在句子中填充掩码词)在通用数据集上对它们进行预训练。然后,这些模型被微调以支持感兴趣的特定任务(例如,语言翻译)。单个模型可以被微调以支持多个任务,可能利用迁移学习的好处。这意味着解决特定任务(例如,语言翻译)所获得的知识可以用于提高另一项任务(例如,情感分类)的性能。虽然迁移学习的好处在NLP中得到了广泛的研究,但在与代码相关的任务中,经验证据有限。在本文中,我们评估的文本到文本传输Transformer(T5)模型在支持四个不同的代码相关的任务:(i)自动修复错误,(ii)注入代码突变体,(iii)生成断言语句,(iv)代码摘要的性能。我们特别注意研究预训练和多任务微调对模型性能的影响。我们表明:(i)与最先进的基线相比,T5可以实现更好的性能;(ii)虽然预训练有助于模型,但并非所有任务都受益于多任务微调。

英文摘要:

Deep learning (DL) techniques have been used to support several code-related tasks such as code summarization and bug-fixing. In particular, pre-trained transformer models are on the rise, also thanks to the excellent results they achieved in Natural Language Processing (NLP) tasks. The basic idea behind these models is to first pre-train them on a generic dataset using a self-supervised task (e.g, filling masked words in sentences). Then, these models are fine-tuned to support specific tasks of interest (e.g, language translation). A single model can be fine-tuned to support multiple tasks, possibly exploiting the benefits of transfer learning. This means that knowledge acquired to solve a specific task (e.g, language translation) can be useful to boost performance on another task (e.g, sentiment classification). While the benefits of transfer learning have been widely studied in NLP, limited empirical evidence is available when it comes to code-related tasks. In this paper, we assess the performance of the Text-To-Text Transfer Transformer (T5) model in supporting four different code-related tasks: (i) automatic bug-fixing, (ii) injection of code mutants, (iii) generation of assert statements, and (iv) code summarization. We pay particular attention in studying the role played by pre-training and multi-task fine-tuning on the model's performance. We show that (i) the T5 can achieve better performance as compared to state-of-the-art baselines; and (ii) while pre-training helps the model, not all tasks benefit from a multi-task fine-tuning.

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

↑