arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2402.15769cs.SEcs.AI
收藏

GenCode:一种通用数据增强框架,用于提升基于深度学习的代码理解

GenCode: A Generic Data Augmentation Framework for Boosting Deep Learning-Based Code Understanding

University of Luxembourg(卢森堡大学);Tianjin University(天津大学);Singapore Management University(新加坡管理学院);Kyushu University(九州大学)

Zeming Dong, Qiang Hu, Xiaofei Xie, Maxime Cordy, Mike Papadakis, Yves Le Traon, Jianjun Zhao

AI总结:

GenCode通过生成与选择范式提升代码理解模型的训练效果,相比现有方法在准确率和鲁棒性上均有显著提升。

摘要:

预训练代码模型引领了代码智能的时代,多种模型展现出出色的性能。然而,一个重要的问题,即代码数据的数据增强,即自动帮助开发人员准备训练数据,尚在该领域缺乏研究。在本文中,我们介绍了一个通用的数据增强框架GenCode,以增强代码理解模型的训练。简而言之,GenCode遵循生成与选择的范式来准备有用的训练代码数据。具体来说,它采用代码增强技术生成新的代码候选者,然后通过影响分数识别出重要的作为训练数据。为了评估GenCode的有效性,我们在四个代码理解任务(例如代码克隆检测)和三个预训练代码模型(例如CodeT5)以及两个最近发布的代码专用大型语言模型(LLMs)(例如Qwen2.5-Coder)上进行了实验。与最先进的(SOTA)代码增强方法MixCode相比,GenCode在平均上产生了预训练代码模型,准确率提高了2.92%,对抗鲁棒性提高了4.90%。对于代码专用LLMs,GenCode在准确率和自然鲁棒性上平均提高了0.93%和0.98%。

英文摘要:

Pre-trained code models lead the era of code intelligence, with multiple models designed with impressive performance. However, one important problem, data augmentation for code data that automatically helps developers prepare training data lacks study in this field. In this paper, we introduce a generic data augmentation framework, GenCode, to enhance the training of code understanding models. Simply speaking, GenCode follows a generation-and-selection paradigm to prepare useful training code data. Specifically, it employs code augmentation techniques to generate new code candidates first and then identifies important ones as the training data by influence scores. To evaluate the effectiveness of GenCode, we conduct experiments on four code understanding tasks (e.g., code clone detection) and three pre-trained code models (e.g., CodeT5) and two recent released code-specific Large Language Models (LLMs) (e.g., Qwen2.5-Coder). Compared to the state-of-the-art (SOTA) code augmentation method MixCode, GenCode produces pre-trained code models with 2.92% higher accuracy and 4.90% adversarial robustness on average. For code-specific LLMs, GenCode achieves an average improvement of 0.93% in accuracy and 0.98% in natural robustness.

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

↑