A voiding the H ypothesis- O nly B ias in N atural L anguage I nference via E nsemble A dversarial T raining (2020)

Abstract: Natural Language Inference (NLI) datasets contain annotation artefacts resulting in spurious correlations between the natural language utterances and their respective entailment classes. These artefacts are exploited by neural networks even when only considering the hypothesis and ignoring the premise, leading to unwanted biases. Belinkov et al. (2019b) proposed tackling this problem via adversarial training, but this can lead to learned sentence representations that still suffer from the same biases. We show that the bias can be reduced in the sentence representations by using an ensemble of adversaries, encouraging the model to jointly decrease the accuracy of these different adversaries while fitting the data. This approach produces more robust NLI models, outperforming previous de-biasing efforts when generalised to 12 other NLI datasets (Belinkov et al., 2019a; Mahabadi et al., 2020). In addition, we find that the optimal number of adversarial classifiers depends on the dimensionality of the sentence representations, with larger sentence representations being more difficult to de-bias while benefiting from using a greater number of adversaries.

## introduction nli datasets are known to contain artefacts associated with their human annotation processes @xcite . neural models are particularly prone to picking up on artefacts, relying on these biases and spurious correlations rather than acquiring a true understanding of the task. because these artefacts are often dataset specific @xcite , models that rely on these artefacts consequently generalise poorly when tested on other datasets @xcite . one way to alleviate this problem is via adversarial training: the task classifier and an adversarial classifier jointly share an encoder, with the adversarial classifier trained to produce the correct predictions by analysing the artefacts in the training data. the encoder optimises the training objective while also reducing the performance of the adversarial classifier. in this context, adversarial training aims to produce sentence representations that do not incorporate information about the artefacts (or bias) in the data, resulting in less biased models that generalise better. previous studies show that adversarial training is associated with better generalisation performance across other datasets, although there are concerns that the biases are not removed from the model sentence representations, with classifiers able to relearn such biases from the representations after these are frozen @xcite . it is therefore unclear whether any improvements are as a result of the de-biasing, and whether actually removing these biases from the model representations will further improve generalisation. we focus our effort on this discrepancy and argue that, in order to show de-biasing is effective, improvements in performance should also correspond to an observed reduction of the bias in the model representations, therefore creating representations that generalise better to other data. in this paper we show that nli models can avoid learning from the hypothesis-only bias, using an ensemble of adversarial classifiers to prevent the bias being relearnt from a model's representations. furthermore, we show that the more bias is removed from the model representations, the better these models generalise to other nli datasets. removing the bias from the representations proves to be a highly effective strategy, producing more robust nli models that outperform previous de-biasing efforts when tested on 12 different nli datasets @xcite . in addition, we show that the ability to de-bias a sentence representation depends on its dimensionality, with large sentence representations being harder to de-bias and requiring more adversarial classifiers during training. in summary, this paper makes the following core contributions: i) we investigate whether using an ensemble of adversarial classifiers can remove the hypothesis-only bias within nli models. for large enough dimensions, this method achieves a statistically significant reduction of the bias. ii) we test whether removing more of the bias improves how well the model generalises. our method improves model accuracy across 12 nli datasets and outperforms previous research @xcite . iii) we inspect the optimal number of adversaries to use depending on the dimensionality of the sentence representations. we find that as this dimensionality is increased, more adversaries are required to de-bias a model. iv) we compare the effect of adversarial training with a linear classifier to using a non-linear multi-layer perceptron as the adversary, showing that using a more complex adversarial classifier is not always beneficial. instead, the best choice of adversary depends on the classifier being used to relearn the bias. foot_0 2 related work the hypothesis-only bias @xcite and @xcite demonstrate how models can predict the class within the snli dataset when only processing the hypothesis, reaching accuracy scores as high as twice the majority baseline (67% vs. 34%). this is possible due to hypothesisonly biases, such as the observation that negation words ("no" or "never") are more commonly used in contradicting hypotheses @xcite . the hypothesis sentence length is another example of an artefact that models can learn from, with entailment hypotheses being, on average, shorter than either contradiction or neutral hypotheses @xcite . @xcite show that the hypothesis-only bias predictions are significantly better than the majority baseline for snli, although this is not the case for the sick dataset @xcite . @xcite find that human-elicited datasets such as snli and multinli have the largest hypothesis-only bias. as a result, our paper focuses on removing the hypothesis-only bias from snli, the dataset with the largest hypothesis-only bias reported by @xcite . this bias is also dataset specific, with @xcite finding that only multinli shares some of the same hypothesis-only bias as the snli dataset. @xcite and @xcite show that models trained on the snli and multinli datasets do not necessarily learn good representations for other nli datasets, such as sick. analogous results were also reported by @xcite for more complex models. gururangan et al. (2018) and tsuchiya (2018) identify how nli models perform worse on hard examples, which are defined as the examples that a hypothesisonly model has misclassified. this suggests that the success of nli models may be overstated, with models relying on artefacts in their training data to achieve high performance @xcite . our paper will assess whether nli models that no longer learn from the hypothesis-only bias can still retain this high level of accuracy. ## ensemble adversarial training we follow an adversarial training approach for reducing the hypothesis-only bias contained within the sentence representations. specifically, we generalise the adversarial training framework proposed by @xcite to make use of multiple adversaries: n hypothesis-only adversaries are jointly trained for predicting the relationship between the premise and hypothesis given only the representation of the hypothesis from the sentence encoder. at the same time, the sentence encoder together with an hypothesis-premise model are jointly trained to fit the training data, while decreasing the accuracy of these adversaries. formally, given a hypothesis h and a premise p, the predictions of the hypothesis-premise model ŷ and the i-th hypothesis-only adversary ŷa i can be for-malised as follows: to test the impact of using multiple adversarial classifiers when changing the dimensionality of the representations, we train with {1, 5, 10, 20} bias classifiers for {256, 512, 1024, 2048} dimensional sentence representations. the learned sentence representation is then frozen, and 20 adversarial classifiers are randomly reinitialised before they attempt to re-learn the hypothesis-only bias from the frozen de-biased sentence representation. the maximum accuracy from across the 20 adversarial classifiers is then reported after trying to remove the bias, showing the maximum bias that can still be learnt from the representation. the ability of adversarially trained models to de-bias sentence representations is tested across a range of λ hyper-parameters {0.001, 0.01, 0.1, 0.2, 0.3, ...0.8, 0.9, 0.99, 0.999}. this shows whether any improvement is due to the choice of λ, or whether there is an improvement regardless. model architecture following the same experimental set-up as @xcite and @xcite , we use an infersent model @xcite with pretrained glove 300dimensional word embeddings. the infersent model architecture consists of a long short-term memory network (lstm, hochreiter and schmidhuber, 1997) encoder which creates a 2048 dimensional sentence representation. ## results we use an ensemble of multiple adversarial classifiers during model training to understand whether it is possible to reduce the bias within the model sentence representations. our results show that training a model with an ensemble of adversaries does reduce the model bias, doing so across each dimensionality of sentence representations tested. moreover, more adversaries are required for de-biasing larger dimensional sentence representations. when using just one adversarial classifier for a 2,048 dimensional sentence representation, after the representation was frozen and the bias classifiers had a chance to re-learn the hypothesis-only bias, the accuracy of the bias classifiers increased to 62% (see for 2,048 dimensional sentence representations, as the number of adversaries are increased up to 20, less bias can be found in the resulting de-biased sentence representation. when the number of adversarial classifiers are increased from 1 to 20, the accuracy of the hypothesis-only bias classifiers reduces from 62% to 53% (see the higher the dimensionality of the sentence representation, the more difficult it is to remove its bias. additionally, the optimal number of adversarial classifiers depends on the dimensionality of the representations, with more adversaries required for higher dimensions. for 2,048 dimensions this is 20 adversaries, while for 256 dimensions this reduces to 5 adversaries (see the improvements in de-biasing when using an ensemble of adversaries is consistent across different λ hyper-parameter values: when comparing a model trained with one adversary to a model trained with 20 adversaries, the model trained with 20 consistently removes more bias. using a single adversary does reduce the bias for λ values of 0.9 and above, but at the expense of the overall model accuracy which reduces dramatically (fig. 2 ). this suggests that valuable information about the hypothesis is being removed instead of just the bias. interestingly, when using 20 adversaries, even for the largest values of λ, the overall model accuracy does not start to decrease. ## conclusions we set out to prevent nli models learning from the hypothesis-only bias by using an ensemble of adversarial classifiers. our method produced sentence representations with significantly less bias, and these more robust models generalised better to 12 different nli datasets, improving over previous approaches in the literature @xcite . the higher the dimensionality of the sentence representations, the harder it is to de-bias these representations and the higher the optimal number of adversarial classifiers appears to be. furthermore, the models trained with an ensemble of adversaries also performed better when tested on snli-hard compared to using only one adversarial classifier. this is the behaviour expected from de-biased models that no longer use the hypothesis-only bias to inform their predictions. by preventing a linear classifier from learning the bias from the de-biased representations, we conclusively show that a model using such a classifier with these representations will not make decisions based on the bias. however, after implementing the adversarial training, a non-linear classifier may still be able to detect the bias in the sentence representations where linear classifiers are not able to. while we illustrate the conditions under which biases are removed from a linear classifier, preventing a nonlinear classifier from learning the biases is more difficult and merits further experimentation.