[论文解读] Generating Natural Language Adversarial Examples on a Large Scale with Generative Models
本文提出了一种无需限制、端到端的方法,利用条件变分自编码器(VAE)结合对抗损失和 GAN 风格判别器,从零开始生成大规模、高质量的自然语言对抗样本。该方法通过生成多样化且符合人类语言习惯的文本,不依赖于现有输入,在不使用配对方法的情况下实现了更高的攻击成功率和更优的文本质量。
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.
研究动机与目标
- 解决现有配对式对抗性文本生成方法在自然语言处理中面临的可扩展性和多样性限制。
- 在无需真实输入文本的情况下,从零开始生成对抗样本,实现大规模部署。
- 在保持高攻击成功率的同时,提升对抗性文本的人类可读性和有效性。
- 在攻击和防御文本分类模型方面验证所提方法的有效性。
- 证明无限制生成优于配对式生成,在对抗训练的数据增强中表现更优。
提出的方法
- 使用条件变分自编码器(VAE)作为生成器,根据目标标签生成文本。
- 引入对抗损失,确保生成的文本虽被人类正确分类,但能被目标模型错误分类。
- 在 GAN 类似训练框架中使用判别器,使生成的对抗性文本分布与目标类别的真实数据对齐。
- 联合训练过程最小化包含 VAE 重构损失、对抗损失和判别器损失的复合损失。
- 训练完成后,生成器可从潜在空间无限采样对抗样本,而无需再次访问目标模型。
- 该方法支持从零开始的零样本生成,也支持将现有输入转换为对抗样本。
实验结果
研究问题
- RQ1能否在不依赖扰动真实文本的前提下,大规模生成对抗性文本样本?
- RQ2生成模型能否产生对人类语义上有效且被目标模型错误分类的对抗性文本?
- RQ3引入判别器如何影响生成对抗性文本的流畅性和有效性?
- RQ4在对抗训练中使用无限制生成的对抗性文本是否能提升模型鲁棒性?
- RQ5无限制生成方法在质量与攻击成功率方面与配对式生成方法相比如何?
主要发现
- 所提方法在 RT 数据集上达到 90.2% 的攻击成功率,在 IMDB 数据集上达到 93.9%,在可扩展性和质量方面优于配对式基线方法。
- 引入判别器损失后,生成文本在 RT 上的困惑度为 2.79,在 IMDB 上为 2.88,表明其具有高度的流畅性和连贯性。
- 使用判别器时,RT 数据集上生成文本的有效性为 75%,IMDB 为 73%;而未使用判别器时分别仅为 15% 和 12%,证明判别器在提升人类可读性方面起着关键作用。
- 从零开始的无限制生成在对抗性测试准确率上与配对式生成相当或更优,且困惑度显著更低,表明文本质量更高。
- 使用无限制生成样本进行对抗训练可显著提升模型鲁棒性,使对抗性测试准确率从 0% 提升至 90% 以上。
- 消融实验表明,若移除判别器损失,即使攻击成功率相近,有效性仍急剧下降,凸显了分布对齐的重要性。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。