paperbot · PL 论文追踪

全部论文 待读 收藏

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

持续学习在代码预训练语言模型分布外泛化中的应用
FSE Proceedings of the 31st ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering2023匹配度 3/10 · 该论文研究代码预训练模型在API演化下的持续学习与分布外泛化,属于机器学习与程序语言的交叉,但并未涉及静态分析、形式化验证、Agentic程序、浮点程序分析或贝叶斯程序分析,与用户核心方向仅有较弱的代码模型泛化关联。引用 12 inbox
Martin Weyssow, Xin Zhou, Kisub Kim, David Lo, Houari Sahraoui
crossref: 2026-09-12dblp: 2026-09-12arxiv: 2026-09-12

AI 速览

一句话:研究持续学习缓解代码预训练模型在API演化流上的灾难性遗忘,实现分布外泛化。

代码预训练语言模型通常采用预训练-微调范式,但真实软件代码库随时间演化,微调与测试数据分布不一致,导致模型在动态API环境下性能下降。本文指出需让代码PLM适应非平稳软件数据,并构建了一个软件演化式流式学习场景:模型需从不断出现新API的程序流中学习。作者在GPT2解码器与RoBERTa编码器两种架构上,针对API调用与API用法预测两个下游任务,比较常规微调与五种持续学习方法(基于回放和正则化)。结果表明,常用微调技术会引发灾难性遗忘,而简单的持续学习方法能有效缓解该问题,并取得相当或更优的性能。

问题
代码预训练语言模型在真实软件演化场景下面临预训练与测试数据分布偏移,常规微调会丢失已学知识并造成灾难性遗忘。
方法
设计含新API流式出现的软件演化场景,在GPT2与RoBERTa上针对API调用和API用法预测,实现并比较回放与正则化等五种持续学习方法。
评估
在两种模型架构和两个下游任务上对比常规微调与持续学习方法的性能及遗忘程度,验证其缓解灾难性遗忘并保持或提升效果。
原文摘要(Abstract)

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.

链接与引用

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

BibTeX
@inproceedings{WeyssowZK0S23,
  title = {On the Usage of Continual Learning for Out-of-Distribution Generalization in Pre-trained Language Models of Code},
  author = {Martin Weyssow and Xin Zhou and Kisub Kim and David Lo and Houari Sahraoui},
  booktitle = {FSE},
  year = {2023},
  doi = {10.1145/3611643.3616244}
}