Skip to main content
QUICK REVIEW

[论文解读] HQA-Attack: Toward High Quality Black-Box Hard-Label Adversarial Attack on Text

Liu Han, Zhi Xu|arXiv (Cornell University)|Feb 2, 2024
Adversarial Robustness in Machine LearningComputer Science被引用 3
一句话总结

HQA-Attack 提出了一种简单但高效的文本黑箱硬标签对抗攻击框架,在严格查询预算下,能够生成高质量的对抗样本,保持高语义相似度和低扰动率。该方法首先通过恢复原始词汇来减少扰动,然后利用语义相似度和对抗成功度引导的有目标同义词替换来优化剩余更改,显著优于现有方法在多个基准上的表现。

ABSTRACT

Black-box hard-label adversarial attack on text is a practical and challenging task, as the text data space is inherently discrete and non-differentiable, and only the predicted label is accessible. Research on this problem is still in the embryonic stage and only a few methods are available. Nevertheless, existing methods rely on the complex heuristic algorithm or unreliable gradient estimation strategy, which probably fall into the local optimum and inevitably consume numerous queries, thus are difficult to craft satisfactory adversarial examples with high semantic similarity and low perturbation rate in a limited query budget. To alleviate above issues, we propose a simple yet effective framework to generate high quality textual adversarial examples under the black-box hard-label attack scenarios, named HQA-Attack. Specifically, after initializing an adversarial example randomly, HQA-attack first constantly substitutes original words back as many as possible, thus shrinking the perturbation rate. Then it leverages the synonym set of the remaining changed words to further optimize the adversarial example with the direction which can improve the semantic similarity and satisfy the adversarial condition simultaneously. In addition, during the optimizing procedure, it searches a transition synonym word for each changed word, thus avoiding traversing the whole synonym set and reducing the query number to some extent. Extensive experimental results on five text classification datasets, three natural language inference datasets and two real-world APIs have shown that the proposed HQA-Attack method outperforms other strong baselines significantly.

研究动机与目标

  • 为解决在仅可访问预测标签的黑箱硬标签文本攻击设置中生成高质量对抗样本的挑战。
  • 在保持高语义相似度和低扰动率的同时,减少对抗样本生成过程中的查询消耗。
  • 克服启发式方法和基于梯度的方法因陷入局部最优和梯度估计不准确而带来的局限性。
  • 开发一种适用于不暴露置信度分数的实际真实 API 的实用且高效的攻击框架。
  • 通过高质量的对抗样本,实现对 NLP 模型防御机制的稳健评估与改进。

提出的方法

  • 通过随机词替换初始化对抗样本,生成一个被错误分类的候选样本。
  • 迭代地在对抗样本中恢复原始词汇,以在保持错误分类的同时降低扰动率。
  • 对于剩余的更改词汇,搜索能提升语义相似度并以最小查询成本保持对抗成功性的过渡同义词。
  • 为每个更改词汇使用同义词集合,但通过基于相似度和对抗收益选择最具前景的过渡词,避免完整遍历。
  • 仅依赖预测标签(硬标签)和同义词集合,避免依赖置信度分数或梯度估计。
  • 分两个阶段优化对抗样本:首先通过词汇恢复减少扰动,随后进行语义感知的同义词替换。
Figure 1: The overview of HQA-Attack. (A) Generate an adversarial example $x^{\prime}_{1}$ by initialization. (B) Update $x_{t}^{\prime}(1\leq t\leq T)$ by substituting original words back. (C) Obtain $x_{t+1}^{\prime}$ by optimizing the adversarial example. The similarity isohypse is a line which c
Figure 1: The overview of HQA-Attack. (A) Generate an adversarial example $x^{\prime}_{1}$ by initialization. (B) Update $x_{t}^{\prime}(1\leq t\leq T)$ by substituting original words back. (C) Obtain $x_{t+1}^{\prime}$ by optimizing the adversarial example. The similarity isohypse is a line which c

实验结果

研究问题

  • RQ1黑箱硬标签对抗攻击能否在最小查询使用下实现高语义相似度和低扰动率?
  • RQ2在无梯度或置信度分数访问的情况下,如何有效利用语义相似度和对抗成功度引导基于同义词的优化?
  • RQ3在同义词搜索前先进行词汇恢复,是否能降低扰动率同时保持攻击成功率?
  • RQ4与启发式和基于梯度的基线方法相比,所提方法在查询效率和对抗质量方面表现如何?
  • RQ5该方法能否在严格查询预算下生成既语义自然又有效的高质量对抗样本?

主要发现

  • HQA-Attack 在五个文本分类数据集、三个自然语言推理数据集以及两个真实世界 API 上,显著优于强基线方法,包括 HLGA、TextHoaxer 和 LeapAttack。
  • 即使在严格查询预算下,该方法仍实现了比现有方法更高的语义相似度和更低的扰动率。
  • 通过优先恢复原始词汇,HQA-Attack 减少了更改词汇数量,从而生成更自然、更流畅的对抗样本。
  • 通过使用过渡同义词搜索,相比完整遍历同义词集合,显著降低了查询成本,提升了效率。
  • 在 MR 和 AG 数据集上,HQA-Attack 仅通过少量且语义连贯的修改,成功将预测结果从 'Negative' 改为 'Positive',以及从 'World' 改为 'Business'。
  • 该方法在包括文本分类和自然语言推理在内的多样化 NLP 任务中展现出强大的泛化能力,证实了其稳健性和实用性。

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。