Using Transfer Learning for Code-Related Tasks

Antonio Mastropaolo, Nathan Cooper, David Nader Palacio, Simone Scalabrino, Denys Poshyvanyk +2 more
6/17/2022
cs.SE
transformer-attention

Official code: antonio-mastropaolo/TransferLearning4Code (0 stars, Jupyter Notebook, last commit 2023-02-10).

Abstract

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.

Show full abstract

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.

View on arXivView PDF

Code Implementations(1)

Using Transfer Learning to support Code-Related tasks

00Jupyter NotebookNov 19, 20213 years ago

Similar Papers

Cite this paper

@article{mastropaolo2022using,
  title  = {Using Transfer Learning for Code-Related Tasks},
  author = {Antonio Mastropaolo and Nathan Cooper and David Nader Palacio and Simone Scalabrino and Denys Poshyvanyk and Rocco Oliveto and Gabriele Bavota},
  year   = {2022},
  eprint = {2206.08574},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2206.08574}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2206.08574.svg)](https://codeofpaper.com/paper/2206.08574)

Discussion