Towards Efficient Fine-tuning of Pre-trained Code Models: An Experimental Study and Beyond
Not on the map. Why?
Abstract (arXiv)
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. Replication package including source code, datasets, and online Appendix is available at: urlhttps://github.com/DeepSoftwareAnalytics/Telly.
Key facts. Cited by 20 papers in the map (data through 14 Oct 2026). Builds on 39 of its 72 references that are in the map. First posted on arXiv 11 Apr 2023.
Builds on
39 of 72 references.
References · 39
- 2017Attention Is All You Needcited by 60,361
- 2015Deep Residual Learning for Image Recognitioncited by 52,096
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,599
- 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,372
- 2021Masked Autoencoders Are Scalable Vision Learnerscited by 7,403
- 2019Parameter-Efficient Transfer Learning for NLPcited by 4,236
- 2021BEiT: BERT Pre-Training of Image Transformerscited by 2,375
- 2014CIDEr: Consensus-based Image Description Evaluationcited by 2,046
- 2020MiniLM: Deep Self-Attention Distillation for Task-Agnostic Compression of Pre-Trained Transformerscited by 1,463
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,310
- 2019TinyBERT: Distilling BERT for Natural Language Understandingcited by 1,167
27 more
- 2019BERT Rediscovers the Classical NLP Pipelinecited by 1,059
- 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 906
- 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 744
- 2019CodeSearchNet Challenge: Evaluating the State of Semantic Code Searchcited by 654
- 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 609
- 2019What do you learn from context? Probing for sentence structure in contextualized word representationscited by 438
- 2021Unified Pre-training for Program Understanding and Generationcited by 366
- 2022UniXcoder: Unified Cross-Modal Pre-training for Code Representationcited by 361
- 2020K-Adapter: Infusing Knowledge into Pre-Trained Models with Adapterscited by 319
- 2020IntelliCode Compose: Code Generation Using Transformercited by 227
- 2020What Happens To BERT Embeddings During Fine-tuning?cited by 113
- 2018Mapping Language to Code in Programmatic Contextcited by 104
- 2021CURE: Code-Aware Neural Machine Translation for Automatic Program Repaircited by 86
- 2022Using Pre-Trained Models to Boost Code Review Automationcited by 63
- 2022Transferability in Deep Learning: A Surveycited by 57
- 2022NatGen: Generative pre-training by "Naturalizing" source codecited by 54
- 2022What Do They Capture? -- A Structural Analysis of Pre-Trained Language Models for Source Codecited by 50
- 2021On the Evaluation of Neural Code Summarizationcited by 48
- 2019Blackbox meets blackbox: Representational Similarity and Stability Analysis of Neural Language Models and Brainscited by 38
- 2021What do pre-trained code models know about code?cited by 36
- 2022SPT-Code: Sequence-to-Sequence Pre-Training for Learning Source Code Representationscited by 36
- 2019Correlating neural and symbolic representations of languagecited by 33
- 2022Probing Pretrained Models of Source Codecited by 26
- 2021Automatic Program Repair with OpenAI's Codex: Evaluating QuixBugscited by 25
- 2022Egeria: Efficient DNN Training with Knowledge-Guided Layer Freezingcited by 22
- 2021Towards Learning (Dis)-Similarity of Source Code from Program Contrastscited by 17
- 2022AST-Probe: Recovering abstract syntax trees from hidden representations of pre-trained language modelscited by 16
Built on by
Citing papers per year: 2023: 5; 2024: 11; 2025: 3; 2026: 1.
20 papers.
Sort:
By area:
- 2024Agents in Software Engineering: Survey, Landscape, and Visioncited by 60
- 2023RepairLLaMA: Efficient Representations and Fine-Tuned Adapters for Program Repaircited by 50
- 2024Random Masking Finds Winning Tickets for Parameter Efficient Fine-tuningcited by 17
- 2024Beyond Functional Correctness: Investigating Coding Style Inconsistencies in Large Language Modelscited by 15
- 2024VulDetectBench: Evaluating the Deep Capability of Vulnerability Detection with Large Language Modelscited by 11
- 2024Condense, Don't Just Prune: Enhancing Efficiency and Performance in MoE Layer Pruningcited by 10
- 2025Towards an Understanding of Context Utilization in Code Intelligencecited by 10
- 2023Pitfalls in Language Models for Code Intelligence: A Taxonomy and Surveycited by 9
- 2023SoTaNa: The Open-Source Software Development Assistantcited by 8
- 2024CodeArt: Better Code Models by Attention Regularization When Symbols Are Lackingcited by 7
- 2023A Comprehensive Evaluation of Parameter-Efficient Fine-Tuning on Software Engineering Taskscited by 5
- 2023Challenging Bug Prediction and Repair Models with Synthetic Bugscited by 4
8 more
- 2024Exploring Data-Efficient Adaptation of Large Language Models for Code Generationcited by 3
- 2024Parameter-Efficient Fine-Tuning of Large Language Models for Unit Test Generation: An Empirical Studycited by 3
- 2024Robust and Explainable Fine-Grained Visual Classification with Transfer Learning: A Dual-Carriageway Frameworkcited by 2
- 2025Zero-Shot Cross-Domain Code Search without Fine-Tuningcited by 2
- 2026SynthFix: Adaptive Neuro-Symbolic Code Vulnerability Repaircited by 1
- 2024MergeRepair: An Exploratory Study on Merging Task-Specific Adapters in Code LLMs for Automated Program Repaircited by 0
- 2024Transducer Tuning: Efficient Model Adaptation for Software Tasks Using Code Property Graphscited by 0
- 2025How to Select Pre-Trained Code Models for Reuse? A Learning Perspectivecited by 0
- 2026SynthFix: Adaptive Neuro-Symbolic Code Vulnerability Repair19 Apr 2026
- 2025Towards an Understanding of Context Utilization in Code Intelligence11 Apr 2025
- 2025Zero-Shot Cross-Domain Code Search without Fine-Tuning10 Apr 2025
- 2025How to Select Pre-Trained Code Models for Reuse? A Learning Perspective7 Jan 2025
- 2024Transducer Tuning: Efficient Model Adaptation for Software Tasks Using Code Property Graphs18 Dec 2024
- 2024Condense, Don't Just Prune: Enhancing Efficiency and Performance in MoE Layer Pruning26 Nov 2024
- 2024Parameter-Efficient Fine-Tuning of Large Language Models for Unit Test Generation: An Empirical Study4 Nov 2024
- 2024Agents in Software Engineering: Survey, Landscape, and Vision13 Sep 2024
- 2024MergeRepair: An Exploratory Study on Merging Task-Specific Adapters in Code LLMs for Automated Program Repair18 Aug 2024
- 2024Beyond Functional Correctness: Investigating Coding Style Inconsistencies in Large Language Models29 Jun 2024
- 2024VulDetectBench: Evaluating the Deep Capability of Vulnerability Detection with Large Language Models11 Jun 2024
- 2024Robust and Explainable Fine-Grained Visual Classification with Transfer Learning: A Dual-Carriageway Framework9 May 2024
8 more
- 2024Random Masking Finds Winning Tickets for Parameter Efficient Fine-tuning4 May 2024
- 2024Exploring Data-Efficient Adaptation of Large Language Models for Code Generation29 Feb 2024
- 2024CodeArt: Better Code Models by Attention Regularization When Symbols Are Lacking19 Feb 2024
- 2023RepairLLaMA: Efficient Representations and Fine-Tuned Adapters for Program Repair25 Dec 2023
- 2023A Comprehensive Evaluation of Parameter-Efficient Fine-Tuning on Software Engineering Tasks25 Dec 2023
- 2023Pitfalls in Language Models for Code Intelligence: A Taxonomy and Survey27 Oct 2023
- 2023Challenging Bug Prediction and Repair Models with Synthetic Bugs3 Oct 2023
- 2023SoTaNa: The Open-Source Software Development Assistant25 Aug 2023
- 2023RepairLLaMA: Efficient Representations and Fine-Tuned Adapters for Program Repaircited by 50
- 2024Random Masking Finds Winning Tickets for Parameter Efficient Fine-tuningcited by 17
- 2024Beyond Functional Correctness: Investigating Coding Style Inconsistencies in Large Language Modelscited by 15
- 2024VulDetectBench: Evaluating the Deep Capability of Vulnerability Detection with Large Language Modelscited by 11
- 2025Towards an Understanding of Context Utilization in Code Intelligencecited by 10
- 2023Pitfalls in Language Models for Code Intelligence: A Taxonomy and Surveycited by 9
- 2023SoTaNa: The Open-Source Software Development Assistantcited by 8
- 2024CodeArt: Better Code Models by Attention Regularization When Symbols Are Lackingcited by 7
- 2023A Comprehensive Evaluation of Parameter-Efficient Fine-Tuning on Software Engineering Taskscited by 5
- 2023Challenging Bug Prediction and Repair Models with Synthetic Bugscited by 4
- 2024Exploring Data-Efficient Adaptation of Large Language Models for Code Generationcited by 3
- 2024Parameter-Efficient Fine-Tuning of Large Language Models for Unit Test Generation: An Empirical Studycited by 3
12 most cited of 18 All 18 (JSON)
- 2026SynthFix: Adaptive Neuro-Symbolic Code Vulnerability Repair19 Apr 2026
- 2025Towards an Understanding of Context Utilization in Code Intelligence11 Apr 2025
- 2025Zero-Shot Cross-Domain Code Search without Fine-Tuning10 Apr 2025
- 2025How to Select Pre-Trained Code Models for Reuse? A Learning Perspective7 Jan 2025
- 2024Transducer Tuning: Efficient Model Adaptation for Software Tasks Using Code Property Graphs18 Dec 2024
- 2024Parameter-Efficient Fine-Tuning of Large Language Models for Unit Test Generation: An Empirical Study4 Nov 2024
- 2024MergeRepair: An Exploratory Study on Merging Task-Specific Adapters in Code LLMs for Automated Program Repair18 Aug 2024
- 2024Beyond Functional Correctness: Investigating Coding Style Inconsistencies in Large Language Models29 Jun 2024
- 2024VulDetectBench: Evaluating the Deep Capability of Vulnerability Detection with Large Language Models11 Jun 2024
- 2024Robust and Explainable Fine-Grained Visual Classification with Transfer Learning: A Dual-Carriageway Framework9 May 2024
- 2024Random Masking Finds Winning Tickets for Parameter Efficient Fine-tuning4 May 2024
- 2024Exploring Data-Efficient Adaptation of Large Language Models for Code Generation29 Feb 2024
12 newest of 18 All 18 (JSON)