一句话:提出 REPEAT,通过代表性样本回放与自适应参数正则化实现代码智能模型的持续学习,缓解灾难性遗忘。
代码智能研究通常以离线方式在固定数据集上训练深度模型,但现实中新的代码仓库不断涌现,模型需要持续吸收新知识并提供最新服务。本文关注的问题是:如何让代码智能模型从不断增长的数据中持续学习?核心挑战是灾难性遗忘,即模型学习新数据时容易遗忘旧数据上的知识。为此,作者提出 REPEAT,结合代表性样本回放与自适应参数正则化。前者在每个数据集中选取有信息量且多样的样本,并周期性重训模型;后者识别模型中的重要参数,并自适应惩罚其变化,以保留旧知识。作者在代码摘要、软件漏洞检测和代码克隆检测三个任务上评估,实验表明 REPEAT 始终优于基线方法;相较于常规微调方法,分别提升 1.22、5.61 和 1.72。
Previous research on code intelligence usually trains a deep learning model on a fixed dataset in an offline manner. However, in real-world scenarios, new code repositories emerge incessantly, and the carried new knowledge is beneficial for providing up-to-date code intelligence services to developers. In this paper, we aim at the following problem: How to enable code intelligence models to continually learn from ever-increasing data? One major challenge here is catastrophic forgetting, meaning that the model can easily forget knowledge learned from previous datasets when learning from the new dataset. To tackle this challenge, we propose REPEAT, a novel method for continual learning of code intelligence models. Specifically, REPEAT addresses the catastrophic forgetting problem with representative exemplars replay and adaptive parameter regularization. The representative exemplars replay component selects informative and diverse exemplars in each dataset and uses them to re-train model periodically. The adaptive parameter regularization component recognizes important parameters in the model and adaptively penalizes their changes to preserve the knowledge learned before. We evaluate the proposed approach on three code intelligence tasks including code summarization, software vulnerability detection, and code clone detection. Extensive experiments demonstrate that REPEAT consistently outperforms baseline methods on all tasks. For example, REPEAT improves the conventional fine-tuning method by 1.22, 5.61, and 1.72 on code summarization, vulnerability detection and clone detection, respectively.
DOI 原文 · arXiv · PDF(开放获取) · DBLP
@inproceedings{GaoZGW23,
title = {Keeping Pace with Ever-Increasing Data: Towards Continual Learning of Code Intelligence Models},
author = {Shuzheng Gao and Hongyu Zhang and Cuiyun Gao and Chaozheng Wang},
booktitle = {ICSE},
year = {2023},
doi = {10.1109/icse48619.2023.00015}
}