STRATA: Simple, Gradient-Free Attacks for Models of Code
Not on the map. Why?
Abstract (arXiv)
Neural networks are well-known to be vulnerable to imperceptible perturbations in the input, called adversarial examples, that result in misclassification. Generating adversarial examples for source code poses an additional challenge compared to the domains of images and natural language, because source code perturbations must retain the functional meaning of the code. We identify a striking relationship between token frequency statistics and learned token embeddings: the L2 norm of learned token embeddings increases with the frequency of the token except for the highest-frequnecy tokens. We leverage this relationship to construct a simple and efficient gradient-free method for generating state-of-the-art adversarial examples on models of code. Our method empirically outperforms competing gradient-based methods with less information and less computational effort.
Key facts. Cited by 5 papers in the map (data through 7 Oct 2026). First posted on arXiv 28 Sep 2020.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2021: 1; 2022: 0; 2023: 3; 2024: 0; 2025: 1.
5 papers.
- 2021CoProtector: Protect Open-Source Code against Unauthorized Training Usage with Data Poisoningcited by 39
- 2023CodeMark: Imperceptible Watermarking for Code Datasets against Neural Code Completion Modelscited by 28
- 2023A Black-Box Attack on Code Models via Representation Nearest Neighbor Searchcited by 3
- 2023Source Code Data Augmentation for Deep Learning: A Surveycited by 3
- 2025Semantic-Preserving Transformations as Mutation Operators: A Study on Their Effectiveness in Defect Detectioncited by 2
- 2025Semantic-Preserving Transformations as Mutation Operators: A Study on Their Effectiveness in Defect Detection30 Mar 2025
- 2023CodeMark: Imperceptible Watermarking for Code Datasets against Neural Code Completion Models28 Aug 2023
- 2023Source Code Data Augmentation for Deep Learning: A Survey31 May 2023
- 2023A Black-Box Attack on Code Models via Representation Nearest Neighbor Search10 May 2023
- 2021CoProtector: Protect Open-Source Code against Unauthorized Training Usage with Data Poisoning25 Oct 2021