An Empirical Study of Parameter-Efficient Fine-Tuning Methods for Pre-Trained Code Models
Authors:
- 11 September 2023
- conference paper
- Published by Institute of Electrical and Electronics Engineers (IEEE)
- p. 397-408
Abstract
Pre-trained code models (e.g. CodeBERT and CodeT5) have demonstrated their code intelligence in various software engineering tasks, such as code summarization. And full fine-tuning has become the typical approach to adapting these models to downstream tasks. However, full fine-tuning these large models can be computationally expensive and memory-intensive, particularly when training for multiple tasks. To alleviate this issue, several parameter-efficient fine-tuning methods (e.g. Adapter and LoRA) have been proposed to only train a small number of additional parameters, while keeping the original pre-trained parameters frozen. Although these methods claim superiority over the prior techniques, they seldom make a comprehensive and fair comparison on multiple software engineering tasks. Moreover, besides their potential in reducing fine-tuning costs and maintaining approximate performance, the effectiveness of these methods in low-resource, cross-language, and cross-project scenarios is inadequately studied. To this end, we first conduct experiments by fine-tuning state-of-the-art code models with these methods on both code understanding tasks and code generation tasks. The results show that, by tuning only 0.5% additional parameters, these methods may achieve comparable or higher performance than full fine-tuning in code understanding tasks, but they may exhibit slightly weaker performance in code generation tasks. We also investigate the impact of these methods with varying numbers of training samples and find that, a considerable number of samples (e.g. 1000 for clone detection) may be required for them to approximate the performance of full fine-tuning. Our experimental results in cross-language and cross-project scenarios demonstrate that by freezing most pre-trained parameters and tuning only 0.5% additional parameters, these methods achieve consistent improvements in models' transfer learning ability in comparison to full fine-tuning. Our code and data are available at https://github.com/anonymous-ase23/ CodeModelParameterEfficientFinetuning.Keywords
This publication has 29 references indexed in Scilit:
- The Power of Scale for Parameter-Efficient Prompt Tuning2021
- AdapterFusion: Non-Destructive Task Composition for Transfer Learning2021
- Prefix-Tuning: Optimizing Continuous Prompts for Generation2021
- Unified Pre-training for Program Understanding and Generation2021
- CodeBERT: A Pre-Trained Model for Programming and Natural Languages2020
- Keep it simple: Is deep learning good for linguistic smell detection?2018
- Mapping Language to Code in Programmatic Context2018
- Easy over hard: a case study on deep learning2017
- Summarizing Source Code using a Neural Attention Model2016
- Towards a Big Data Curated Benchmark of Inter-project Code Clones2014