一句话:提出 ITGen,利用失败攻击反馈与增强贝叶斯优化迭代生成黑盒对抗样本,提高深度代码模型攻击成功率与效率。
深度代码模型易受对抗攻击,语义相同输入可能触发不同响应。现有黑盒方法依据自定义重要性分数或程序上下文逐步替换标识符,未充分利用失败攻击反馈,易陷入局部最优且效率低。本文提出 ITGen,一种迭代利用失败攻击反馈改进生成的黑盒对抗样本方法。它用位向量表示代码变体以缓解局部最优,并结合失败反馈与增强贝叶斯优化预测高潜力变体,缩小搜索空间。在九个深度代码模型的理解与生成任务上实验表明,ITGen 有效且高效,并可通过对抗微调提升鲁棒性;平均攻击成功率较 ALERT 和 BeamAttack 分别提高 47.98% 和 69.70%。
Deep code models are vulnerable to adversarial attacks, making it possible for semantically identical inputs to trigger different responses. Current black-box attack methods typically prioritize the impact of identifiers on the model based on custom importance scores or program context and incrementally replace identifiers to generate adversarial examples. However, these methods often fail to fully leverage feedback from failed attacks to guide subsequent attacks, resulting in problems such as local optima bias and efficiency dilemmas. In this paper, we introduce ITGen, a novel black-box adversarial example generation method that iteratively utilizes feedback from failed attacks to refine the generation process. It employs a bitvectorbased representation of code variants to mitigate local optima bias. By integrating these bit vectors with feedback from failed attacks, ITGen uses an enhanced Bayesian optimization framework to efficiently predict the most promising code variants, significantly reducing the search space and thus addressing the efficiency dilemma. We conducted experiments on a total of nine deep code models for both understanding and generation tasks, demonstrating ITGen's effectiveness and efficiency, as well as its ability to enhance model robustness through adversarial finetuning. For example, on average, ITGen improves the attack success rate by 47.98 % and 69.70 % over the state-of-the-art techniques (i.e., ALERT and BeamAttack), respectively.
DOI 原文 ·
@inproceedings{paperbot8873,
title = {Iterative Generation of Adversarial Example for Deep Code Models},
author = {Li Huang and Weifeng Sun and Meng Yan},
booktitle = {ICSE},
year = {2025},
doi = {10.1109/icse55347.2025.00086}
}