Towards Efficient Fine-Tuning of Pre-trained Code Models: An Experimental Study and Beyond

被引:2
|
作者
Shi, Ensheng [1 ,5 ]
Wang, Yanlin [2 ,5 ]
Zhang, Hongyu [3 ]
Du, Lun [4 ]
Han, Shi [4 ]
Zhang, Dongmei [4 ]
Sun, Hongbin [1 ]
机构
[1] Xi An Jiao Tong Univ, Xian, Peoples R China
[2] Sun Yat Sen Univ, Zhuhai, Peoples R China
[3] Chongqing Univ, Chongqing, Peoples R China
[4] Microsoft, Beijing, Peoples R China
[5] Microsoft Res Asia, Beijing, Peoples R China
基金
国家重点研发计划;
关键词
Empirical study; Pre-Trained Language Models; Efficient Fine-tuning; Probing Techniques; Representational Similarity Analysis;
D O I
10.1145/3597926.3598036
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Recently, fine-tuning pre-trained code models such as CodeBERT on downstream tasks has achieved great success in many software testing and analysis tasks. While effective and prevalent, fine-tuning the pre-trained parameters incurs a large computational cost. In this paper, we conduct an extensive experimental study to explore what happens to layer-wise pre-trained representations and their encoded code knowledge during fine-tuning. We then propose efficient alternatives to fine-tune the large pre-trained code model based on the above findings. Our experimental study shows that (1) lexical, syntactic and structural properties of source code are encoded in the lower, intermediate, and higher layers, respectively, while the semantic property spans across the entire model. (2) The process of fine-tuning preserves most of the code properties. Specifically, the basic code properties captured by lower and intermediate layers are still preserved during fine-tuning. Furthermore, we find that only the representations of the top two layers change most during fine-tuning for various downstream tasks. (3) Based on the above findings, we propose Telly to efficiently fine-tune pre-trained code models via layer freezing. The extensive experimental results on five various downstream tasks demonstrate that training parameters and the corresponding time cost are greatly reduced, while performances are similar or better.
引用
收藏
页码:39 / 51
页数:13
相关论文
共 50 条
  • [31] APPT: Boosting Automated Patch Correctness Prediction via Fine-Tuning Pre-Trained Models
    Zhang, Quanjun
    Fang, Chunrong
    Sun, Weisong
    Liu, Yan
    He, Tieke
    Hao, Xiaodong
    Chen, Zhenyu
    IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2024, 50 (03) : 474 - 494
  • [32] Adapter-based fine-tuning of pre-trained multilingual language models for code-mixed and code-switched text classification
    Himashi Rathnayake
    Janani Sumanapala
    Raveesha Rukshani
    Surangika Ranathunga
    Knowledge and Information Systems, 2022, 64 : 1937 - 1966
  • [33] Adapter-based fine-tuning of pre-trained multilingual language models for code-mixed and code-switched text classification
    Rathnayake, Himashi
    Sumanapala, Janani
    Rukshani, Raveesha
    Ranathunga, Surangika
    KNOWLEDGE AND INFORMATION SYSTEMS, 2022, 64 (07) : 1937 - 1966
  • [34] An efficient ptychography reconstruction strategy through fine-tuning of large pre-trained deep learning model
    Pan, Xinyu
    Wang, Shuo
    Zhou, Zhongzheng
    Zhou, Liang
    Liu, Peng
    Li, Chun
    Wang, Wenhui
    Zhang, Chenglong
    Dong, Yuhui
    Zhang, Yi
    ISCIENCE, 2023, 26 (12)
  • [35] Fine-tuning of pre-trained convolutional neural networks for diabetic retinopathy screening: a clinical study
    Roshan, Saboora M.
    Karsaz, Ali
    Vejdani, Amir Hossein
    Roshan, Yaser M.
    INTERNATIONAL JOURNAL OF COMPUTATIONAL SCIENCE AND ENGINEERING, 2020, 21 (04) : 564 - 573
  • [36] SFMD: A Semi-supervised Framework for Pre-trained Language Models Fine-Tuning with Noisy Samples
    Yang, Yiwen
    Duan, Pengfei
    Li, Yongbing
    Zhang, Yifang
    Xiong, Shengwu
    ADVANCED INTELLIGENT COMPUTING TECHNOLOGY AND APPLICATIONS, PT III, ICIC 2024, 2024, 14877 : 316 - 328
  • [37] Improving Pre-Trained Weights through Meta-Heuristics Fine-Tuning
    de Rosa, Gustavo H.
    Roder, Mateus
    Papa, Joao Paulo
    dos Santos, Claudio F. G.
    2021 IEEE SYMPOSIUM SERIES ON COMPUTATIONAL INTELLIGENCE (IEEE SSCI 2021), 2021,
  • [38] GRAM: Fast Fine-tuning of Pre-trained Language Models for Content-based Collaborative Filtering
    Yang, Yoonseok
    Kim, Kyu Seok
    Kim, Minsam
    Parkt, Juneyoung
    NAACL 2022: THE 2022 CONFERENCE OF THE NORTH AMERICAN CHAPTER OF THE ASSOCIATION FOR COMPUTATIONAL LINGUISTICS: HUMAN LANGUAGE TECHNOLOGIES, 2022, : 839 - 851
  • [39] Enhancing recognition and interpretation of functional phenotypic sequences through fine-tuning pre-trained genomic models
    Du, Duo
    Zhong, Fan
    Liu, Lei
    JOURNAL OF TRANSLATIONAL MEDICINE, 2024, 22 (01)
  • [40] Composed Fine-Tuning: Freezing Pre-Trained Denoising Autoencoders for Improved Generalization
    Xie, Sang Michael
    Ma, Tengyu
    Liang, Percy
    INTERNATIONAL CONFERENCE ON MACHINE LEARNING, VOL 139, 2021, 139