Interpreting the Robustness of Neural NLP Models to Textual Perturbations

Yunxiang Zhang, Liangming Pan, Samson Tan, Min-Yen Kan

Introduction

Modern NLP models, including state-of-the-art architectures like BERT and RoBERTa, often exhibit extreme brittleness when faced with minor textual perturbations. A simple typo or a change in word order can lead to significant drops in accuracy. While various benchmarks exist to quantify this lack of robustness, understanding the underlying mechanisms has remained largely qualitative. This research introduces perturbation learnability, a quantitative metric grounded in causal inference, to bridge the gap between a model's training behavior and its failure modes on noisy, real-world data.

Methodology: The Learnability Framework

The authors propose a novel framework to measure learnability by treating the problem as a Randomized Controlled Trial (RCT). The process involves:

  1. Random Labeling: Replacing original semantic labels with random binary labels to remove the primary signal.
  2. Controlled Perturbation: Perturbing a subset of examples with a specific probability $p$.
  3. Identification Task: Training the model to distinguish between perturbed and clean text.
  4. Causal Estimand: Quantifying learnability using the Average Treatment Effect (ATE), specifically the log AUC of learnability across various levels of $p$.

This approach successfully decouples "noise" from "signal," allowing for an isolated measurement of how sensitive a model's architecture and pre-training are to specific textual changes.

Key Results: Ranking Perturbations

The study evaluated four models (TextRNN, BERT, RoBERTa, and XLNet) across three datasets (IMDB, YELP, and QQP).

Learnability curves across different models, datasets, and perturbation types. High learnability indicates that a model can easily identify a specific type of noise.

As illustrated in the learnability curves, perturbations that interfere with subword tokenization—such as "visual attacks" (using look-alike characters) or "leet speak"—exhibit the highest learnability. These changes often create "unknown" or rare tokens that the model flags instantly. Conversely, "whitespace perturbations" and "duplicate punctuation" are much harder for models to learn, resulting in lower scores.

Key Insights: The Robustness-Learnability Tradeoff

The core finding of this research is a statistically significant negative correlation between how easily a model learns a perturbation and how robust it is against that perturbation.

Correlations between learnability, robustness, and the impact of data augmentation. (a) shows the inverse relationship between learnability and robustness; (b) shows the predictive power of learnability for augmentation gains.

When a model is "too good" at spotting a specific type of noise, it begins to treat that noise as a predictive feature rather than ignoring it, leading to failure at test time. The Spearman correlation between average learnability and robustness reached as high as -0.821 on the YELP dataset.

Furthermore, the learnability metric is predictive of the success of data augmentation. The authors found a high correlation (0.75 to 0.84) between learnability and the performance boost gained from adding noisy examples to the training set. This suggests that if a model struggles with a highly learnable noise type, augmentation is a highly effective remedy.

Conclusion and Future Work

While the learnability framework provides a powerful diagnostic tool, it comes with computational costs due to the need for multiple training runs. Future work aims to extend this framework to multi-class problems, imbalanced datasets, and other domains such as computer vision. By quantifying the relationship between noise identification and model failure, this work provides a roadmap for building more resilient NLP systems.

Summary updated

BibTeX
@inproceedings{zhang2022interpreting,
  author = {Yunxiang Zhang and Liangming Pan and Samson Tan and Min-Yen Kan},
  title = {{Interpreting the Robustness of Neural NLP Models to Textual Perturbations}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2022},
  doi = {10.18653/v1/2022.findings-acl.315},
}
Figure