Lune

EMNLP Findings2023

A Black-Box Attack on Code Models via Representation Nearest Neighbor Search

Jie Zhang, Wei Ma, Qiang Hu, Shangqing Liu, Xiaofei Xie, Yves Le Traon, Yang Liu

摘要

Existing methods for generating adversarial code examples face several challenges: limited availability of substitute variables, high verification costs for these substitutes, and the creation of adversarial samples with noticeable perturbations. To address these concerns, our proposed approach, RNNS, uses a search seed based on historical attacks to find potential adversarial substitutes. Rather than directly using the discrete substitutes, they are mapped to a continuous vector space using a pre-trained variable name encoder. Based on the vector representation, RNNS predicts and selects better substitutes for attacks. We evaluated the performance of RNNS across six coding tasks encompassing three programming languages: Java, Python, and C. We employed three pre-trained code models (Code-BERT, GraphCodeBERT, and CodeT5) that resulted in a cumulative of 18 victim models. The results demonstrate that RNNS outperforms baselines in terms of ASR and QT. Furthermore, the perturbation of adversarial examples introduced by RNNS is smaller compared to the baselines in terms of the number of replaced variables and the change in variable length. Lastly, our experiments indicate that RNNS is efficient in attacking defended models and can be employed for adversarial training.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 5 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Mutual Learning-Based Framework for Enhancing Robustness of Code Models via Adversarial Training 引用了 CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generation
  • Mutual Learning-Based Framework for Enhancing Robustness of Code Models via Adversarial Training 引用了 CodeBERT: A Pre-Trained Model for Programming and Natural Languages
  • Mutual Learning-Based Framework for Enhancing Robustness of Code Models via Adversarial Training 引用了 GraphCodeBERT: Pre-training Code Representations with Data Flow
  • CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generation 引用了 CodeBERT: A Pre-Trained Model for Programming and Natural Languages
  • Attribution-guided Adversarial Code Prompt Generation for Code Completion Models 引用了 CodeBERT: A Pre-Trained Model for Programming and Natural Languages
  • Attribution-guided Adversarial Code Prompt Generation for Code Completion Models 引用了 GraphCodeBERT: Pre-training Code Representations with Data Flow
  • SAGE: Signal-Amplified Guided Embeddings for Vulnerability Detection 引用了 CodeBERT: A Pre-Trained Model for Programming and Natural Languages
  • Iterative Generation of Adversarial Example for Deep Code Models 引用了 CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generation
  • Iterative Generation of Adversarial Example for Deep Code Models 引用了 CodeBERT: A Pre-Trained Model for Programming and Natural Languages
  • Iterative Generation of Adversarial Example for Deep Code Models 引用了 GraphCodeBERT: Pre-training Code Representations with Data Flow
  • Iterative Generation of Adversarial Example for Deep Code Models 引用了 Retrieval-Augmented Generation for Code Summarization via Hybrid GNN
  • XOXO: Stealthy Cross-Origin Context Poisoning Attacks against AI Coding Assistants 引用了 CodeBERT: A Pre-Trained Model for Programming and Natural Languages
  • XOXO: Stealthy Cross-Origin Context Poisoning Attacks against AI Coding Assistants 引用了 GraphCodeBERT: Pre-training Code Representations with Data Flow
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper5

  1. Attribution-guided Adversarial Code Prompt Generation for Code Completion ModelsXueyang Li, Guozhu Meng, Shangqing Liu, Lu Xiang 等ASE 2024 · 5 次引用
  2. XOXO: Stealthy Cross-Origin Context Poisoning Attacks against AI Coding AssistantsAdam Storek, Mukur Gupta, Noopur Bhatt, Aditya Gupta 等ACL 2026 · 5 次引用
  3. Mutual Learning-Based Framework for Enhancing Robustness of Code Models via Adversarial TrainingYangsen Wang, Yizhou Chen, Yifan Zhao, Zhihao Gong 等ASE 2024 · 3 次引用
  4. Iterative Generation of Adversarial Example for Deep Code ModelsLi Huang, Weifeng Sun, Meng YanICSE 2025 · 1 次引用
  5. SAGE: Signal-Amplified Guided Embeddings for Vulnerability DetectionZhengyang Shan, Xu Qian, Jiayun Xin, Minghui Xu 等ISSTA 2026

它引用的 Paper12

  1. CodeBERT: A Pre-Trained Model for Programming and Natural LanguagesZhangyin Feng, Daya Guo, Duyu Tang, Nan Duan 等EMNLP Findings 2020 · 2,828 次引用
  2. GraphCodeBERT: Pre-training Code Representations with Data FlowDaya Guo, Shuo Ren, Shuai Lu, Zhangyin Feng 等ICLR 2021 · 1,644 次引用
  3. CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and GenerationYue Wang, Weishi Wang, Shafiq R. Joty, Steven C. H. HoiEMNLP 2021 · 1,224 次引用
  4. Retrieval-Augmented Generation for Code Summarization via Hybrid GNNShangqing Liu, Yu Chen, Xiaofei Xie, Jing Kai Siow 等ICLR 2021 · 194 次引用
  5. Word-level Textual Adversarial Attacking as Combinatorial OptimizationYuan Zang, Fanchao Qi, Chenghao Yang, Zhiyuan Liu 等ACL 2020 · 188 次引用

相关 Paper

  1. Adversarial examples for models of codeNoam Yefet, Uri Alon, Eran YahavOOPSLA 2020 · 162 次引用
  2. ContraBERT: Enhancing Code Pre-trained Models via Contrastive LearningShangqing Liu, Bozhi Wu, Xiaofei Xie, Guozhu Meng 等ICSE 2023 · 56 次引用
  3. Discrete Adversarial Attack to Models of CodeFengjuan Gao, Yu Wang, Ke WangPLDI 2023 · 23 次引用
  4. Natural Attack for Pre-trained Models of CodeZhou Yang, Jieke Shi, Junda He, David LoICSE 2022 · 150 次引用
  5. DIP: Dead code Insertion based Black-box Attack for Programming Language ModelCheolWon Na, YunSeok Choi, Jee-Hyong LeeACL 2023 · 13 次引用
黄昏的海面,两侧是细线勾勒的悬崖