Prompt Tuning in Code Intelligence: An Experimental Evaluation

被引:6
|
作者
Wang, Chaozheng [1 ]
Yang, Yuanhang [1 ]
Gao, Cuiyun [1 ]
Peng, Yun [2 ]
Zhang, Hongyu [3 ,4 ]
Lyu, Michael R. [2 ]
机构
[1] Harbin Inst Technol, Shenzhen 518055, Peoples R China
[2] Chinese Univ Hong Kong, Hong Kong 999077, Peoples R China
[3] Univ Newcastle, Newcastle, Australia
[4] Chongqing Univ, Chongqing 400044, Peoples R China
基金
中国国家自然科学基金;
关键词
Tuning; Codes; Task analysis; Training; Predictive models; Adaptation models; Source coding; Code intelligence; prompt tuning; empirical study;
D O I
10.1109/TSE.2023.3313881
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
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.
引用
收藏
页码:4869 / 4885
页数:17
相关论文
共 50 条
  • [41] On Transferability of Prompt Tuning for Natural Language Processing
    Su, Yusheng
    Wang, Xiaozhi
    Qin, Yujia
    Chan, Chi-Min
    Lin, Yankai
    Wang, Huadong
    Wen, Kaiyue
    Liu, Zhiyuan
    Li, Peng
    Li, Juanzi
    Hou, Lei
    Sun, Maosong
    Zhou, Jie
    NAACL 2022: THE 2022 CONFERENCE OF THE NORTH AMERICAN CHAPTER OF THE ASSOCIATION FOR COMPUTATIONAL LINGUISTICS: HUMAN LANGUAGE TECHNOLOGIES, 2022, : 3949 - 3969
  • [42] Performance Evaluation of Swarm Intelligence on Model-based PID Tuning
    Wati, Dwi Ana Ratna
    2013 IEEE INTERNATIONAL CONFERENCE ON COMPUTATIONAL INTELLIGENCE AND CYBERNETICS (CYBERNETICSCOM), 2013, : 40 - 44
  • [43] Hard Sample Aware Prompt-Tuning
    Xu, Yuanjian
    An, Qi
    Zhang, Jiahuan
    Li, Peng
    Nie, Zaiqing
    PROCEEDINGS OF THE 61ST ANNUAL MEETING OF THE ASSOCIATION FOR COMPUTATIONAL LINGUISTICS (ACL 2023): LONG PAPERS, VOL 1, 2023, : 12356 - 12369
  • [44] Visual Prompt Tuning for Generative Transfer Learning
    Sohn, Kihyuk
    Chang, Huiwen
    Lezama, Jose
    Polania, Luisa
    Zhang, Han
    Hao, Yuan
    Essa, Irfan
    Jiang, Lu
    2023 IEEE/CVF CONFERENCE ON COMPUTER VISION AND PATTERN RECOGNITION (CVPR), 2023, : 19840 - 19851
  • [45] SharPT: Shared Latent Space Prompt Tuning
    Pang, Bo
    Yavuz, Semih
    Xiong, Caiming
    Zhou, Yingbo
    17TH CONFERENCE OF THE EUROPEAN CHAPTER OF THE ASSOCIATION FOR COMPUTATIONAL LINGUISTICS, EACL 2023, 2023, : 1244 - 1250
  • [46] PTR: Prompt Tuning with Rules for Text Classification
    Han, Xu
    Zhao, Weilin
    Ding, Ning
    Liu, Zhiyuan
    Sun, Maosong
    AI OPEN, 2022, 3 : 182 - 192
  • [47] Fine-Grained Retrieval Prompt Tuning
    Wang, Shijie
    Chang, Jianlong
    Wang, Zhihui
    Li, Haojie
    Ouyang, Wanli
    Tian, Qi
    THIRTY-SEVENTH AAAI CONFERENCE ON ARTIFICIAL INTELLIGENCE, VOL 37 NO 2, 2023, : 2644 - 2652
  • [48] Experimental evaluation of ship resistance for RANS code validation
    Avanzini, G
    Benedetti, L
    Penna, R
    INTERNATIONAL JOURNAL OF OFFSHORE AND POLAR ENGINEERING, 2000, 10 (01) : 10 - 18
  • [49] Experimental evaluation of ship resistance for RANS code validation
    Avanzini, G
    Benedetti, L
    Penna, R
    PROCEEDINGS OF THE EIGHTH INTERNATIONAL OFFSHORE AND POLAR ENGINEERING CONFERENCE, VOL 4, 1998, : 245 - 252
  • [50] Is There A "Golden" Rule for Code Reviewer Recommendation? - An Experimental Evaluation
    Hu, Yuanzhe
    Wang, Junjie
    Hou, Jie
    Li, Shoubin
    Wang, Qing
    2020 IEEE 20TH INTERNATIONAL CONFERENCE ON SOFTWARE QUALITY, RELIABILITY, AND SECURITY (QRS 2020), 2020, : 497 - 508