Skip to main content
QUICK REVIEW

[Paper 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 Science3 citations
TL;DR

HQA-Attack proposes a simple yet effective black-box hard-label adversarial attack framework for text that achieves high-quality adversarial examples with high semantic similarity and low perturbation rate under tight query budgets. It first restores original words to reduce perturbation, then optimizes remaining changes using targeted synonym substitution guided by semantic similarity and adversarial success, significantly outperforming prior methods on multiple benchmarks.

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.

Motivation & Objective

  • To address the challenge of generating high-quality adversarial examples in black-box hard-label text attack settings, where only predicted labels are accessible.
  • To reduce query consumption while maintaining high semantic similarity and low perturbation rate in adversarial example generation.
  • To overcome limitations of heuristic and gradient-based methods that suffer from local optima and inaccurate gradient estimation.
  • To develop a practical and efficient attack framework suitable for real-world APIs that do not expose confidence scores.
  • To enable robust evaluation and improvement of NLP model defenses through high-quality adversarial examples.

Proposed method

  • Initialize an adversarial example via random word substitution to generate a candidate with misclassified label.
  • Iteratively restore original words in the adversarial example to reduce perturbation rate while maintaining misclassification.
  • For remaining changed words, search for transition synonyms that improve semantic similarity and preserve adversarial success with minimal query cost.
  • Use a synonym set for each changed word but avoid full traversal by selecting only the most promising transition word based on similarity and adversarial gain.
  • Leverage only the predicted label (hard-label) and synonym sets, avoiding reliance on confidence scores or gradient estimation.
  • Optimize the adversarial example in two phases: perturbation reduction via word restoration, followed by semantic-aware synonym replacement.
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

Experimental results

Research questions

  • RQ1Can a black-box hard-label adversarial attack achieve high semantic similarity and low perturbation rate with minimal query usage?
  • RQ2How can synonym-based optimization be effectively guided by semantic similarity and adversarial success without gradient or confidence score access?
  • RQ3Can word restoration prior to synonym search reduce perturbation while maintaining attack success?
  • RQ4How does the proposed method compare to heuristic and gradient-based baselines in terms of query efficiency and adversarial quality?
  • RQ5Can the method generate high-quality adversarial examples that are both semantically natural and effective under tight query budgets?

Key findings

  • HQA-Attack significantly outperforms strong baselines, including HLGA, TextHoaxer, and LeapAttack, across five text classification datasets, three natural language inference datasets, and two real-world APIs.
  • The method achieves higher semantic similarity and lower perturbation rate than existing methods, even under tight query budgets.
  • By restoring original words first, HQA-Attack reduces the number of changed words, leading to more natural and fluent adversarial examples.
  • The use of transition synonym search reduces query cost compared to full synonym set traversal, improving efficiency.
  • On the MR and AG datasets, HQA-Attack successfully changed predictions from 'Negative' to 'Positive' and 'World' to 'Business' with minimal, semantically coherent changes.
  • The method demonstrates strong generalization across diverse NLP tasks, including text classification and natural language inference, confirming its robustness and practicality.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.