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 条
  • [21] Prompt Tuning in Biomedical Relation Extraction
    He, Jianping
    Li, Fang
    Li, Jianfu
    Hu, Xinyue
    Nian, Yi
    Xiang, Yang
    Wang, Jingqi
    Wei, Qiang
    Li, Yiming
    Xu, Hua
    Tao, Cui
    JOURNAL OF HEALTHCARE INFORMATICS RESEARCH, 2024, 8 (02) : 206 - 224
  • [22] Prompt Tuning in Biomedical Relation Extraction
    Jianping He
    Fang Li
    Jianfu Li
    Xinyue Hu
    Yi Nian
    Yang Xiang
    Jingqi Wang
    Qiang Wei
    Yiming Li
    Hua Xu
    Cui Tao
    Journal of Healthcare Informatics Research, 2024, 8 : 206 - 224
  • [23] EVA: Enabling Video Attributes With Hierarchical Prompt Tuning for Action Recognition
    Ruan, Xiangning
    Yin, Qixiang
    Su, Fei
    Zhao, Zhicheng
    IEEE SIGNAL PROCESSING LETTERS, 2025, 32 : 971 - 975
  • [24] G-Prompt: Graphon-based Prompt Tuning for graph classification
    Duan, Yutai
    Liu, Jie
    Chen, Shaowei
    Chen, Liyi
    Wu, Jianhua
    INFORMATION PROCESSING & MANAGEMENT, 2024, 61 (03)
  • [25] ASR MODEL ADAPTATION WITH DOMAIN PROMPT TUNING
    Zou, Pengpeng
    Ye, Jianhao
    Zhou, Hongbin
    2024 INTERNATIONAL CONFERENCE ON ASIAN LANGUAGE PROCESSING, IALP 2024, 2024, : 406 - 410
  • [26] PTAU: Prompt Tuning for Attributing Unanswerable Questions
    Liao, Jinzhi
    Zhao, Xiang
    Zheng, Jianming
    Li, Xinyi
    Cai, Fei
    Tang, Jiuyang
    PROCEEDINGS OF THE 45TH INTERNATIONAL ACM SIGIR CONFERENCE ON RESEARCH AND DEVELOPMENT IN INFORMATION RETRIEVAL (SIGIR '22), 2022, : 1219 - 1229
  • [27] 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
  • [28] PTR: Prompt Tuning with Rules for Text Classification
    Han, Xu
    Zhao, Weilin
    Ding, Ning
    Liu, Zhiyuan
    Sun, Maosong
    AI OPEN, 2022, 3 : 182 - 192
  • [29] Joint Classification of Hyperspectral Image and LiDAR Data Based on Spectral Prompt Tuning
    Kong, Yi
    Cheng, Yuhu
    Chen, Yang
    Wang, Xuesong
    IEEE TRANSACTIONS ON GEOSCIENCE AND REMOTE SENSING, 2024, 62
  • [30] Prompt Tuning on Graph-Augmented Low-Resource Text Classification
    Wen, Zhihao
    Fang, Yuan
    IEEE TRANSACTIONS ON KNOWLEDGE AND DATA ENGINEERING, 2024, 36 (12) : 9080 - 9095