arXiv · 2609.26234
Towards Effective Black-Box Adversarial Attacks on Deep Code Models via Structural and Identifier Perturbations
Abstract
Deep code models (DCMs) are increasingly embedded in code intelligence tasks. However, their robustness under adversarial attacks remains insufficiently understood. Prior black-box attacks mainly rely on identifier- only substitutions or structural edits transferred from reference samples, yielding perturbation spaces defined largely independently of the attacked input. We introduce Strike, an input-conditioned black-box adversarial robustness-testing framework that constructs and searches a hierarchical perturbation space for each input. Strike first partitions code into blocks and uses an LLM to generate context-specific structural candidates, filtered for syntactic validity, ranked by similarity, and adaptively combined. It then refines the best structural variant through similarity-guided identifier substitutions drawn from dynamically constructed candidate pools. Evaluations across representative code intelligence tasks, including clone detection, vulnerability detection, and code summarization, demonstrate that Strike achieves higher attack success rates with competitive target- model query overhead. Strategy-specific static checks across all three tasks and execution-based validation on the executable Juliet vulnerability-detection subset provide complementary, task-bounded evidence regarding the validity of the generated variants. Representation similarity and human evaluation further indicate that the variants remain highly similar to the original code and contextually natural. Fine-tuning with Strike- generated samples improves cross-attack performance on fixed perturbed evaluation sets while preserving clean performance.
Explore related subjects
Keep this discovery
Explore connections, maps & timelines
Bin Duan, Jintao Lin, Dan Dongseong Kim, Guowei Yang. 2026-08-12. Towards Effective Black-Box Adversarial Attacks on Deep Code Models via Structural and Identifier Perturbations. https://arxiv.org/abs/2609.26234
Cite the original work for its findings. Save a collection to share your selection of sources.