paperbot · PL 论文追踪

全部论文 待读 收藏

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

面向预训练代码模型的高效微调:一项实验研究及其拓展
ISSTA Proceedings of the 32nd ACM SIGSOFT International Symposium on Software Testing and Analysis2023匹配度 3/10 · 论文研究预训练代码模型的高效微调与层冻结,属于AI/ML与软件工程交叉,但与用户核心方向(静态分析/形式化验证与LLM/Agent结合、浮点程序分析、贝叶斯程序分析)关系较弱;它不涉及Agentic程序、程序分析工具或LLM改进静态分析。引用 40 inbox
Ensheng Shi, Yanlin Wang, Hongyu Zhang, Lun Du, Shi Han, Dongmei Zhang, Hongbin Sun
crossref: 2026-09-12

AI 速览

一句话:通过分层实验揭示代码模型微调规律,提出基于层冻结的 Telly 实现高效微调。

预训练代码模型(如 CodeBERT)在下游软件测试与分析任务上微调效果显著,但全参数微调计算开销巨大。本文对微调过程中逐层预训练表示及其编码的代码知识进行广泛实验研究,发现源码的词法、句法与结构属性分别编码于低层、中间层与高层,而语义属性横跨整个模型;微调可保留大部分代码属性,低层与中间层捕获的基本属性仍被保留,且不同下游任务中仅顶部两层的表示变化最大。基于这些发现,作者提出 Telly,通过层冻结高效微调预训练代码模型。在五个不同下游任务上的实验表明,该方法大幅减少训练参数与时间成本,同时性能与全量微调相当或更优。

问题
全参数微调大型预训练代码模型在下游任务上计算成本高昂,亟需在保持性能的同时降低开销。
方法
开展逐层实验分析预训练代码表示与代码知识在微调中的变化,并据此提出基于层冻结的高效微调方法 Telly。
评估
在五个不同下游任务上进行大量实验,比较训练参数量、时间成本与任务性能。
原文摘要(Abstract)

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.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@inproceedings{paperbot8045,
  title = {Towards Efficient Fine-Tuning of Pre-trained Code Models: An Experimental Study and Beyond},
  author = {Ensheng Shi and Yanlin Wang and Hongyu Zhang and Lun Du and Shi Han and Dongmei Zhang and Hongbin Sun},
  booktitle = {ISSTA},
  year = {2023},
  doi = {10.1145/3597926.3598036}
}