Deep learning (DL) techniques are gaining more and more attention in the software engineering community. They have been used to support several code-related tasks, such as automatic bug fixing and code comments generation. Recent studies in the Natural Language Processing (NLP) field have shown that the Text-To-Text Transfer Transformer (T5) architecture can achieve state-of-the-art performance for a variety of NLP tasks. The basic idea behind T5 is to first pre-train a model on a large and generic dataset using a self-supervised task ( e.g: filling masked words in sentences). Once the model is pre-trained, it is fine-tuned on smaller and specialized datasets, each one related to a specific task ( e.g: language translation, sentence classification). In this paper, we empirically investigate how the T5 model performs when pre-trained and fine-tuned to support code-related tasks. We pre-train a T5 model on a dataset composed of natural language English text and source code. Then, we fine-tune such a model by reusing datasets used in four previous works that used DL techniques to: (i) fix bugs, (ii) inject code mutants, (iii) generate assert statements, and (iv) generate code comments. We compared the performance of this single model with the results reported in the four original papers proposing DL-based solutions for those four tasks. We show that our T5 model, exploiting additional data for the self-supervised pre-training phase, can achieve performance improvements over the four baselines.
翻译:深入学习( DL) 技术在软件工程界越来越受到重视。 它们已被用于支持若干与代码有关的任务, 如自动错误修正和代码评论生成等。 最近对自然语言处理( NLP) 字段的研究表明, Text- Text 传输变换器( T5) 架构可以实现各种 NLP 任务的最先进的性能。 T5 的基本想法是, 使用自监督的任务( 例如: 在句子中填充掩码词), 用于支持一个大型和通用数据集的模型。 一旦该模型经过预先培训, 它就会对小型和专门数据集进行微调, 每一项都与具体任务( 例如: 语言翻译、 句子分类) 有关。 在本文中, 我们实验地调查T5 模型在预先培训和微调支持代码相关任务时是如何运行的。 我们先在包含自然语言文本和源代码改进的数据集上设计一个模型D5 。 然后, 我们细化了这样一个模型, 重新使用这个模型, 用于在四个版本的代码中, 比较了已经使用过的代码 的 4 。