TL;DR
The authors introduce PLAT (Phrase-Level Textual Adversarial ATtack), a novel method for generating high-quality adversarial text to test the robustness of NLP models. By leveraging syntactic parsing and a pre-trained blank-infilling language model, PLAT perturbs multi-word phrases rather than single words or entire sentences. Crucially, it incorporates a class-conditioned label-preservation filter to ensure that the generated text fools the target model without altering the true meaning or label for human readers.
What Problem Does This Paper Address?
Adversarial attacks are vital tools for uncovering vulnerabilities in NLP models and guiding the development of more robust systems. However, generating effective textual adversarial examples is notoriously difficult due to the discrete nature of language.
Existing methods typically operate at two extremes:
- Word-level attacks: These swap out individual words for synonyms. While they preserve the text's structure, their search space is highly restricted, often leading to lower attack success rates.
- Sentence-level attacks: These paraphrase entire sentences. While they explore a larger search space, they frequently sacrifice fluency, grammaticality, and original meaning.
Furthermore, existing attacks rely heavily on semantic similarity filters (like Universal Sentence Encoder distance) to ensure the adversarial text means the same thing as the original. Recent studies show these filters often fail, resulting in "label flipping"—where the text changes so much that a human would assign it a completely different label than the original.
Methods
PLAT bridges the gap between word- and sentence-level perturbations by focusing on phrases. The framework follows a three-step pipeline:
- Phrase Candidate Extraction & Ranking: PLAT uses a syntactic parser to extract phrase constituents (e.g., noun phrases, verb phrases). It ranks these phrases by "importance" by masking them and measuring the drop in the victim model's confidence score.
- Contextualized Phrase Perturbation: Instead of using a simple dictionary lookup, PLAT replaces the target phrase with a
[MASK]token and uses a pre-trained blank-infilling model (such as BART or T5) to generate fluent, context-aware phrase replacements of varying lengths. - Label-Preservation Filtering: To prevent label flipping, the authors introduce a novel filter based on Class-Conditioned Masked Language Models (CMLMs). The filter calculates a likelihood ratio to ensure that a generated phrase candidate is highly probable under the original class distribution but highly improbable under alternative classes.
Datasets
The authors evaluated PLAT across four distinct datasets spanning sentiment analysis, topic classification, and natural language inference (NLI):
- Yelp Reviews: Binary sentiment classification of restaurant reviews.
- AG News: Four-class news article topic classification.
- MNLI (Multi-Genre Natural Language Inference): Three-class textual entailment dataset.
- QNLI (Question Natural Language Inference): Binary classification task derived from SQuAD.
Key Insights and Ideas
- The Sweet Spot of Phrase-Level Attacks: Moving from word-level to phrase-level adjustments expands the adversarial search space significantly without causing the structural chaos of sentence-level paraphrasing.
- Semantic Similarity $\neq$ Label Preservation: Standard embedding-based similarity metrics do not guarantee that class-specific properties (like sentiment) are preserved. A dedicated, class-conditioned language model likelihood filter is far more reliable at keeping the ground-truth label intact for humans.
- Noun Phrases are the Most Vulnerable: Across three of the four datasets, noun phrases (NPs) were the most frequently and successfully targeted constituents for attacks, accounting for over 50% of the successful perturbations in those tasks.
Key Results
PLAT consistently outperformed state-of-the-art word-level (Textfooler, CLARE) and sentence-level (StyleAdv, MAYA) baselines across multiple metrics:
- Attack Success Rate (ASR) & Fluency: PLAT achieved the highest attack success rates (e.g., 98.4% on Yelp and 95.7% on AG News) while maintaining the lowest perplexity (PPL), indicating superior text fluency.
- Human Evaluation: In human trials on the Yelp dataset, PLAT demonstrated a massive advantage in label preservation, maintaining the correct human label 77.1% of the time, compared to just 49.8% for CLARE and 53.5% for MAYA.
- Bypassing Robust Defenses: When tested against a victim model hardened with adversarial training (TAVAT), traditional word-level attacks saw their success rates plummet (TextFooler dropped to 64.2%). PLAT maintained a dominant 99.2% attack success rate, proving it poses a significant new challenge to current defense mechanisms.
Limitations and Future Work
The authors note two primary limitations of PLAT:
- Data Dependency for Filters: The label-preservation filter relies on fine-tuning class-conditioned language models. Consequently, its performance may degrade on niche datasets that lack sufficient labeled training data.
- Computational Overhead: Generating context-aware phrase perturbations and running them through multiple filters is computationally expensive, taking roughly 1 minute to generate a single adversarial sample using a standard BERT victim model.
Future work could explore optimizing the generation speed to make phrase-level attacks viable for real-time robustness testing.
Summary updated