[Paper Review] Generating Natural Language Adversarial Examples on a Large Scale with Generative Models
This paper proposes an unrestricted, end-to-end method to generate large-scale, high-quality natural language adversarial examples from scratch using a conditional variational autoencoder (VAE) enhanced with adversarial loss and GAN-style discriminators. The approach achieves higher attack success rates and better text quality than pair-wise methods by generating diverse, human-valid texts without relying on existing inputs.
Today text classification models have been widely used. However, these classifiers are found to be easily fooled by adversarial examples. Fortunately, standard attacking methods generate adversarial texts in a pair-wise way, that is, an adversarial text can only be created from a real-world text by replacing a few words. In many applications, these texts are limited in numbers, therefore their corresponding adversarial examples are often not diverse enough and sometimes hard to read, thus can be easily detected by humans and cannot create chaos at a large scale. In this paper, we propose an end to end solution to efficiently generate adversarial texts from scratch using generative models, which are not restricted to perturbing the given texts. We call it unrestricted adversarial text generation. Specifically, we train a conditional variational autoencoder (VAE) with an additional adversarial loss to guide the generation of adversarial examples. Moreover, to improve the validity of adversarial texts, we utilize discrimators and the training framework of generative adversarial networks (GANs) to make adversarial texts consistent with real data. Experimental results on sentiment analysis demonstrate the scalability and efficiency of our method. It can attack text classification models with a higher success rate than existing methods, and provide acceptable quality for humans in the meantime.
Motivation & Objective
- To address the scalability and diversity limitations of existing pair-wise adversarial text generation methods in NLP.
- To generate adversarial examples from scratch without requiring real input texts, enabling large-scale deployment.
- To improve the human readability and validity of adversarial texts while maintaining high attack success rates.
- To demonstrate the effectiveness of the proposed method in both attacking and defending text classification models.
- To show that unrestricted generation outperforms pair-wise generation in data augmentation for adversarial training.
Proposed method
- A conditional variational autoencoder (VAE) is used as the generator to produce text conditioned on a target label.
- An adversarial loss is introduced to ensure the generated text is misclassified by the target model, even though it is correctly classified by humans.
- Discriminators are employed in a GAN-like training framework to align the distribution of generated adversarial texts with real data of the desired class.
- The joint training process minimizes a composite loss combining VAE reconstruction, adversarial, and discriminator losses.
- After training, the generator can sample infinite adversarial examples from the latent space without further access to the target model.
- The method supports both zero-shot generation from scratch and transformation of existing inputs into adversarial examples.
Experimental results
Research questions
- RQ1Can adversarial text examples be generated at scale without relying on perturbing existing real texts?
- RQ2Can a generative model produce adversarial texts that are both semantically valid for humans and misclassified by a target model?
- RQ3How does the inclusion of discriminators affect the fluency and validity of generated adversarial texts?
- RQ4Does unrestricted adversarial text generation lead to better model robustness when used for adversarial training?
- RQ5How does the quality and attack success rate of unrestricted generation compare to pair-wise generation methods?
Key findings
- The proposed method achieved a 90.2% attack success rate on the RT dataset and 93.9% on IMDB, outperforming pair-wise baselines in scalability and quality.
- With the discriminator loss, generated texts had a perplexity of 2.79 on RT and 2.88 on IMDB, indicating high fluency and coherence.
- The validity of generated texts was 75% on RT and 73% on IMDB when using discriminators, compared to only 15% and 12% without them, proving the discriminator's critical role in improving human readability.
- Unrestricted generation from scratch achieved comparable or better adversarial test accuracy than pair-wise generation, but with significantly lower perplexity, indicating higher text quality.
- Adversarial training using unrestricted-generated examples improved model robustness, raising adversarial test accuracy from 0% to over 90%.
- The ablation study confirmed that removing the discriminator loss led to a sharp drop in validity despite similar attack success rates, highlighting the importance of distribution alignment.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.