Skip to main content
QUICK REVIEW

[Paper Review] Generating Natural Language Attacks in a Hard Label Black Box Setting

Rishabh Maheshwary, Saket Maheshwary|arXiv (Cornell University)|Dec 29, 2020
Topic ModelingComputer Science4 citations
TL;DR

This paper proposes a decision-based adversarial attack for natural language processing models in a hard-label black box setting, where only the top predicted label is accessible. Using a population-based optimization with genetic algorithm and synonym-based initialization, it generates semantically similar, grammatically correct adversarial examples with high success rates and low perturbation rates, outperforming prior methods in a highly restricted environment without substitute models or training data.

ABSTRACT

We study an important and challenging task of attacking natural language processing models in a hard label black box setting. We propose a decision-based attack strategy that crafts high quality adversarial examples on text classification and entailment tasks. Our proposed attack strategy leverages population-based optimization algorithm to craft plausible and semantically similar adversarial examples by observing only the top label predicted by the target model. At each iteration, the optimization procedure allow word replacements that maximizes the overall semantic similarity between the original and the adversarial text. Further, our approach does not rely on using substitute models or any kind of training data. We demonstrate the efficacy of our proposed approach through extensive experimentation and ablation studies on five state-of-the-art target models across seven benchmark datasets. In comparison to attacks proposed in prior literature, we are able to achieve a higher success rate with lower word perturbation percentage that too in a highly restricted setting.

Motivation & Objective

  • To address the challenge of crafting effective adversarial examples in a hard-label black box setting where only the top predicted label is observable.
  • To develop an attack strategy that maintains high semantic similarity and grammatical correctness while minimizing word perturbations.
  • To eliminate reliance on substitute models, training data, or gradient information, making the attack more practical for real-world applications.
  • To evaluate the robustness of state-of-the-art NLP models under such a restrictive yet realistic attack scenario.
  • To demonstrate transferability and effectiveness of the proposed attack across multiple models and datasets.

Proposed method

  • Utilizes a population-based optimization framework that evolves candidate adversarial examples through iterative word replacements.
  • Employs a genetic algorithm (GA) to explore the search space and converge toward high-quality adversarial examples with improved semantic similarity.
  • Applies synonym-based initialization using top 50 synonyms from a counter-fitted word embedding space to improve initial solution quality.
  • Maximizes semantic similarity between original and adversarial texts using embedding-based similarity metrics during optimization.
  • Relies solely on hard-label feedback (top predicted class) from the target model, without access to gradients, confidence scores, or model architecture.
  • Reduces search space through strategic word selection and replacement constraints to improve convergence and efficiency.

Experimental results

Research questions

  • RQ1Can a decision-based attack generate high-quality adversarial examples in a hard-label black box setting with only top-label feedback?
  • RQ2How effective is a population-based optimization strategy in maintaining semantic similarity and grammatical correctness under strict constraints?
  • RQ3To what extent does synonym-based initialization improve the quality and efficiency of adversarial example generation?
  • RQ4How does the proposed attack compare to prior methods in terms of success rate, perturbation rate, and transferability?
  • RQ5Can adversarial examples generated by this method successfully transfer across different NLP models and datasets?

Key findings

  • The proposed attack achieves a 4.4% reduction in perturbation rate and a 0.16 increase in semantic similarity on BERT compared to non-GA optimization, demonstrating the effectiveness of genetic algorithm integration.
  • Without synonym-based initialization, the average semantic similarity drops by 0.1 and perturbation rate increases by 2.4%, confirming its importance in solution quality.
  • Adversarial examples generated by the method show higher transferability, with attack success rates of 53.0% on BERT, 54.9% on ESIM, and 67.4% on Infersent when attacking other models on the SNLI dataset.
  • Human evaluation shows 96% of adversarial examples on IMDB and 92% on SNLI were classified with the same label as their original counterparts, indicating strong semantic preservation.
  • The average grammatical correctness score was 4.44 (IMDB) and 4.13 (SNLI), and semantic similarity was 0.93 and 0.896 respectively, confirming high fluency and plausibility.
  • After adversarial training with 10% of the adversarial examples, BERT’s accuracy dropped by 15% and perturbation rate increased by 10%, indicating that the attack remains effective even after model fine-tuning.

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.