arrow
Return

Prompt Tuning in Code Intelligence: An Experimental Evaluation

delete2023-11-01
delete6
PRE
AI
C
Chaozheng Wang
Y
Yuanhang Yang
高
高翠云 (Cuiyun Gao) *
Y
Yun Peng
张
张宏玉 (Hongyu Zhang)
M
Michael R. Lyu
DOI:10.1109/TSE.2023.3313881delete
deleteOriginal
deleteOriginal request for help
deleteShare
deleteSave
Abstract

Abstract

En 中文
Pre-trained models have been shown effective in many code intelligence tasks, such as automatic code summarization and defect prediction. These models are pre-trained on large-scale unlabeled corpus and then fine-tuned in downstream tasks. However, as the inputs to pre-training and downstream tasks are in different forms, it is hard to fully explore the knowledge of pre-trained models. Besides, the performance of fine-tuning strongly relies on the amount of downstream task data, while in practice, the data scarcity scenarios are common. Recent studies in the natural language processing (NLP) field show that prompt tuning, a new paradigm for tuning, alleviates the above issues and achieves promising results in various NLP tasks. In prompt tuning, the prompts inserted during tuning provide task-specific knowledge, which is especially beneficial for tasks with relatively scarce data. In this article, we empirically evaluate the usage and effect of prompt tuning in code intelligence tasks. We conduct prompt tuning on popular pre-trained models CodeBERT and CodeT5 and experiment with four code intelligence tasks including defect prediction, code search, code summarization, and code translation. Our experimental results show that prompt tuning consistently outperforms fine-tuning in all four tasks. In addition, prompt tuning shows great potential in low-resource scenarios, e.g., improving the BLEU scores of fine-tuning by more than 26% on average for code summarization. Our results suggest that instead of fine-tuning, we could adapt prompt tuning for code intelligence tasks to achieve better performance, especially when lacking task-specific data. We also discuss the implications for adapting prompt tuning in code intelligence tasks.
Keywords:
Tuning
Codes
Task analysis
Training
Predictive models
Adaptation models
Source coding
Code intelligence
prompt tuning
empirical study

Journal

IEEE Transactions on Software Engineering cover
IEEE Transactions on Software Engineering
IF:
5.6
Papers:
2.9K
Citations:
1.1W

Organization

H
harbin institute of technology
Scholars:
8.0W
Papers: 6.6W
Citations: 66
U
University of Newcastle
Scholars:
1.5W
Papers: 1.5W
Citations: 16
C
Chinese University of Hong Kong
Scholars:
3.4W
Papers: 3.2W
Citations: 5.6W
researcher View more organizations
Cited Papers

Cited Papers

Interplanetary dust from the explosive dispersal of hydrated asteroids by impacts
err2003-05-01
err0
PREAI
errKazushige Tomeoka; Koji Kiriyama; Keiko Nakamura; Yasuhiro Yamahana; Toshimori Sekine
errShare
errSave
Role of autophagy in oocytogenesis, embryogenesis, implantation, and pathophysiology of pre‐eclampsia
err2017-04-18
err0
errOAAI
errAkitoshi Nakashima; Aiko Aoki; Tae Kusabiraki; Tomoko Shima; Osamu Yoshino; Shi‐Bin Cheng; Surendra Sharma; Shigeru Saito
errShare
errSave
errShare
errSave
errShare
errSave
Caveolin-1 and -2 regulate cell motility in castration-resistant prostate cancer
err2018-10-01
err0
errOAAI
errToyoharu Kamibeppu; Koji Yamasaki; Kozue Nakahara; Takahiro Nagai; Naoki Terada; Hiromasa Tsukino; Shoichiro Mukai; Toshiyuki Kamoto
errShare
errSave
VulDeeLocator: A Deep Learning-Based Fine-Grained Vulnerability Detector
err2022-07-01
err87
errOAAI
errLi, Zhen; Zou, Deqing; Xu, Shouhuai; Chen, Zhaoxuan; Zhu, Yawei; Jin, Hai
errShare
errSave
YAC transgene-mediated olfactory receptor gene choice
err2000-02-01
err0
errOAAI
errFarah A.W. Ebrahimi; James Edmondson; Rodney Rothstein; Andrew Chess
errShare
errSave
researcher View more