Research map / Adversarial robustness and security / Black-box and transfer attacks
A Black-Box Attack on Code Models via Representation Nearest Neighbor Search
Jie Zhang, Qiang Hu, Shangqing Liu, Xiaofei Xie, Yves Le Traon, Yang Liu
Nanyang Technological University · Huawei · Singapore Management University · University of Luxembourg
Read the paperPlace an idea next to itCheck your own paper ↗
13measured effects
7improved
2hurt
4mixed
AI-extracted. The measured effects below were read by AI from the paper's full text (no summary yet). Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.
Measured effects reported in the paper
| What was changed | Where | Measured | Effect |
|---|---|---|---|
| Replace ALERT/MHM substitute search with RNNS | MHM/ALERT · Clone + GraphCodeBERT | ASR (%): 10.40 (ALERT), 9.58 (MHM) -> 41.28 | Improved |
| Use RNNS instead of ALERT/MHM across all tasks and models | ALERT, MHM · 18 victim models | ASR (%): RNNS best ASR in 18/18 | Improved |
| Use RNNS instead of ALERT/MHM | ALERT, MHM · 18 victim models | query times (QT): RNNS lowest QT in 8/18; ALERT 4/18, MHM 6/18 | Mixed |
| Remove the similarity and length search constraints (RNNS-Unlimited) (ablation) | RNNS · six tasks x three models | ASR (%): ASR gain between about 2% and 8.35%; e.g. Authorship+CodeBERT 73.39 -> 91.74 | Improved |
| Remove the similarity and length search constraints (RNNS-Unlimited) (ablation) | RNNS · six tasks x three models | QT: RNNS-Unlimited loses on QT 3 times among 18 evaluations | Mixed |
| Use RNNS instead of MHM | MHM · replaced-variable length difference | mean absolute length difference: MHM 3.39-6.82 vs RNNS 2.02-2.54 | Improved |
| Use RNNS instead of ALERT | ALERT · replaced-variable length difference | mean absolute length difference: RNNS 2.02-2.54 vs ALERT mostly about 0.6-1.5 (some 4.10-4.74) | Hurt |
| Use RNNS instead of MHM/ALERT | MHM, ALERT · number of replaced variables | average replaced variables: RNNS about 3.6 vs MHM about 5.4 | Improved |
| Use RNNS instead of PSO | PSO · Defect/Authorship/Java250 + CodeBERT | ASR (%): ASR 5.55%-27.82% higher than PSO; QT of PSO 4.22-6.7 times RNNS | Improved |
| Use RNNS instead of LSH | LSH · Defect/Authorship/Java250 + CodeBERT | ASR (%): RNNS ASR higher by 42.56%-54.13%; LSH QT lower (RNNS QT 1.8-2.2 times LSH) | Mixed |
| Attack adversarially fine-tuned models with RNNS vs MHM | MHM · Defended CodeBERT models (Clone, Defect, Authorship) | ASR (%): Clone 28.17 (MHM) vs 12.90; Defect 92.23 vs 95.37; Authorship 43.26 vs 51.88 | Mixed |
| Retrain CodeBERT with RNNS adversarial examples via contrastive adversarial learning | CodeBERT · Defect/Authorship/Java250 | ASR (%): retrained models reach much lower ASR (RNNS ASR 40.46 on Defect, 19.81 Authorship, 19.67 Java250) | Improved |
Closest papers by meaning
- CodeAttack: Code-Based Adversarial Attacks for Pre-trained Programming Language Models (AAAI 2023 · similarity 0.89)
- Evaluating and Enhancing the Robustness of Code Pre-trained Models through Structure-Aware Adversarial Samples Generation (EMNLP 2023 · similarity 0.88)
- Vulnerable Code Search: Transferable Attack for Code Language Models (EMNLP 2026 · similarity 0.87)
- Adversarial Robustness for Code (ICML 2020 · similarity 0.87)
- Improved Generation of Adversarial Examples Against Safety-aligned LLMs (NeurIPS 2024 · similarity 0.85)
- AttackBench: Evaluating Gradient-based Attacks for Adversarial Examples (AAAI 2025 · similarity 0.84)
Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.
