Skip to main content
QUICK REVIEW

[论文解读] Robust Encodings: A Framework for Combating Adversarial Typos

Erik Jones, Robin Jia|arXiv (Cornell University)|May 4, 2020
Adversarial Robustness in Machine Learning参考文献 32被引用 8
一句话总结

本文提出鲁棒编码(RobEn),一种与任务无关的框架,通过将句子映射到离散且稳定的编码集合,提升NLP模型对对抗性拼写错误的鲁棒性。通过优化稳定性和保真度,RobEn 实现了精确的鲁棒准确率计算,在与 BERT 结合时,跨 GLUE 任务实现了 71.3% 的平均鲁棒准确率,显著优于以往基于拼写纠正器的防御方法。

ABSTRACT

Despite excellent performance on many tasks, NLP systems are easily fooled by small adversarial perturbations of inputs. Existing procedures to defend against such perturbations are either (i) heuristic in nature and susceptible to stronger attacks or (ii) provide guaranteed robustness to worst-case attacks, but are incompatible with state-of-the-art models like BERT. In this work, we introduce robust encodings (RobEn): a simple framework that confers guaranteed robustness, without making compromises on model architecture. The core component of RobEn is an encoding function, which maps sentences to a smaller, discrete space of encodings. Systems using these encodings as a bottleneck confer guaranteed robustness with standard training, and the same encodings can be used across multiple tasks. We identify two desiderata to construct robust encoding functions: perturbations of a sentence should map to a small set of encodings (stability), and models using encodings should still perform well (fidelity). We instantiate RobEn to defend against a large family of adversarial typos. Across six tasks from GLUE, our instantiation of RobEn paired with BERT achieves an average robust accuracy of 71.3% against all adversarial typos in the family considered, while previous work using a typo-corrector achieves only 35.3% accuracy against a simple greedy attack.

研究动机与目标

  • 开发一种可重用、与任务无关的防御框架,无需对每个模型或任务重新训练,即可提供对抗性拼写错误的保证鲁棒性。
  • 通过引入离散编码瓶颈,解决现有防御方法的局限性,如启发式近似或与 SOTA 模型(如 BERT)不兼容的问题。
  • 通过两个核心期望:稳定性(扰动映射到少量编码)和保真度(下游模型在干净输入上保持高准确率),确保鲁棒性。
  • 通过可 tractable 的基于编码的推理,实现鲁棒准确率的精确计算,避免可证鲁棒训练中的松散边界。
  • 通过单一预计算的编码函数,在多个 NLP 任务上实现泛化。

提出的方法

  • 核心机制是编码函数 α,将输入句子映射到更小的离散编码空间,作为下游模型的瓶颈。
  • 通过在词级别编码上施加聚类目标,形式化地确保所有句子的扰动映射到少量编码,从而实现稳定性。
  • 通过优化编码以保持表征质量,从而在未扰动输入上保持下游模型的高性能,实现保真度。
  • 框架采用层次聚类,通过超参数 γ 平衡稳定性(γ=0)与保真度(γ=1),支持权衡分析。
  • 通过枚举攻击空间内所有有效扰动,实现鲁棒准确率的精确计算,避免下界近似。
  • 该方法兼容任意下游模型,包括 BERT,且编码在一次构建后可跨任务重用。

实验结果

研究问题

  • RQ1可重用、与任务无关的编码框架是否能在不为每个模型或任务重新训练的情况下,提供对抗性拼写错误的保证鲁棒性?
  • RQ2如何在离散编码空间中联合优化稳定性与保真度,以确保鲁棒性同时保持模型性能?
  • RQ3与基于拼写纠正器或数据增强的现有防御方法相比,RobEn 在最坏情况攻击下能将鲁棒准确率提升多少?
  • RQ4该框架是否可扩展至 SOTA 模型(如 BERT),且能否在不使用凸松弛或边界近似的情况下实现鲁棒准确率的精确计算?
  • RQ5RobEn 是否能跨多样化的 NLP 任务(如 GLUE 基准中的任务)泛化,仅使用单一预计算的编码函数?

主要发现

  • 当与 BERT 配对时,RobEn 在六个 GLUE 任务上实现了 71.3% 的平均鲁棒准确率,显著优于之前使用拼写纠正器的 SOTA 防御方法(在贪婪攻击下仅达 35.3%)。
  • 鲁棒准确率是精确计算的,由于编码空间的可 tractable 结构,避免了可证鲁棒训练中常见的松散下界。
  • 在 RTE 的 25% 示例和 SST-2 的 66% 示例中,所有句子的扰动均映射到单一编码(|Bα(x)| = 1),表明具有强稳定性。
  • 基于层次聚类的编码在 γ = 0.5 时于 SST-2 上实现最高鲁棒准确率,表明稳定性与保真度之间存在清晰权衡。
  • RobEn 同样可防御内部排列攻击,在相同六个任务上实现 81.4% 的鲁棒准确率,而标准 BERT 的准确率则从 86.2% 降至 15.7%。
  • 该框架具有任务泛化能力:同一编码函数可在无需重新训练的情况下跨多个 NLP 任务重用,实现与任务无关的鲁棒性。

更好的研究,从现在开始

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

无需绑定信用卡

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