Mutual Learning-Based Framework for Enhancing Robustness of Code Models via Adversarial Training
Deep code models (DCMs) have achieved impressive accomplishments and have been widely applied to various code-related tasks. However, existing studies show that some DCMs have poor robustness, and even small noise in the input data can lead to erroneous outputs. This phenomenon can seriously hinder the application of these DCMs in real-world scenarios. To address this limitation, we propose MARVEL, a mutual learning-based framework for enhancing the robustness of DCMs via adversarial training. Specifically, MARVEL initializes two identical DCMs, one of which receives Gaussian-distorted data and performs adversarial training, and the other receives the clean data. Then these two DCMs work together to not only fit the true labels but also fit each other's internal parameters. Our intuition is that the DCM can enhance robustness by training noisy data, while the DCM achieves accurate prediction performance by learn the clean data. Their mutual learning enables the DCM to balance both robustness and predictive performance.
Authors
- Yizhou Chen (ORCID: https://orcid.org/0000-0003-1821-3170)
- Yifan Zhao (ORCID: https://orcid.org/0000-0002-2035-0791)
- Y.Y. Wang
- Dan Hao (ORCID: https://orcid.org/0000-0001-8295-303X)
- Junjie Chen (ORCID: https://orcid.org/0000-0003-3056-9962)
- Zhihao Gong (ORCID: https://orcid.org/0009-0003-5318-8473)
Institutions
- Tianjin University (CN)
- Peking University (CN)
Publication Details
- Published
- 2024-10-18
- DOI
- https://doi.org/10.1145/3691620.3695519
- Primary Topic
- Adversarial Robustness in Machine Learning
- Type
- article
- Field-Weighted Citation Impact
- 0.00