Phrase-level Textual Adversarial Attack with Label Preservation

Yibin Lei, Yu Cao, Dianqi Li, Tianyi Zhou, Meng Fang, Mykola Pechenizkiy

Introduction

Adversarial attacks—intentional perturbations designed to mislead neural networks—are vital for evaluating the robustness of NLP models. However, existing methods often struggle with a trade-off between search space and text quality. Word-level attacks, which swap individual words for synonyms, are often too limited to find complex vulnerabilities. Conversely, sentence-level paraphrasing can produce ungrammatical or logically inconsistent text.

Furthermore, many current attacks rely on simple semantic similarity metrics (like cosine similarity) to ensure the ground-truth label remains unchanged. These metrics are often unreliable; for example, a sentiment analysis model might see "The movie was great" and "The movie was terrible" as mathematically similar despite their opposite meanings. To address these issues, researchers have developed PLAT (Phrase-Level Textual Adversarial ATtack).

Methodology: The PLAT Framework

PLAT operates in the "sweet spot" of phrase-level perturbations, providing a larger search space than word-swapping while maintaining better structure than full-sentence paraphrasing.

The PLAT pipeline: extracting phrases and applying contextual perturbations to flip model predictions while preserving labels.

The PLAT pipeline consists of four primary stages:

  1. Phrase Extraction: Using a syntactic parser, PLAT identifies structural constituents such as Noun Phrases (NP) or Verb Phrases (VP).
  2. Vulnerability Ranking: The system determines which phrases are most critical to the victim model's prediction by masking them and measuring the resulting drop in confidence.
  3. Contextualized Blank-Infilling: Instead of dictionary-based synonyms, PLAT uses pre-trained language models (like BART or T5) to fill the "blank" where the original phrase was. This ensures the new phrase fits naturally within the surrounding context.
  4. Label-Preservation Filter: This "secret sauce" uses Class-Conditioned Masked Language Models (CMLMs) to calculate the likelihood of the new phrase under the original class. If a perturbation makes the text look like a different class to a human, it is rejected.

Experimental Setup

The researchers evaluated PLAT across four diverse benchmarks: Yelp Reviews (sentiment), AG News (topic classification), MNLI (natural language inference), and QNLI (question-answering inference). These datasets represent a range of tasks and average sentence lengths, providing a comprehensive test of the attack's versatility.

Results and Analysis

PLAT consistently outperformed strong baselines, including TextFooler, CLARE, and MAYA, across multiple performance metrics.

Comparative performance of PLAT against state-of-the-art baselines across four benchmark datasets.

Key results include:

  • Attack Success Rate (ASR): PLAT achieved near-perfect success rates, such as 98.4% on Yelp and 95.7% on AG News, often requiring fewer modifications than other phrase-level methods.
  • Fluency and Naturalness: Adversarial examples generated by PLAT exhibited the lowest Perplexity (PPL) scores. This indicates that the text is more "natural-sounding" and less likely to be detected as machine-generated or adversarial.
  • Human Validation: In blind tests, human annotators found that PLAT preserved the original label 77.1% of the time. This is a significant improvement over CLARE (49.8%) and MAYA (53.5%), confirming that PLAT is much better at "staying on topic" while still fooling the AI.

Conclusion

PLAT demonstrates that phrase-level attacks, when combined with contextualized infilling and class-conditioned filtering, can expose significant vulnerabilities in modern NLP models while maintaining high linguistic quality. The study highlights that current "robust" models remain highly vulnerable to multi-token perturbations, suggesting a critical need for new defense mechanisms that account for phrase-level adversarial strategies.

Summary updated

BibTeX
@inproceedings{lei2022phrase,
  author = {Yibin Lei and Yu Cao and Dianqi Li and Tianyi Zhou and Meng Fang and Mykola Pechenizkiy},
  title = {{Phrase-level Textual Adversarial Attack with Label Preservation}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2022},
  doi = {10.18653/v1/2022.findings-naacl.83},
}
Figure