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

关于持续学习在代码预训练语言模型的分布外泛化中的应用

On the Usage of Continual Learning for Out-of-Distribution Generalization in Pre-trained Language Models of Code

University of Montreal(蒙特利尔大学);Singapore Management University(新加坡管理大学)

Martin Weyssow, Xin Zhou, Kisub Kim, David Lo, Houari Sahraoui

AI总结:

针对代码预训练语言模型在动态软件环境中因分布偏移和API演变导致的性能下降与灾难性遗忘问题,研究通过引入五种持续学习方法,有效缓解了知识遗忘并在API预测任务上取得更优性能。

摘要:

预训练语言模型(PLMs)已成为代码深度学习中的主流技术,它采用两阶段的预训练和微调过程来获取代码的通用知识,并专门处理各种下游任务。然而,软件代码库的动态特性对PLMs的有效性和鲁棒性提出了挑战。具体而言,现实世界的场景可能导致预训练数据与测试数据的分布之间存在显著差异,即分布偏移,从而导致PLM在下游任务上的性能下降。在本文中,我们强调需要使代码PLMs适应随时间分布发生变化的软件数据,这是一个在先前工作中被忽视的关键问题。本工作的动机是在非平稳环境中考虑PLM,其中微调数据根据软件演化场景随时间演变。具体来说,我们设计了一个场景,模型需要从随时间包含新的、未见过的API的程序流中学习。我们在两个下游任务(API调用和API使用预测)上研究了两种广泛使用的PLM架构,即GPT2解码器和RoBERTa编码器。我们证明,先前工作中最常用的微调技术不足以处理API的动态特性,导致先前获取的知识丢失,即灾难性遗忘。为了解决这些问题,我们实现了五种持续学习方法,包括基于回放和基于正则化的方法。我们的研究结果表明,利用这些直接的方法能有效缓解两个下游任务中PLMs的灾难性遗忘,同时取得相当或更优的性能。

英文摘要:

Pre-trained language models (PLMs) have become a prevalent technique in deep learning for code, utilizing a two-stage pre-training and fine-tuning procedure to acquire general knowledge about code and specialize in a variety of downstream tasks. However, the dynamic nature of software codebases poses a challenge to the effectiveness and robustness of PLMs. In particular, world-realistic scenarios potentially lead to significant differences between the distribution of the pre-training and test data, i.e., distribution shift, resulting in a degradation of the PLM's performance on downstream tasks. In this paper, we stress the need for adapting PLMs of code to software data whose distribution changes over time, a crucial problem that has been overlooked in previous works. The motivation of this work is to consider the PLM in a non-stationary environment, where fine-tuning data evolves over time according to a software evolution scenario. Specifically, we design a scenario where the model needs to learn from a stream of programs containing new, unseen APIs over time. We study two widely used PLM architectures, i.e., a GPT2 decoder and a RoBERTa encoder, on two downstream tasks, API call and API usage prediction. We demonstrate that the most commonly used fine-tuning technique from prior work is not robust enough to handle the dynamic nature of APIs, leading to the loss of previously acquired knowledge i.e., catastrophic forgetting. To address these issues, we implement five continual learning approaches, including replay-based and regularization-based methods. Our findings demonstrate that utilizing these straightforward methods effectively mitigates catastrophic forgetting in PLMs across both downstream tasks while achieving comparable or superior performance.

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

↑