mlsanityData to 7 Oct 2026

CodeAttack: Code-Based Adversarial Attacks for Pre-trained Programming Language Models

arXiv 2206.00052 ↗First posted 31 May 2022cs.CL cs.CRcited by 48

Not on the map. Why?

Abstract (arXiv)

Pre-trained programming language (PL) models (such as CodeT5, CodeBERT, GraphCodeBERT, etc.,) have the potential to automate software engineering tasks involving code understanding and code generation. However, these models operate in the natural channel of code, i.e., they are primarily concerned with the human understanding of the code. They are not robust to changes in the input and thus, are potentially susceptible to adversarial attacks in the natural channel. We propose, CodeAttack, a simple yet effective black-box attack model that uses code structure to generate effective, efficient, and imperceptible adversarial code samples and demonstrates the vulnerabilities of the state-of-the-art PL models to code-specific adversarial attacks. We evaluate the transferability of CodeAttack on several code-code (translation and repair) and code-NL (summarization) tasks across different programming languages. CodeAttack outperforms state-of-the-art adversarial NLP attack models to achieve the best overall drop in performance while being more efficient, imperceptible, consistent, and fluent. The code can be found at https://github.com/reddy-lab-code-research/CodeAttack.

Key facts. Cited by 48 papers in the map (data through 7 Oct 2026). Builds on 28 of its 43 references that are in the map. First posted on arXiv 31 May 2022.

Builds on

28 of 43 references.

References · 28

  1. 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,266
  2. 2018GLUE: A Multi-Task Benchmark and Analysis Platform for Natural Language Understandingcited by 4,854
  3. 2016SQuAD: 100,000+ Questions for Machine Comprehension of Textcited by 4,115
  4. 2016Google's Neural Machine Translation System: Bridging the Gap between Human and Machine Translationcited by 1,471
  5. 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
  6. 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 890
  7. 2017RACE: Large-scale ReAding Comprehension Dataset From Examinationscited by 851
  8. 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 732
  9. 2019Is BERT Really Robust? A Strong Baseline for Natural Language Attack on Text Classification and Entailmentcited by 663
  10. 2019CodeSearchNet Challenge: Evaluating the State of Semantic Code Searchcited by 638
  11. 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 600
  12. 2020BERT-ATTACK: Adversarial Attack Against BERT Using BERTcited by 488
16 more
  1. 2020CodeBLEU: a Method for Automatic Evaluation of Code Synthesiscited by 468
  2. 2018Generating Natural Language Adversarial Examplescited by 422
  3. 2018TextBugger: Generating Adversarial Text Against Real-world Applicationscited by 376
  4. 2021Unified Pre-training for Program Understanding and Generationcited by 361
  5. 2018Black-box Generation of Adversarial Text Sequences to Evade Deep Learning Classifierscited by 341
  6. 2020BAE: BERT-based Adversarial Examples for Text Classificationcited by 316
  7. 2019Devign: Effective Vulnerability Identification by Learning Comprehensive Program Semantics via Graph Neural Networkscited by 266
  8. 2019Combating Adversarial Misspellings with Robust Word Recognitioncited by 162
  9. 2016Technical Report on the CleverHans v2.1.0 Adversarial Examples Librarycited by 123
  10. 2018An Empirical Study on Learning Bug-Fixing Patches in the Wild via Neural Machine Translationcited by 106
  11. 2022Natural Attack for Pre-trained Models of Codecited by 72
  12. 2021DOBF: A Deobfuscation Pre-Training Objective for Programming Languagescited by 68
  13. 2019Adversarial Examples for Models of Codecited by 61
  14. 2020Semantic Robustness of Models of Source Codecited by 43
  15. 2018Greedy Attack and Gumbel Attack: Generating Adversarial Examples for Discrete Datacited by 37
  16. 2021Adversarial Robustness of Deep Code Comment Generationcited by 22

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2022: 2; 2023: 8; 2024: 9; 2025: 21; 2026: 8.

48 papers.

Sort:

By area:

  1. 2023WizardCoder: Empowering Code Large Language Models with Evol-Instructcited by 728
  2. 2022ReCode: Robustness Evaluation of Code Generation Modelscited by 100
  3. 2023Execution-based Code Generation using Deep Reinforcement Learningcited by 95
  4. 2023Transformers Meet Directed Graphscited by 39
  5. 2023DeceptPrompt: Exploiting LLM-driven Code Generation via Adversarial Natural Language Instructionscited by 31
  6. 2023Vulnerabilities in AI Code Generators: Exploring Targeted Data Poisoning Attackscited by 29
  7. 2023Trustworthy and Synergistic Artificial Intelligence for Software Engineering: Vision and Roadmapscited by 19
  8. 2025Diagnosing and Mitigating Modality Interference in Multimodal Large Language Modelscited by 18
  9. 2024Do Large Code Models Understand Programming Concepts? Counterfactual Analysis for Code Predicatescited by 14
  10. 2024What can Large Language Models Capture about Code Functional Equivalence?cited by 13
  11. 2024Software Vulnerability and Functionality Assessment using LLMscited by 11
  12. 2022Unveiling Code Pre-Trained Models: Investigating Syntax and Semantics Capacitiescited by 9
36 more
  1. 2024Token Alignment via Character Matching for Subword Completioncited by 9
  2. 2024FLRT: Fluent Student-Teacher Redteamingcited by 9
  3. 2025RedCodeAgent: Automatic Red-teaming Agent against Diverse Code Agentscited by 9
  4. 2025Why Not Act on What You Know? Unleashing Safety Potential of LLMs via Self-Aware Guard Enhancementcited by 8
  5. 2025RedCoder: Automated Multi-Turn Red Teaming for Code LLMscited by 8
  6. 2025Evolve the Method, Not the Prompts: Evolutionary Synthesis of Jailbreak Attacks on LLMscited by 7
  7. 2024Adversarial Training: A Surveycited by 6
  8. 2025NEXUS: Network Exploration for eXploiting Unsafe Sequences in Multi-Turn LLM Jailbreakscited by 6
  9. 2025Evaluating and Improving Robustness in Large Language Models: A Survey and Future Directionscited by 5
  10. 2025MOCHA: Are Code Language Models Robust Against Multi-Turn Malicious Coding Prompts?cited by 5
  11. 2026ICON: Intent-Context Coupling for Efficient Multi-Turn Jailbreak Attackcited by 5
  12. 2024CodeFort: Robust Training for Code Generation Modelscited by 4
  13. 2025XOXO: Stealthy Cross-Origin Context Poisoning Attacks against AI Coding Assistantscited by 4
  14. 2025Evaluate-and-Purify: Fortifying Code Language Models Against Adversarial Attacks Using LLM-as-a-Judgecited by 4
  15. 2025MUSE: MCTS-Driven Red Teaming Framework for Enhanced Multi-Turn Dialogue Safety in Large Language Modelscited by 4
  16. 2025A Systematic Study of Code Obfuscation Against LLM-based Vulnerability Detectioncited by 4
  17. 2026State-Dependent Safety Failures in Multi-Turn Language Model Interactioncited by 4
  18. 2023A Black-Box Attack on Code Models via Representation Nearest Neighbor Searchcited by 3
  19. 2023Enhancing Robustness of AI Offensive Code Generators via Data Augmentationcited by 3
  20. 2025Smaller = Weaker? Benchmarking Robustness of Quantized LLMs in Code Generationcited by 3
  21. 2025Paper Summary Attack: Jailbreaking LLMs through LLM Safety Paperscited by 3
  22. 2025HarmNet: A Framework for Adaptive Multi-Turn Jailbreak Attacks on Large Language Modelscited by 3
  23. 2026HogVul: Black-box Adversarial Code Generation Framework Against LM-based Vulnerability Detectorscited by 3
  24. 2026DRAINCODE: Stealthy Energy Consumption Attacks on Retrieval-Augmented Code Generation via Context Poisoningcited by 3
  25. 2024Compressed models are NOT miniature versions of large modelscited by 2
  26. 2025Adversarial Defence without Adversarial Defence: Enhancing Language Model Robustness via Instance-level Principal Component Removalcited by 2
  27. 2025AutoRed: A Free-form Adversarial Prompt Generation Framework for Automated Red Teamingcited by 1
  28. 2024Studying Vulnerable Code Entities in Rcited by 0
  29. 2025Cross-site scripting adversarial attacks based on deep reinforcement learning: Evaluation and extension studycited by 0
  30. 2025SDGO: Self-Discrimination-Guided Optimization for Consistent Safety in Large Language Modelscited by 0
  31. 2025Pluralistic Behavior Suite: Stress-Testing Multi-Turn Adherence to Custom Behavioral Policiescited by 0
  32. 2025SoK: Understanding (New) Security Issues Across AI4Code Use Casescited by 0
  33. 2026When Efficiency Backfires: Cascading LLMs Trigger Cascade Failure under Adversarial Attackcited by 0
  34. 2026A Jagged Frontier: Evaluating Robustness of Code Agents to Semantics-Preserving Transformationscited by 0
  35. 2026Representational alignment yields generalizable safety in language modelscited by 0
  36. 2026CS-Guard: Benchmarking LLM Guardrails for Code Generation Securitycited by 0