We use a few cookies

Essential cookies keep the library working. With your permission, we'd also like to use analytics to see what's useful and improve the experience. Read our Privacy Policy or Cookie Policy.

Skip to main content
Home/e-Resources/Computer Science & Information Technology/Evolutionary Multi-objective Optimization for Contextual Adversarial Example Generation
PeriodicalsComputer Science & Information Technology

Evolutionary Multi-objective Optimization for Contextual Adversarial Example Generation

Checking your access to this record.

Abstract & Overview

The emergence of the ‘code naturalness’ concept, which suggests that software code shares statistical properties with natural language, paves the way for deep neural networks (DNNs) in software engineering (SE). However, DNNs can be vulnerable to certain human imperceptible variations in the input, known as adversarial examples (AEs), which could lead to adverse model performance. Numerous attack strategies have been proposed to generate AEs in the context of computer vision and natural language processing, but the same is less true for source code of programming languages in SE. One of the challenges is derived from various constraints including syntactic, semantics and minimal modification ratio. These constraints, however, are subjective and can be conflicting with the purpose of fooling DNNs. This paper develops a multi-objective adversarial attack method (dubbed MOAA ), a tailored NSGA-II, a powerful evolutionary multi-objective (EMO) algorithm, integrated with CodeT5 to generate high-quality AEs based on contextual information of the original code snippet. Experiments on 5 source code tasks with 10 datasets of 6 different programming languages show that our approach can generate a diverse set of high-quality AEs with promising transferability. In addition, using our AEs, for the first time, we provide insights into the internal behavior of pre-trained models.

Cite this record

Shasha Zhou, Mingyu Huang, Yanan Sun, Ke Li (2024). Evolutionary Multi-objective Optimization for Contextual Adversarial Example Generation. Proceedings of the ACM on software engineering., 1(FSE), 2285–2308. https://doi.org/10.1145/3660808

Copy in another style

Zhou, S., Huang, M., Sun, Y., & Li, K. (2024). Evolutionary Multi-objective Optimization for Contextual Adversarial Example Generation. Proceedings of the ACM on software engineering., 1(FSE), 2285–2308. https://doi.org/10.1145/3660808
Author names are used as deposited, so check their order before you submit.

Metadata is harvested from open-access indexes and can be incomplete. Check a citation against the published version before relying on it — see our open access & attribution policy.