Return
AdvGen-X: Transferability driven adversarial example generation for pre-trained models of code
DOI:10.1007/s10664-026-10864-w.png)
Abstract
En 中文
Pre-trained models of code play an important role in software engineering. But they are vulnerable to adversarial examples which refer to examples that can mislead the target model to make incorrect predictions. Recent studies have shown that these adversarial examples can transfer from one model to another one. However, existing approaches can only generate adversarial examples from the target models themselves, failing to uncover transferable adversarial examples from other models, which could be exploited by attackers as a potential threat to target code models. In this paper, we propose AdvGen-X, an adversarial example generation method for pre-trained models of code from a transferable perspective. First, AdvGen-X utilizes robust student models by robustness-guided knowledge distillation as surrogate models of the target model. Then, AdvGen-X generates adversarial examples for surrogate models. Finally, AdvGen-X transfers adversarial examples of surrogate models to attack the target model. Experimental results on nine pre-trained models of code show that the attack success rates of baselines ALERT and CARROT based on AdvGen-X increased by an average of 16.26% and 17.98%, respectively. The time cost of ALERT and CARROT optimized using AdvGen-X are reduced by 63.74% and 66.58%.
Keywords:
Adversarial example generation
Pre-trained models of code
Knowledge distillation
Transferability
Journal
IF:
3.6
Papers:
2.0K
Citations:
5.3K

