paperbot · PL 论文追踪

全部论文 待读 收藏

P2 No more fine-tuning? an experimental evaluation of prompt tuning in code intelligence

不再需要微调?代码智能中提示调优(prompt tuning)的实验评估
FSE Proceedings of the 30th ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering2022匹配度 1/10 · 该论文研究代码智能任务中的提示调优(prompt tuning)与微调对比,核心目标是改进预训练模型在下游任务上的适配方式,属于LLM/提示工程本身,而非将LLM/Agent用于静态分析、形式化验证、浮点程序分析或贝叶斯程序分析。引用 148 inbox
Chaozheng Wang, Yuanhang Yang, Cuiyun Gao, Yun Peng, Hongyu Zhang, Michael R. Lyu
crossref: 2026-09-12

AI 速览

一句话:在三个代码智能任务上实证表明提示调优一致优于微调,低资源场景下提升尤为显著。

预训练模型在代码智能任务中已被证明有效,其典型流程是先在大规模无标注语料上预训练,再在下游任务上微调。然而预训练与下游任务的输入形式不同,难以充分利用预训练知识;同时微调性能严重依赖下游数据量,而实际中数据稀缺的场景十分常见。自然语言处理领域提出的提示调优(prompt tuning)通过在调优阶段插入提示来提供任务特定知识,可缓解上述问题,尤其有利于数据较少的任务。本文在代码智能任务上实证评估提示调优的使用与效果:在流行的预训练模型 CodeBERT 与 CodeT5 上进行提示调优,覆盖缺陷预测、代码摘要与代码翻译三个任务。实验结果显示,提示调优在这三个任务上一致优于微调;且在低资源场景下潜力很大,例如在代码摘要任务上使微调的 BLEU 平均提升超过 26%。作者据此建议,可以用提示调优替代微调来适配代码智能任务,以取得更好性能,尤其是在缺乏任务特定数据时。

问题
微调预训练模型时,预训练与下游任务输入形式不一致且下游数据常稀缺,导致预训练知识难以被充分挖掘、性能受限。
方法
在 CodeBERT 与 CodeT5 上对缺陷预测、代码摘要、代码翻译三个代码智能任务实施提示调优,并与常规微调进行系统的对比实验。
评估
在三个任务上提示调优一致优于微调;在低资源设定下收益更明显,代码摘要任务的 BLEU 平均提升超过 26%。
原文摘要(Abstract)

Pre-trained models have been shown effective in many code intelligence tasks. 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 data, while in practice, the scenarios with scarce data 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 paper, 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 three code intelligence tasks including defect prediction, code summarization, and code translation. Our experimental results show that prompt tuning consistently outperforms fine-tuning in all three 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.

链接与引用

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

BibTeX
@inproceedings{paperbot7094,
  title = {No more fine-tuning? an experimental evaluation of prompt tuning in code intelligence},
  author = {Chaozheng Wang and Yuanhang Yang and Cuiyun Gao and Yun Peng and Hongyu Zhang and Michael R. Lyu},
  booktitle = {FSE},
  year = {2022},
  doi = {10.1145/3540250.3549113}
}