Interpreting the Robustness of Neural NLP Models to Textual Perturbations (2022)

Abstract: Modern Natural Language Processing (NLP) models are known to be sensitive to input perturbations and their performance can decrease when applied to real-world, noisy data. However, it is still unclear why models are less robust to some perturbations than others. In this work, we test the hypothesis that the extent to which a model is affected by an unseen textual perturbation (robustness) can be explained by the learnability of the perturbation (defined as how well the model learns to identify the perturbation with a small amount of evidence). We further give a causal justification for the learnability metric. We conduct extensive experiments with four prominent NLP models — TextRNN, BERT, RoBERTa and XLNet — over eight types of textual perturbations on three datasets. We show that a model which is better at identifying a perturbation (higher learnability) becomes worse at ignoring such a perturbation at test time (lower robustness), providing empirical support for our hypothesis.

## introduction despite the success of deep neural models on many natural language processing (nlp) tasks @xcite @xcite , recent work has discovered that these models are not robust to noisy input from the real world and thus their performance will decrease @xcite @xcite . a reliable nlp system should not be easily fooled by slight noise in the text. although a wide range of evaluation approaches for robust nlp models have been proposed @xcite @xcite , few attempts have been made to understand these benchmark results. given the difference of robustness between models and perturbations, it is a natural question why models are more sensitive to some perturbations than others. it is crucial to avoid over-sensitivity to input perturbations, and understanding why it happens is useful for revealing the weaknesses of current models and designing more robust training methods. to the best of our knowledge, a quantitative measure to interpret the robustness of nlp models to textual perturbations has yet to be proposed. to improve the robustness under perturbation, it is common practice to leverage data augmentation @xcite @xcite . similarly, how much data augmentation through the perturbation improves model robustness varies between models and perturbations. in this work, we aim to investigate two research questions (rq): we test a hypothesis for rq1 that the extent to which a model is affected by an unseen textual perturbation (robustness) can be explained by the learnability of the perturbation (defined as how well the model learns to identify the perturbation with a small amount of evidence). we also validate another hypothesis for rq2 that the learnability metric is predictive of the improvement on robust performance brought by data augmentation along a perturbation. our proposed learnability is inspired by the concepts of randomized controlled trial (rct) and average treatment effect (ate) from causal inference @xcite . estimation of perturbation learnability for a model consists of three steps: ① randomly labelling a dataset, ② perturbing examples of a particular pseudo class with probabilities, and ③ using ate to measure the ease with which the model learns the perturbation. the core intuition for our method is to frame an rct as a perturbation identification task and formalize the notion of learnability exp no. measurement ## setup and terminology as a pilot study, we consider the task of binary text classification. the training set is denoted as d @xmath0, l 1 ), ..., (x n , l n )}, where x i is the i-th example and l @xmath1, 1} is the corresponding label. we fit a model f ∶ (x; θ) ↦ {0, 1} with parameters θ on the training data. a textual perturbation is a transformation g ∶ (x; β) → x * that injects a specific type of noise into an example x with parameters β and the resulting perturbed example is x * . we design several experiment settings ( ## a causal view on perturbation learnability in section 2.1, we introduce the term "learnability" in an intuitive way. now we map it to a formal, quantitative measure in standard statistical frameworks. learnability is actually motivated by concepts from the causality literature. we provide a brief introduction to basic concepts of causal inference in appendix b. in fact, learnability is the causal effect of perturbation on models, which is often difficult to measure due to the confounding latent features. in the language of causality, this is "correlation is not causation". causality provides insight on how to fully decouple the effect of perturbation and other latent features. we introduce the causal motivations for step 2.1 and 2.1 of learnability estimation in the following section 3.1 and 3.2, respectively. ## conclusion this work targets at an open question in nlp: why models are less robust to some textual perturbations than others? we find that learnability, which causally quantifies how well a model learns to identify a perturbation, is predictive of the model robustness to the perturbation. in future work, we will investigate whether these findings can generalize to other domains, including computer vision.