arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2207.11680cs.SEcs.AI
收藏

不再微调?代码智能中提示微调的实验评价

No More Fine-Tuning? An Experimental Evaluation of Prompt Tuning in Code Intelligence

Harbin Institute of Technology(哈尔滨工业大学);Peng Cheng Laboratory(鹏城实验室);The Chinese University of Hong Kong(香港中文大学);The University of Newcastle(纽卡斯尔大学)

Chaozheng Wang, Yuanhang Yang, Cuiyun Gao, Yun Peng, Hongyu Zhang, Michael R. Lyu

摘要:

预先训练的模型在许多代码智能任务中表现出有效性。这些模型在大规模未标记语料库上进行预训练,然后在下游任务中进行微调。然而,由于预训练和下游任务的输入形式不同,很难充分挖掘预训练模型的知识。此外,微调的性能强烈依赖于下游数据的数量,而在实践中,数据稀缺的场景是常见的。自然语言处理(NLP)领域的最新研究表明,提示微调作为一种新的调优范式,解决了上述问题,并在各种NLP任务中取得了可喜的成果。在提示微调中,在优化期间插入的提示提供特定于任务的知识,这对于数据相对较少的任务尤其有益。在本文中,我们经验性地评估了提示微调在代码智能任务中的使用和效果。我们对流行的预训练模型CodeBERT和CodeT5进行了提示微调,并对三个代码智能任务进行了实验,包括缺陷预测,代码摘要和代码翻译。我们的实验结果表明,提示微调始终优于微调在所有三个任务。此外,提示微调在低资源场景中显示出巨大的潜力,例如,对于代码摘要,BLEU微调分数平均提高26%以上。我们的研究结果表明,而不是微调,我们可以适应提示微调的代码智能任务,以实现更好的性能,特别是当缺乏特定于任务的数据。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑