Statistically Profiling Biases in Natural Language Reasoning Datasets and Models

Recent work has indicated that many natural language understanding and reasoning datasets contain statistical cues that may be taken advantaged of by NLP models whose capability may thus be grossly overestimated. To discover the potential weakness in the models, some human-designed stress tests have been proposed but they are expensive to create and do not generalize to arbitrary models. We propose a light-weight and general statistical profiling framework, ICQ (I-See-Cue), which automatically identifies possible biases in any multiple-choice NLU datasets without the need to create any additional test cases, and further evaluates through blackbox testing the extent to which models may exploit these biases.


Introduction
Deep neural models have shown to be effective in a large variety of natural language inference (NLI) tasks [Bowman et al., 2015;Wang et al., 2018;Mostafazadeh et al., 2016;Roemmele et al., 2011;Zellers et al., 2018]. Many of these tasks are discriminative by nature, such as predicting a class label or an outcome given a textual context, as shown in the following example: Example 1. Natural language inference in SNLI dataset, with ground truth bolded.
Premise: A swimmer playing in the surf watches a low flying airplane headed inland.
Hypothesis: Someone is swimming in the sea.
The number of candidate labels may vary. Humans solve such questions by reasoning the logical connections between the premise and the hypothesis, but previous work [Naik et al., 2018;Schuster et al., 2019] has found that some NLP models can solve the questions fairly well by looking only at the hypothesis (or "conclusion" in some work) in the datasets. It is widely speculated that this is because in many datasets, the hypotheses are manually crafted and may contain artifacts that would be predictive of the correct answer. Such "hypothesis-only" tests can identify problematic questions in the dataset if the question can be answered correctly without the premise. While such a method to evaluate the quality of a dataset is theoretically sound, it i) usually relies on training a heavy-weight model such as Bert, which is costly to evaluate, ii) does not provide explanation why the question is a culprit, and iii) cannot be used to evaluate a model since a model that can make a correct prediction using only the hypothesis is not necessarily a bad model: it is just not given the complete data.
Inspired by black-box testings in software engineering, CheckList [Jurafsky et al., 2020] assesses the weakness of models without the need to know the details of the model. It does so by providing additional stress test cases according to predefined linguistic features. Unfortunately, to ensure the correctness of these additional cases, the templates must be carefully crafted with substantial restrictions, thus limiting the testing space and complicating the implementation. Furthermore, with CheckList, you only get to know what the model is incapable of doing but won't know what the model has learned from the data. (1) not a cue (2) (3) Figure 1: Example of a cue.
In this paper, our view is that the existing test sets for these tasks are not sufficiently exploited. Why do we go the extra mile to generate new test cases which are potentially incorrect, when we can test the models using existing test sets but from different perspectives? With this objective in mind, we propose ICQ ("I-see-cue"), an open-source evaluation framework 1 for evaluating both the dataset and the corresponding models. In this framework, one test dataset can be seen as multiple test sets from different perspectives.
Previous studies [Gururangan et al., 2018;Sanchez et al., 2018;Poliak et al., 2018] showed that statistical bias on linguistic features (e.g., sentiment, repetitive words and even shallow n-grams) which have statistical correlation with specific labels in benchmark datasets can be predictive of the correct answer. We call such biases artificial spurious cues when they appear both in the training and test datasets with a similar distribution over the prediction values. We illustrate this in Figure 1. Once these cues are neutralized from the test data, previously successful models may degrade substantially on it, suggesting that the model has taken advantage of the biased feature and is hence not as robust as assumed against with such cues.
In summary, this paper makes the following contributions: • we provide a light-weight but effective method to uncover the statistical biases and cues in NL reasoning datasets; • we propose two simple tests to quantitatively and visually assess whether a given model has taken advantage of a spurious cue when making predictions; • we evaluate the statisical bias issues comprehensively on 10 popular NLR datasets and 4 models and not only reaffirm some of the findings from previous work but also discover some new perspectives in these datasets and models; • we created an online demonstration system to showcase the results and invite users to evaluate their own datasets and models.

Preliminary Definition
We define an instance x of a natural language reasoning (NLR) task dataset X as where p is the context against which to do the reasoning (p corresponds to "premise" in Example 1); h is the hypothesis given the context p; l ∈ L is the label that depicts the type of relation between p and h. The size of the relation set L varies with tasks. There is another type of natural language reasoning tasks which are also in the form of multiple-choice questions, but their choices are a fixed set of labels, as shown below.  Ending 2: He is happy now.
We can transform the this case into two separate problem instances, still in the same form as in Eq.
(1), u 1 = (context, ending1, f alse) and u 2 = (context, ending2, true), where L = true, f alse. The ICQ framework is illustrated in Figure 2. In data filtering phase, it extracts from the dataset those problem instances that contain a given linguistic feature f . In cue discovery phase, it identifies the possible cues in this dataset. Finally, in model probing phase, it does two tests: "accuracy test" and "distribution test". Next we will discuss these phases in more details.

Linguistic Features
In this work, we consider the following linguistic features: Word (unigram tokens in the input sentences), Typos, NER (named entity recognition), Tense (temporal order of events), Negation, Sentiment, and Overlap (words occurring both in the premise and the hypothesis). The above list is by no means exhaustive, but just a starting point for users who can come up with additional features that are relevant to their task or domain.

Word
For a dataset X, we collect a set of all words V that ever exist in X. A word feature is defined as the existence of a word w ∈ V either in the premise or the hypothesis. Because V is generally very large, in practice, we may narrow it down to words that sufficiently popular in X. That is, we may remove words that seldom appear in X.

Sentiment
For each data instance x, we can compute its sentiment value as: where polar(w) is the sentiment polarity (-1, 0, or 1) of w determined by a look-up from a pretrained sentiment lexicon 2 .
We say x has a positive/negative/neutral sentiment feature if S(x) = 1, -1 or 0, respectively.

Tense
We say that an instance x has past, present or future tense feature if x carries one of these tenses, respectively, by the POS tag of the root verb in p or h.

Negation
Previous work has observed that negative words ("no", "not" or "never") may be indicative of a certain label in NLI tasks for some models. The existence of a negation feature in x is decided by dependency parsing 3 .

Overlap
In many models, substantial word-overlap between the premise and the hypothesis sentences causes incorrect inference, even if they are unrelated [McCoy et al., 2019]. We define that an overlap feature exists in x if there's at least one word (except for stop words) that occurs both in p and h.

NER
We define the NER feature as the existence of either PER, ORG, LOC, TIME, CARDINAL entity in x. We use the NLTK ner toolkit for this purpose.

Typos
We say an instance x has typo feature if there exists at least one typo in x. We use a pretrained spelling model 4 to detect all typos in a sentence. We don't distinguish the types of mispellings here. As we mentioned in Example 2, multiple choice questions are each split into two data instances with opposite labels (T or F), and the premises in these two instances are identical. Therefore, it is not useful to detect features within the premises alone. Consequently, for MCQ type of datasets, all the above features except for Overlap are only applied on the hypotheses.

Discovering Cues in Dataset
Once we have defined the linguistic features, we can build a data filter for each feature values. A filter takes a dataset and returns a subset of instances associated with that feature value. For example, there is a filter for the word "like"; there is a filter for "PER" entity; and there is filter for "negative" sentiment, etc.
For each feature f , we apply its filter to both the training data and test data of X, denoted as R and S in Figure 2, resulting in R f and S f . Only those features that appear both in the training and test data are qualified as possible cues for a dataset. Let y i be the number of instances with label l i in the filtered dataset, then we can compute the bias of the label distribution for a filtered set as the mean squared error (MSE): whereŷ i is the mean of y i . The larger mse(Y ), the more "pointed" the label distribution and more biased. Furthermore, if the filtered training set and the filtered test set are biased similarly, the Jensen-Shannon Divergence [Lin, 1991] between them is small: where M = 1 2 (R f + S f ). Finally, we define a cueness score as which represents how much a dataset X is biased against a feature f .

Probing Bias in Model
Suppose we already know that a dataset X is infected with a cue f from previous test in Section 3.2. However, just because the dataset is infected with a cue doesn't mean the model trained from this dataset necessarily exploits that cue.
Here we propose a simple method to probe any model instance trained from the given biased dataset 5 to see if it actually takes advantage of that cue f and by how much. We can do that through two simple tests: accuracy test and distribution test. In accuracy test, we simply assess the prediction accuracies of the model M on the filtered test set and on the remaining test data, and call them acc(S f ) and acc(S nf ), respectively. The accuracy test says that if the difference between these two accuracies, i.e, ∆ = acc(S f ) − acc(S nf ) is greater 0, then the model is considered to be biased and to have exploited this cue. The value of ∆ measures the extent of the bias.
Distribution test is a visual test. We first create a "stress data set" S f by "flattening" the label distribution in S f . We achieve that by replicating random instances from all labels except the most popular label in the filtered test set and adding them back into the set. The repetition augmentation procedure stops when the feature distribution based on each label is balanced. This way we have effectively removed the bias in the filtered test set and presumably posed a challenge to the model. Next we apply the same model on the stress test set to get prediction results. We compare the label distribution of the prediction results on the stress test set with the label distribution of the filtered training data. The idea is, if the filtered training data contains a cue, its label distribution will be skewed toward a particular label. If the model exploits this cue, it will prefer to predict that label as much as possible, even amplifying the skewness of the distribution, despite that the input test set has been neutralized already. We hope to witness such an amplification in the output distribution to capture the weakness in the model.
The above two tests are related but not equivalent and their outcome complement and reinforce each other.
We first show the experimental setup and then give the results on cue discovery as well as model probing along with some analysis.
The whole framework has been implemented into an online demo at http://anonymized.for.blind.review.

Setup
We evaluate this framework on 10 popular NLR datasets and 4 well-known models, namely FASTText (FT), ESIM (ES), BERT (BT) and RoBERTA (RB) on these datasets. All these datasets except for SWAG and RECLOR are collected through crowdsourcing. SWAG is generated from an LSTMbased language model. Specifications of the datasets are listed in Table 1

Hypothesis-only Tests
As a comparison to our framework, we first show the hypothesis-only test results on our 4 models and 10 datasets. In this test, we apply the models trained on full training data (with both premise and hypothesis) of the 10 datasets, and test their accuracies on the hypothesis-only test data (by stripping the premises from the questions in the test set). Table  2 shows the results, compared with the original accuracies using the full test data.
We further plot the four models hypothesis-only accuracies against voting by majority results in Table 2 in Figure 3. This figure depicts the "weakness" of the datasets to these models. The higher the bars, the weaker the dataset. We can see that SWAG, SNLI and MNLI are generally easier, whereas ARCT ADV is a hard task (the deviation results approach to zero).
Next, we plot the differences between the model accuracies on the full test data and the accuracies on the hypothesis-only  data in Figure 4. This experiment evaluates the robustness of the models. We see that the bars for FastText or ESIM are very short, while the bars are much longer for BERT and RoBERTA. This shows that from the hypothesis-test point of view, BERT and RoBERTA are more robust against the artifacts in the datasets, because the duo do not perform as well when given only the ending of the questions. These preliminary results serve as the basis for our findings next.

Cues in Datasets
We first filter the training and test data for each dataset using all the features defined in this paper. Left half of Table  3 shows the top 5 cues we have discovered as well as their cueness score for each of the 10 datasets. ARCT adv is an adversarial dataset and is known to be well balanced on purpose.
As a result, we only managed to find one cue which is OVER-LAP and its cueness score is very low. This is not surprising, because OVERLAP is the only "second-order" feature in our list of linguistic features that is concerned with tokens in both the premise and hypothesis, and likely escaped from the data manipulation by the creator. In most of the datasets, the top 5 cues discovered are word features, but besides OVERLAP, we do see NEGATION and TYPO showing up in the lists. In fact, SENTIMENT and NER features would have shown up if we expanded the list to top 10. It is also interesting to see several features previously reported to be biased by other works, such as "not" and NEGATION in ARCT, "no" in MNLI and SNLI, and "like" in ROCStory. Especially in MNLI, all the five cues discovered are related to negatively toned words, suggesting significant human artifacts in this datasets.
In the results, we also identify that some of the word cues are indicative of certain syntactic/semantic/sentiment patterns in the questions. For example, "because" in SNLI indicates a causal-effect structure; "like" in ROCStory indicates positive sentiment; "probably" and "may" in RACE indicate uncertainty, etc.
If we sum up the top 5 cueness scores for each dataset, we find that overall SNLI, RACE, ROCStory and MNLI carry more cueness than others, while ARCT adv has the smallest cueness. This result is generally consistent with our findings in the hypothesis-only test (see Figure 3) earlier, though now we can pinpoint what causes the weaknesses in these four datasets. The only exception is SWAG, which didn't emerge as a very weak dataset in the experiment here, but was found very biased in the hypothesis-only test. The reason is SWAG is the biggest dataset among the ten and we discovered more cues in it than the other 9 combined. Therefore, the top 5 cues are insufficient to represent the full scale of its weakness, which is showed by the hypothesis test as it gives the full picture.

Biases in Models
For each feature and a dataset, we train four models on its original training set, and test the models on its full test set, feature-filtered test set, and neutral test set. We first show the result of "accuracy tests" in Table 3. If ∆ is positive for a model on a feature, it means that the model exploits the existence of this feature. Conversely, the model exploits the non-existence of the this feature. A model is more robust against biases in the data, if ∆ is close to zero. Therefore, the bottom of Table 3 shows that, across all 10 datasets, by the sum of the absolute values of ∆, RoBERTA < BERT < ESIM  < FastText. This again is consistent with our hypothesis-only test earlier and the community's common perception of these popular models. However, if we delve into individual datasets and features, situation can be a bit murkier. For example, it seems that FastText tends to pick up more individual word cues than semantic cues, but more complex models such as BERT and RoBERTA appear to be more sensitive to structural features such as NEGATION and SENTI-MENT, which are actually classes of words. This can be well explained by the way FastText is designed to model words more than syntactic or semantic structures.
The fact that FastText is strongly negatively correlated with TYPO is also interesting. We speculate that FastText might have been trained with a more orthodoxical vocabulary and thus less tolerant to typos in text.
We further invesigate the models using the "distribution test". We show three insteresting findings in Figure 5. We observe that all models on cue "no" in MNLI achieve positive ∆ in Table 3, and fastText in particular. Consistent with the "Ac- curacy test", we find the predicting label distribution skewness is amplified in Figure 5a for fastText and ESIM -with "no" in sight, they prefer to predict "Contradiction" even more than the ground truth in training data. On the contrary, BERT and RoBERTA are only moderate in following the training data.
If cue "no" is very good at tricking the models, cue "above" is not as successful. Figure 5b shows that the distribution of predicting result for ESIM in ARCT is completely opposite to the training data. This explains while ∆ = −8.43 in Table  3 and demonstrates that models may not take advantage of the cue even though it is right there in the data. Similarly, the "flatness" in BERT and RoBERTA can also explain their low ∆ values in Table 3.
The example of cue "threw" presents an outlier for BERT, because the distribution test result is inconsistent between the accuracy test: The accuracy deviation is very high for BERT, but its prediction distribution is flat. We haven't seen a lot of such contradictory cases so far. But when it happens, as it is here, we give BERT the benefit of the doubt that it might not have exploited the cue "threw".

Related Work
Our work is related to and, to some extent, comprises of elements in three research directions: spurious features analysis, bias calculation and dataset filtering.
Spurious features analysis has been increasingly studied recently.
Much work [Sharma et al., 2018;Srinivasan et al., 2018;Zellers et al., 2018] has observed that some NLP models can surprisingly get good results on natural language understanding questions in MCQ form without even looking at the stems of the questions. Such tests are called "hypothesis-only" tests in some works. Further, some research [Sanchez et al., 2018] discovered that these models suffer from an insensitivity to certain small but semantically significant alterations in the hypotheses, leading to speculations that the hypothesis-only performance is due to simple statistical correlations between words in the hypothesis and the labels. Spurious features can be classified into lexicalized and unlexicalized [Bowman et al., 2015]: lexicalized features mainly contain indicators of n-gram tokens and cross-ngram tokens, while unlexicalized features involve word overlap, sentence length and BLUE score between the premise and the hypothesis. Naik et al. [2018] refined the lexicalized classification to Negation, Numerical Reasoning, Spelling Error. McCoy et al. [2019] refined the word overlap features to Lexical overlap, Subsequence and Constituent which also considers the syntactical structure overlap. Sanchez et al. [2018] provided unseen tokens an extra lexicalized feature.
Bias calculation is concerned with methods to quantify the severity of the cues. Some work [Clark et al., 2019;He et al., 2019;Yaghoobzadeh et al., 2019] attempted to encode the cue feature implicitly by hypothesis-only training or by extracting features associated with a certain label from the embeddings. Other methods compute the bias by statistical metrics. For example, Yu et al. [2020] used the probability of seeing a word conditioned on a specific label to rank the words by their biasness. LMI [Schuster et al., 2019] was also used to evaluate cues and re-weight in some models. However, these works did not give the reason to use these metrics, one way or the other. Separately, Ribeiro et al. [2020] gave a test data augmentation method, without assessing the degree of bias in those datasets.
Dataset filtering is one way of achieving higher quality in datasets by reducing artifacts. In fact, datasets such as SWAG and RECLOR evaluated in this paper were produced using variants of this filter approach which iteratively perturb the data instances until a target model can no longer fit the resulting dataset well. Some methods [Yaghoobzadeh et al., 2019], instead of preprocessing the data by removing biases, leave out samples with biases in the middle of training according to decision made between epoch to epoch. Bras et al. [2020] investigated model-based reduction of dataset cues and designed an algorithm using iterative training. Any model can be used in this framework. Although such an approach is more general and more efficient than human annotating, it heavily depends on the models. Unfortunately, different models may catch different cues. Thus, such methods may not be complete.

Conclusion
We develop a light-weight framework that evaluates the potential biases and cues in NLR multiple choice datasets and further shed light on the exploration of models at least from the perspective of the statistical cues. We experimented on a large range of datasets covering different tasks and conclude that the new evaluation framework is effective in discovering bias problems in both the datasets and some popular models.