[论文解读] T3: Tree-Autoencoder Constrained Adversarial Text Generation for Targeted Attack
T3 提出了一种基于树自编码器的靶向对抗文本生成框架,将文本嵌入连续空间以支持基于梯度的优化,再通过树语法规则解码,以保持句法和语义的一致性。该方法在情感分析和问答等自然语言处理任务中实现了高攻击成功率,同时保持了人类可读性,并支持黑盒迁移攻击。
Adversarial attacks against natural language processing systems, which perform seemingly innocuous modifications to inputs, can induce arbitrary mistakes to the target models. Though raised great concerns, such adversarial attacks can be leveraged to estimate the robustness of NLP models. Compared with the adversarial example generation in continuous data domain (e.g., image), generating adversarial text that preserves the original meaning is challenging since the text space is discrete and non-differentiable. To handle these challenges, we propose a target-controllable adversarial attack framework T3, which is applicable to a range of NLP tasks. In particular, we propose a tree-based autoencoder to embed the discrete text data into a continuous representation space, upon which we optimize the adversarial perturbation. A novel tree-based decoder is then applied to regularize the syntactic correctness of the generated text and manipulate it on either sentence (T3(Sent)) or word (T3(Word)) level. We consider two most representative NLP tasks: sentiment analysis and question answering (QA). Extensive experimental results and human studies show that T3 generated adversarial texts can successfully manipulate the NLP models to output the targeted incorrect answer without misleading the human. Moreover, we show that the generated adversarial texts have high transferability which enables the black-box attacks in practice. Our work sheds light on an effective and general way to examine the robustness of NLP models. Our code is publicly available at https://github.com/AI-secure/T3/.
研究动机与目标
- 为解决生成靶向对抗文本的挑战,即在避免人类察觉的同时保持语义意义和句法正确性。
- 克服在对抗攻击生成中离散、不可微分的文本空间的局限性,尤其是与图像等连续领域相比。
- 开发一种通用的、可控制目标的攻击框架,适用于情感分析和问答等多样化 NLP 任务。
- 评估最先进 NLP 模型(特别是 BERT)在靶向对抗设置下的鲁棒性。
- 研究对抗样本在实际黑盒攻击场景中的迁移性,特别是在 NLP 领域。
提出的方法
- 在大规模语料上预训练基于树的自编码器,将离散文本映射到连续语义嵌入空间,以支持基于梯度的优化。
- 在词级别(T3(Word))或句子级别(T3(Sent))的连续嵌入空间中应用对抗扰动,利用依存树的层次结构。
- 基于树的解码器使用语法规则从扰动后的嵌入重构对抗性文本,以保持句法结构和语义内容。
- 通过迭代优化过程调整扰动,以最大化攻击成功率,同时最小化可检测的变化。
- 该框架支持原位攻击和插入式攻击,后者在原始输入中添加对抗性句子。
- 通过在一种模型上生成对抗样本并将其迁移到具有相似架构的其他模型上,实现黑盒攻击中的迁移性。
实验结果
研究问题
- RQ1在树层次结构中,词级别还是句子级别能产生更有效且更自然的对抗攻击?
- RQ2能否在情感分类和问答等通用 NLP 任务中成功应用靶向攻击,并实现高成功率?
- RQ3对抗样本在模型之间的迁移性有多强,特别是在黑盒设置下?
- RQ4模型架构和注意力机制(如 BERT 的长距离注意力)如何影响对抗攻击的有效性?
- RQ5对抗样本是否显著降低人类表现,还是对人类读者保持不可检测?
主要发现
- T3(Word) 在多个任务中实现了最高的攻击成功率,尽管 T3(Sent) 生成的对抗性句子在语法上更正确且更不易被人类察觉。
- 由 T3 生成的对抗样本能够成功操纵 NLP 模型,在情感分类和问答任务中输出目标错误答案,同时不误导人类标注者。
- 对抗样本的迁移性很强,尤其当从更强模型(如 BERT-QA)迁移到更弱模型(如 BiDAF)时,成功率高于反向迁移。
- 具有相似架构的模型之间对抗样本的迁移性更高,而跨不同架构的迁移性较低。
- BERT 模型在对抗攻击下表现出显著的性能下降,表明尽管其准确率处于最先进水平,但其鲁棒性不足。
- 通过在段落开头或结尾处添加对抗性句子来攻击 BERT 比在中间插入更有效,这是由于 BERT 的注意力机制倾向于关注句子边界。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。