与不断增长的数据保持同步:代码智能模型的持续学习
Keeping Pace with Ever-Increasing Data: Towards Continual Learning of Code Intelligence Models
摘要:
以前关于代码智能的研究通常以离线方式在固定数据集上训练深度学习模型。然而,在现实世界的场景中,新的代码库不断涌现,所携带的新知识有利于为开发人员提供最新的代码智能服务。在本文中,我们针对以下问题:如何使代码智能模型不断学习不断增长的数据?这里的一个主要挑战是灾难性遗忘,这意味着模型在从新数据集学习时很容易忘记从以前数据集学习的知识。为了应对这一挑战,我们提出了重复,一种新的持续学习的代码智能模型的方法。具体而言,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 retrain 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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。