arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2307.02435cs.LGcs.CLcs.SE

探索代码生成模型的持续学习

Exploring Continual Learning for Code Generation Models

University of North Carolina Chapel Hill(北卡罗来纳大学教堂山分校);AWS AI Labs(AWS人工智能实验室);Amazon Alexa AI(亚马逊Alexa人工智能部门)

Prateek Yadav, Qing Sun, Hantian Ding, Xiaopeng Li, Dejiao Zhang, Ming Tan, Xiaofei Ma, Parminder Bhatia, Ramesh Nallapati, Murali Krishna Ramanathan, Mohit Bansal, Bing Xiang

AI总结:

本文提出 CodeTask-CL 基准和 PP-TF 方法,通过稳定提示选择机制缓解代码生成模型持续学习中的灾难性遗忘,并取得 21.54% 的性能提升。

摘要:

大规模代码生成模型(如 Codex 和 CodeT5)已经取得了令人瞩目的性能。然而,库的升级或弃用非常频繁,重新训练大规模语言模型的计算成本高昂。因此,持续学习(Continual Learning, CL)是代码领域中一个尚未被充分探索的重要方面。在本文中,我们引入了一个名为 CodeTask-CL 的基准,它涵盖了广泛的任务,包括代码生成、翻译、摘要和精炼,并涉及不同的输入和输出编程语言。接下来,在我们的 CodeTask-CL 基准上,我们比较了来自 NLP 和视觉领域的流行持续学习技术。我们发现,像 Prompt Pooling (PP) 这样的有效方法由于编码任务中剧烈的分布偏移导致提示选择机制训练不稳定,从而遭受灾难性遗忘。我们通过提出的方法——带有教师强制(Teacher Forcing)的 Prompt Pooling(PP-TF)——来解决这一问题,该方法通过对提示选择机制施加约束来稳定训练,并比 Prompt Pooling 实现了 21.54% 的提升。除了基准之外,我们还建立了一个可用于代码模型持续学习的训练流程,我们相信这可以激励代码模型持续学习方法的进一步发展。我们的代码可在 https://github.com/amazon-science/codetaskcl-pptf 获取。

英文摘要:

Large-scale code generation models such as Codex and CodeT5 have achieved impressive performance. However, libraries are upgraded or deprecated very frequently and re-training large-scale language models is computationally expensive. Therefore, Continual Learning (CL) is an important aspect that remains underexplored in the code domain. In this paper, we introduce a benchmark called CodeTask-CL that covers a wide range of tasks, including code generation, translation, summarization, and refinement, with different input and output programming languages. Next, on our CodeTask-CL benchmark, we compare popular CL techniques from NLP and Vision domains. We find that effective methods like Prompt Pooling (PP) suffer from catastrophic forgetting due to the unstable training of the prompt selection mechanism caused by stark distribution shifts in coding tasks. We address this issue with our proposed method, Prompt Pooling with Teacher Forcing (PP-TF), that stabilizes training by enforcing constraints on the prompt selection mechanism and leads to a 21.54% improvement over Prompt Pooling. Along with the benchmark, we establish a training pipeline that can be used for CL on code models, which we believe can motivate further development of CL methods for code models. Our code is available at https://github.com/amazon-science/codetaskcl-pptf

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

↑