Generating Adversarial Computer Programs using Optimized Obfuscations
Not on the map. Why?
Abstract (arXiv)
Machine learning (ML) models that learn and predict properties of computer programs are increasingly being adopted and deployed. These models have demonstrated success in applications such as auto-completing code, summarizing large programs, and detecting bugs and malware in programs. In this work, we investigate principled ways to adversarially perturb a computer program to fool such learned models, and thus determine their adversarial robustness. We use program obfuscations, which have conventionally been used to avoid attempts at reverse engineering programs, as adversarial perturbations. These perturbations modify programs in ways that do not alter their functionality but can be crafted to deceive an ML model when making a decision. We provide a general formulation for an adversarial program that allows applying multiple obfuscation transformations to a program in any language. We develop first-order optimization algorithms to efficiently determine two key aspects -- which parts of the program to transform, and what transformations to use. We show that it is important to optimize both these aspects to generate the best adversarially perturbed program. Due to the discrete nature of this problem, we also propose using randomized smoothing to improve the attack loss landscape to ease optimization. We evaluate our work on Python and Java programs on the problem of program summarization. We show that our best attack proposal achieves a 52% improvement over a state-of-the-art attack generation approach for programs trained on a seq2seq model. We further show that our formulation is better at training models that are robust to adversarial attacks.
Key facts. Cited by 20 papers in the map (data through 7 Oct 2026). Builds on 18 of its 38 references that are in the map. First posted on arXiv 18 Mar 2021.
Builds on
18 of 38 references.
References · 18
- 2014Explaining and Harnessing Adversarial Examplescited by 7,287
- 2017Towards Deep Learning Models Resistant to Adversarial Attackscited by 6,326
- 2016Towards Evaluating the Robustness of Neural Networkscited by 2,976
- 2019Devign: Effective Vulnerability Identification by Learning Comprehensive Program Semantics via Graph Neural Networkscited by 266
- 2017A Survey of Machine Learning for Big Code and Naturalnesscited by 220
- 2019Topology Attack and Defense for Graph Neural Networks: An Optimization Perspectivecited by 196
- 2018code2seq: Generating Sequences from Structured Representations of Codecited by 177
- 2016DeepCoder: Learning to Write Programscited by 145
- 2013Mini-batch Stochastic Approximation Methods for Nonconvex Stochastic Composite Optimizationcited by 142
- 2016A Convolutional Attention Network for Extreme Summarization of Source Codecited by 90
- 2018DeepBugs: A Learning Approach to Name-based Bug Detectioncited by 65
- 2019Adversarial Examples for Models of Codecited by 61
6 more
- 2020Semantic Robustness of Models of Source Codecited by 43
- 2020Adversarial Robustness for Codecited by 36
- 2018Evaluating and Understanding the Robustness of Adversarial Logit Pairingcited by 34
- 2019Misleading Authorship Attribution of Source Code using Adversarial Learningcited by 33
- 2019COSET: A Benchmark for Evaluating Neural Program Embeddingscited by 10
- 2020Evaluation of Generalizability of Neural Program Analyzers under Semantic-Preserving Transformationscited by 9
Built on by
Citing papers per year: 2022: 5; 2023: 8; 2024: 2; 2025: 3; 2026: 2.
20 papers.
Sort:
By area:
- 2023A Pilot Study of Query-Free Adversarial Attack against Stable Diffusioncited by 75
- 2023LILO: Learning Interpretable Libraries by Compressing and Documenting Codecited by 46
- 2023Uncovering the Limits of Machine Learning for Automatic Vulnerability Detectioncited by 30
- 2022Reverse Engineering of Imperceptible Adversarial Image Perturbationscited by 17
- 2022A Word is Worth A Thousand Dollars: Adversarial Attack on Tweets Fools Stock Predictionscited by 15
- 2022RoPGen: Towards Robust Code Authorship Attribution via Automatic Coding Style Transformationcited by 13
- 2023Do Large Language Models Pay Similar Attention Like Human Programmers When Generating Code?cited by 13
- 2023Turbulence: Systematically and Automatically Testing Instruction-Tuned Large Language Models for Codecited by 9
- 2023An Extensive Study on Adversarial Attack against Pre-trained Models of Codecited by 8
- 2024CodeFort: Robust Training for Code Generation Modelscited by 4
- 2025XOXO: Stealthy Cross-Origin Context Poisoning Attacks against AI Coding Assistantscited by 4
- 2023A Black-Box Attack on Code Models via Representation Nearest Neighbor Searchcited by 3
8 more
- 2022Semantic-Preserving Adversarial Code Comprehensioncited by 2
- 2022CLAWSAT: Towards Both Robust and Accurate Code Modelscited by 2
- 2023Transfer Attacks and Defenses for Large Language Models on Coding Taskscited by 2
- 2024EaTVul: ChatGPT-based Evasion Attack Against Software Vulnerability Detectioncited by 2
- 2025Semantic-Preserving Transformations as Mutation Operators: A Study on Their Effectiveness in Defect Detectioncited by 2
- 2025Auto-SPT: Automating Semantic Preserving Transformations for Codecited by 0
- 2026Prompt-Driven Code Summarization: A Systematic Literature Reviewcited by 0
- 2026A Jagged Frontier: Evaluating Robustness of Code Agents to Semantics-Preserving Transformationscited by 0
- 2026A Jagged Frontier: Evaluating Robustness of Code Agents to Semantics-Preserving Transformations18 Aug 2026
- 2026Prompt-Driven Code Summarization: A Systematic Literature Review16 Apr 2026
- 2025Auto-SPT: Automating Semantic Preserving Transformations for Code5 Dec 2025
- 2025Semantic-Preserving Transformations as Mutation Operators: A Study on Their Effectiveness in Defect Detection30 Mar 2025
- 2025XOXO: Stealthy Cross-Origin Context Poisoning Attacks against AI Coding Assistants18 Mar 2025
- 2024EaTVul: ChatGPT-based Evasion Attack Against Software Vulnerability Detection27 Jul 2024
- 2024CodeFort: Robust Training for Code Generation Models11 Apr 2024
- 2023Turbulence: Systematically and Automatically Testing Instruction-Tuned Large Language Models for Code22 Dec 2023
- 2023Transfer Attacks and Defenses for Large Language Models on Coding Tasks22 Nov 2023
- 2023An Extensive Study on Adversarial Attack against Pre-trained Models of Code13 Nov 2023
- 2023LILO: Learning Interpretable Libraries by Compressing and Documenting Code30 Oct 2023
- 2023Uncovering the Limits of Machine Learning for Automatic Vulnerability Detection28 Jun 2023
8 more
- 2023Do Large Language Models Pay Similar Attention Like Human Programmers When Generating Code?2 Jun 2023
- 2023A Black-Box Attack on Code Models via Representation Nearest Neighbor Search10 May 2023
- 2023A Pilot Study of Query-Free Adversarial Attack against Stable Diffusion29 Mar 2023
- 2022CLAWSAT: Towards Both Robust and Accurate Code Models21 Nov 2022
- 2022Semantic-Preserving Adversarial Code Comprehension12 Sep 2022
- 2022A Word is Worth A Thousand Dollars: Adversarial Attack on Tweets Fools Stock Predictions1 May 2022
- 2022Reverse Engineering of Imperceptible Adversarial Image Perturbations26 Mar 2022
- 2022RoPGen: Towards Robust Code Authorship Attribution via Automatic Coding Style Transformation12 Feb 2022
- 2023LILO: Learning Interpretable Libraries by Compressing and Documenting Codecited by 46
- 2023Uncovering the Limits of Machine Learning for Automatic Vulnerability Detectioncited by 30
- 2022Reverse Engineering of Imperceptible Adversarial Image Perturbationscited by 17
- 2022A Word is Worth A Thousand Dollars: Adversarial Attack on Tweets Fools Stock Predictionscited by 15
- 2022RoPGen: Towards Robust Code Authorship Attribution via Automatic Coding Style Transformationcited by 13
- 2023Do Large Language Models Pay Similar Attention Like Human Programmers When Generating Code?cited by 13
- 2023Turbulence: Systematically and Automatically Testing Instruction-Tuned Large Language Models for Codecited by 9
- 2023An Extensive Study on Adversarial Attack against Pre-trained Models of Codecited by 8
- 2024CodeFort: Robust Training for Code Generation Modelscited by 4
- 2025XOXO: Stealthy Cross-Origin Context Poisoning Attacks against AI Coding Assistantscited by 4
- 2023A Black-Box Attack on Code Models via Representation Nearest Neighbor Searchcited by 3
- 2022Semantic-Preserving Adversarial Code Comprehensioncited by 2
12 most cited of 18 All 18 (JSON)
- 2026Prompt-Driven Code Summarization: A Systematic Literature Review16 Apr 2026
- 2025Auto-SPT: Automating Semantic Preserving Transformations for Code5 Dec 2025
- 2025Semantic-Preserving Transformations as Mutation Operators: A Study on Their Effectiveness in Defect Detection30 Mar 2025
- 2025XOXO: Stealthy Cross-Origin Context Poisoning Attacks against AI Coding Assistants18 Mar 2025
- 2024EaTVul: ChatGPT-based Evasion Attack Against Software Vulnerability Detection27 Jul 2024
- 2024CodeFort: Robust Training for Code Generation Models11 Apr 2024
- 2023Turbulence: Systematically and Automatically Testing Instruction-Tuned Large Language Models for Code22 Dec 2023
- 2023Transfer Attacks and Defenses for Large Language Models on Coding Tasks22 Nov 2023
- 2023An Extensive Study on Adversarial Attack against Pre-trained Models of Code13 Nov 2023
- 2023LILO: Learning Interpretable Libraries by Compressing and Documenting Code30 Oct 2023
- 2023Uncovering the Limits of Machine Learning for Automatic Vulnerability Detection28 Jun 2023
- 2023Do Large Language Models Pay Similar Attention Like Human Programmers When Generating Code?2 Jun 2023
12 newest of 18 All 18 (JSON)