Lune

ICSE2023Top-tier venue

Automating Code-Related Tasks Through Transformers: The Impact of Pre-training

Rosalia Tufano, Luca Pascarella, Gabriele Bavota

Abstract

Transformers have gained popularity in the software engineering (SE) literature. These deep learning models are usually pre-trained through a self-supervised objective, meant to provide the model with basic knowledge about a language of interest (e.g., Java). A classic pre-training objective is the masked language model (MLM), in which a percentage of tokens from the input (e.g., a Java method) is masked, with the model in charge of predicting them. Once pre-trained, the model is then fine-tuned to support the specific downstream task of interest (e.g., code summarization). While there is evidence suggesting the boost in performance provided by pre-training, little is known about the impact of the specific pre-training objective(s) used. Indeed, MLM is just one of the possible pre-training objectives and recent work from the natural language processing field suggest that pre-training objectives tailored for the specific downstream task of interest may substantially boost the model's performance. For example, in the case of code summarization, a tailored pre-training objective could be the identification of an appropriate name for a given method, considering the method name to generate as an extreme summary. In this study, we focus on the impact of pre-training objectives on the performance of trans-formers when automating code-related tasks. We start with a systematic literature review aimed at identifying the pre-training objectives used in SE. Then, we pre-train 32 transformers using both (i) generic pre-training objectives usually adopted in SE; and (ii) pre-training objectives tailored to specific code-related tasks subject of our experimentation, namely bug-fixing, code summarization, and code completion. We also compare the pre-trained models with non pre-trained ones and show the advantage brought by pre-training in different scenarios, in which more or less fine-tuning data are available. Our results show that: (i) pre-training helps in boosting performance only if the amount of fine-tuning data available is small; (ii) the MLM objective is usually sufficient to maximize the prediction performance of the model, even when comparing it with pre-training objectives specialized for the downstream task at hand.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

4 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Automating code review activities by large-scale pre-training cites CodeBERT: A Pre-Trained Model for Programming and Natural Languages
  • Automating code review activities by large-scale pre-training cites GraphCodeBERT: Pre-training Code Representations with Data Flow
  • Towards Automatically Addressing Self-Admitted Technical Debt: How Far Are We? cites CodeBERT: A Pre-Trained Model for Programming and Natural Languages
  • Towards Automatically Addressing Self-Admitted Technical Debt: How Far Are We? cites GraphCodeBERT: Pre-training Code Representations with Data Flow
  • Towards Automatically Addressing Self-Admitted Technical Debt: How Far Are We? cites Automating code review activities by large-scale pre-training
  • Towards Automatically Addressing Self-Admitted Technical Debt: How Far Are We? cites CURE: Code-Aware Neural Machine Translation for Automatic Program Repair
  • Towards Automatically Addressing Self-Admitted Technical Debt: How Far Are We? cites PEGASUS: Pre-training with Extracted Gap-sentences for Abstractive Summarization
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers4

  1. Beyond Code Generation: An Observational Study of ChatGPT Usage in Software Engineering PracticeRanim Khojah, Mazen Mohamad, Philipp Leitner, Francisco Gomes de Oliveira NetoFSE 2024 · 56 citations
  2. Towards AI-Assisted Synthesis of Verified Dafny MethodsMd Rakib Hossain Misu, Cristina V. Lopes, Iris Ma, James NobleFSE 2024 · 26 citations
  3. Towards Automatically Addressing Self-Admitted Technical Debt: How Far Are We?Antonio Mastropaolo, Massimiliano Di Penta, Gabriele BavotaASE 2023 · 13 citations
  4. Dataflow-Guided Retrieval Augmentation for Repository-Level Code CompletionWei Cheng, Yuhan Wu, Wei HuACL 2024 · 9 citations

Builds on22

  1. CodeBERT: A Pre-Trained Model for Programming and Natural LanguagesZhangyin Feng, Daya Guo, Duyu Tang, Nan Duan et al.EMNLP Findings 2020 · 2,828 citations
  2. PEGASUS: Pre-training with Extracted Gap-sentences for Abstractive SummarizationJingqing Zhang, Yao Zhao, Mohammad Saleh, Peter J. LiuICML 2020 · 2,453 citations
  3. GraphCodeBERT: Pre-training Code Representations with Data FlowDaya Guo, Shuo Ren, Shuai Lu, Zhangyin Feng et al.ICLR 2021 · 1,644 citations
  4. CURE: Code-Aware Neural Machine Translation for Automatic Program RepairNan Jiang, Thibaud Lutellier, Lin TanICSE 2021 · 267 citations
  5. Automating code review activities by large-scale pre-trainingZhiyu Li, Shuai Lu, Daya Guo, Nan Duan et al.FSE 2022 · 195 citations

Related papers

  1. Studying the Usage of Text-To-Text Transfer Transformer to Support Code-Related TasksAntonio Mastropaolo, Simone Scalabrino, Nathan Cooper, David Nader-Palacio et al.ICSE 2021 · 9 citations
  2. CoditT5: Pretraining for Source Code and Natural Language EditingJiyang Zhang, Sheena Panthaplackel, Pengyu Nie, Junyi Jessy Li et al.ASE 2022 · 81 citations
  3. SPT-Code: Sequence-to-Sequence Pre-Training for Learning Source Code RepresentationsChangan Niu, Chuanyi Li, Vincent Ng, Jidong Ge et al.ICSE 2022 · 99 citations
  4. Multi-task Learning based Pre-trained Language Model for Code CompletionFang Liu, Ge Li, Yunfei Zhao, Zhi JinASE 2020 · 162 citations
  5. RepresentThemAll: A Universal Learning Representation of Bug ReportsSen Fang, Tao Zhang, Youshuai Tan, He Jiang et al.ICSE 2023 · 14 citations
Dusk over the sea between two cliffs drawn in fine vertical lines