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

Zeming Dong, Qiang Hu, Xiaofei Xie, Maxime Cordy, Mike Papadakis +2 more
2/24/2024
cs.SEcs.AI

No official code found. Best implementation: zemingd/GenCode (1 star, last commit 2026-01-26).

Abstract

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.

View on arXivView PDF

Code Implementations(1)

zemingd/GenCodeCommunity71%

[EMSE 2026] GenCode: A Generic Data Augmentation Framework for Boosting Deep Learning-Based Code Understanding

11Shell, PythonNov 20, 20258 months ago

Similar Papers

Cite this paper

@article{dong2024gencode,
  title  = {GenCode: A Generic Data Augmentation Framework for Boosting Deep Learning-Based Code Understanding},
  author = {Zeming Dong and Qiang Hu and Xiaofei Xie and Maxime Cordy and Mike Papadakis and Yves Le Traon and Jianjun Zhao},
  year   = {2024},
  eprint = {2402.15769},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2402.15769v3}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2402.15769.svg)](https://codeofpaper.com/paper/2402.15769)

Discussion