Skip to main content
QUICK REVIEW

[论文解读] Bad Characters: Imperceptible NLP Attacks

Nicholas Boucher, Ilia Shumailov|arXiv (Cornell University)|Jun 18, 2021
Adversarial Robustness in Machine Learning被引用 4
一句话总结

本文系统性地分析了利用不可见字符、同形异义字、重排和删除攻击等手段实现的不可察觉NLP攻击,这些攻击可逃避视觉检测却能操控模型输出。论文提出了一种基于OCR的防御机制,可完全抵御不可见字符、重排和删除攻击,并显著降低同形异义字攻击的成功率,仅带来6.2%的BLEU分数损失,提供了一种低成本、可 retrofitted 的防御方案,无需重新训练模型。

ABSTRACT

Several years of research have shown that machine-learning systems are vulnerable to adversarial examples, both in theory and in practice. Until now, such attacks have primarily targeted visual models, exploiting the gap between human and machine perception. Although text-based models have also been attacked with adversarial examples, such attacks struggled to preserve semantic meaning and indistinguishability. In this paper, we explore a large class of adversarial examples that can be used to attack text-based models in a black-box setting without making any human-perceptible visual modification to inputs. We use encoding-specific perturbations that are imperceptible to the human eye to manipulate the outputs of a wide range of Natural Language Processing (NLP) systems from neural machine-translation pipelines to web search engines. We find that with a single imperceptible encoding injection -- representing one invisible character, homoglyph, reordering, or deletion -- an attacker can significantly reduce the performance of vulnerable models, and with three injections most models can be functionally broken. Our attacks work against currently-deployed commercial systems, including those produced by Microsoft and Google, in addition to open source models published by Facebook, IBM, and HuggingFace. This novel series of attacks presents a significant threat to many language processing systems: an attacker can affect systems in a targeted manner without any assumptions about the underlying model. We conclude that text-based NLP systems require careful input sanitization, just like conventional applications, and that given such systems are now being deployed rapidly at scale, the urgent attention of architects and operators is required.

研究动机与目标

  • 识别并分类利用Unicode控制字符和同形异义字操纵NLP模型输出的不可察觉文本攻击,且不改变视觉外观。
  • 证明这些攻击可在机器翻译、情感分析和有害内容检测等关键NLP任务中绕过现有NLP系统。
  • 开发并评估实用、可 retrofitted 的防御机制——特别是基于OCR和Bidi算法的解决方案——在最小化性能下降的前提下阻断攻击。
  • 倡导在生产级NLP系统中集成此类防御机制,以确保在大规模场景下对对抗性扰动具备鲁棒性。

提出的方法

  • 基于文本编码特征(不可见字符、同形异义字、双向(Bidi)控制字符、软/硬删除字符)提出不可察觉攻击的分类体系。
  • 利用光学字符识别(OCR)将视觉上相似但语义不同的字符(如同形异义字)映射为标准等价形式,从而缩小攻击面。
  • 应用Unicode双向算法以解决逻辑文本顺序问题,对抗利用视觉渲染与逻辑顺序不一致的重排攻击。
  • 通过剥离或警告处理删除字符和Bidi控制字符(在可行范围内)实现输入净化。
  • 使用BLEU分数作为评估防御对模型性能影响的指标,尤其关注未受扰动和同形异义字扰动输入的表现。
  • 在多个NLP任务中评估防御机制:机器翻译、情感分析、命名实体识别(NER)、文本蕴涵和有害内容检测。

实验结果

研究问题

  • RQ1不可察觉的文本攻击如何利用Unicode控制字符和同形异义字在不改变视觉外观的前提下操纵NLP模型输出?
  • RQ2基于OCR的预处理在多大程度上可缓解NLP推理管道中涉及同形异义字和不可见字符的攻击?
  • RQ3在将OCR或Bidi解析应用于真实世界NLP系统时,防御有效性与模型性能之间的权衡如何?
  • RQ4通用型、无需重新训练的防御机制是否能有效应对广泛类别的NLP攻击,同时不损害模型准确性?
  • RQ5在有或无图形用户界面的系统中,哪些防御策略最适合处理Bidi控制字符,特别是关于其处理方式?

主要发现

  • 基于OCR的防御通过在推理前标准化文本,成功阻断了100%的不可见字符、重排和删除攻击。
  • 该防御显著降低了同形异义字攻击的成功率,尽管未完全消除,原因在于OCR对罕见或模糊同形异义字的识别不完美。
  • 防御导致基线BLEU分数下降6.2%,主要源于OCR对未受扰动文本的错误识别,以及同形异义字更高的误识别率。
  • Bidi算法解析有效防止了重排攻击,通过使逻辑文本顺序与视觉渲染顺序保持一致。
  • 所提出的防御机制在多种NLP任务中均表现有效,包括机器翻译、情感分析和有害内容检测。
  • 作者结论认为,基于OCR的预处理是一种低成本、可 retrofitted 的解决方案,可在不重新训练模型的前提下增强系统鲁棒性。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。