paperbot · PL 论文追踪

全部论文 待读 收藏

P2 AACEGEN: Attention Guided Adversarial Code Example Generation for Deep Code Models

AACEGEN:注意力引导的深度代码模型对抗样例生成
ASE Proceedings of the 39th IEEE/ACM International Conference on Automated Software Engineering2024匹配度 2/10 · 该论文聚焦于对深度代码模型进行对抗样例生成与鲁棒性测试,属于「用程序变换攻击/检验模型」的方向,与用户关心的静态分析应用于 ML/Agentic 程序、LLM 辅助形式化验证、浮点或贝叶斯程序分析均无直接交集;仅共享「机器学习与程序语言交叉」这一宽泛标签。引用 12 inbox
Zhong Li, Chong Zhang, Minxue Pan, Tian Zhang, Xuandong Li
crossref: 2026-09-12dblp: 2026-09-12

AI 速览

一句话:提出注意力引导的对抗代码样例生成方法,借助模型注意力分布定位关键代码元素,在语义保持变换约束下高效生成自然隐蔽的对抗样例。

对抗代码样例对考察深度代码模型的鲁棒性至关重要。现有生成工作虽已取得一定效果,但因需要大量调用模型、或生成的样例自然性不足,难以落地于实际应用。本文提出 AaceGEN,一种注意力引导的对抗代码样例生成方法。其核心思想是利用深度代码模型内部的注意力分布来指导生成过程:对模型预测起关键作用的代码元素被优先探索,从而同时提升对抗样例生成的有效性与效率。此外,AaceGEN 实现了一个代码变换库,为各类代码元素提供多样的语义保持变换,并在允许的最大变换次数约束下进行搜索,使生成的对抗样例兼具细微性与隐蔽性。作者在 9 个涵盖不同软件工程任务和多种深度代码模型的被测对象上开展大量实验,综合评估表明 AaceGEN 优于 3 种基线方法。

问题
现有对抗代码样例生成方法要么需要大量调用模型,要么生成的样例自然性不足,难以满足实际应用需求。
方法
利用深度代码模型的注意力分布优先探索对预测关键的代码元素,并结合提供多种语义保持变换的代码变换库,在最大变换次数约束下进行搜索生成对抗样例。
评估
在 9 个覆盖不同软件工程任务与多种深度代码模型的被测对象上,与 3 种基线方法进行综合对比实验,AaceGEN 均取得更优表现。
原文摘要(Abstract)

Adversarial code examples are important to investigate the robustness of deep code models. Existing work on adversarial code example generation has shown promising results yet still falls short in practical applications due to either the high number of model invocations or the limited naturalness of generated examples. In this paper, we propose AaceGEN, an attention-guided adversarial code example generation method for deep code models. The key idea of AaceGEN is to utilize the attention distributions behind deep code models to guide the generation of adversarial code examples. As such, the code elements critical for model predictions could be prioritized for exploration, enhancing the effectiveness and efficiency of adversarial code example generation. In addition, AaceGEN implements a code transformation library providing diverse semantic-preserving code transformations for various code elements, and further conducts a search under the constraint of a maximum number of allowable code transformations to generate adversarial code examples with subtlety and stealth. Our extensive experiments on 9 diverse subjects, taking into account different software engineering tasks and varied deep code models, demonstrate that AaceGEN outperforms 3 baseline approaches under comprehensive evaluation.CCS CONCEPTS• Software and its engineering → Software testing and debugging; Search-based software engineering; • Computing methodologies → Neural networks.

链接与引用

DOI 原文 · DBLP

BibTeX
@inproceedings{LiZP0L24,
  title = {AACEGEN: Attention Guided Adversarial Code Example Generation for Deep Code Models},
  author = {Zhong Li and Chong Zhang and Minxue Pan and Tian Zhang and Xuandong Li},
  booktitle = {ASE},
  year = {2024},
  doi = {10.1145/3691620.3695500}
}