Mitigating Spurious Correlation in Natural Language Understanding with Counterfactual Inference (2022)

Abstract: Despite their promising results on standard benchmarks, NLU models are still prone to make predictions based on shortcuts caused by unintended bias in the dataset. For example, an NLI model may use lexical overlap as a shortcut to make entailment predictions due to repetitive data generation patterns from annotators, also called annotation artifacts. In this paper, we propose a causal analysis framework to help debias NLU models. We show that (1) by defining causal relationships, we can introspect how much annotation artifacts affect the outcomes. (2) We can utilize counterfactual inference to mitigate bias with this knowledge. We found that viewing a model as a treatment can mitigate bias more effectively than viewing annotation artifacts as treatment. (3) In addition to bias mitigation, we can interpret how much each debiasing strategy is affected by annotation artifacts. Our experimental results show that using counterfactual inference can improve out-of-distribution performance in all settings while maintaining high in-distribution performance.

## introduction mitigating spurious correlations is crucial to the robustness of any learning method. although deep learning models can perform well on conventional natural language understanding (nlu) benchmarks, researchers have found that these models leverage superficial patterns to produce correct predictions rather than learning the underlying tasks @xcite . as a result, these models perform poorly when applied on out-of-distribution datasets, particularly on challenge sets that highlight models' reliance on spurious patterns by testing them on counterexamples. for example, @xcite show that 1 the work was performed while kanruethai masuk was an intern at vistec. the code is available at https://github. com/c4n/debias_nlu . ## related work earlier debiasing techniques involve reweighting the cross-entropy losses of bias-sensitive samples. samples that can be handled effectively by a bias model are considered bias-sensitive. in contrast to the traditional training paradigm where each training example has the same importance, reweighting assigns different weights to examples based on their sensitivity to biases. a common way to reweight is to create a bias model trained on handcrafted features @xcite , and assign a weight to each training sample using the probability of the correct label from the bias model. karimi mahabadi et al. (2020) extended this idea by combining scores from multiple bias-only models. in addition, karimi mahabadi et al. (2020) another prevailing approach is model ensembling. @xcite reinterpreted product-of-experts (poe) @xcite for nlu debiasing. they used a bias model to create an ensemble with the main model with the aim that the main model learns all the information except the bias. the ensemble decreases the training loss for a sample that the bias model correctly predicts when updating the main model. @xcite proposed a domain-knowledge-free approach where the bias model was a neural network with small parameters. utama et al. (2020a) proposed a self-distillation framework, confidence regularization (conf-reg), that used a bias model to produce confident scaling scores to calibrate the confidence of the model's predictions. alternatively, @xcite calculated the scaling scores from the local mutual information and integrated gradient explanation. although these methods have successfully improved the robustness on the challenge sets, they can only be used to train new models. as a result, we cannot apply it to the existing models without retraining. counterfactual inference: in contrast to traditional inference techniques in machine learning, where the argmax of the posterior probability is the prediction outcome, we can instead base the prediction on causal effects. recent debiasing techniques integrate the idea of counterfactual inference into their frameworks across multiple tasks such as question answering @xcite , visual question answering @xcite ), text classification @xcite , recommendation @xcite , and information extraction @xcite . one dominant technique is based on causal mediation analysis (cma). it involves decomposing the total effect (te) into pure direct effect (pde) and total indirect effect (tie). @xcite , @xcite , and @xcite make a prediction by selecting the class with the highest tie. te can also be decomposed into total direct effect (tde) and pure indirect effect (pie). @xcite utilize tde to make predictions. apart from debiasing, cma can be used to analyze biases in transformer language models @xcite . alternatively, @xcite use te to predict by calculating te between a normal input (factual) and masked/partially masked input (counterfactual), without decomposing te. while reweighting, model ensembling, and selfdistillation are effective nlu debiasing methods; we can further incorporate the idea of counterfactual inference to improve the debiasing performance further as well as using cma as a tool to investigate the ability to debias. ## methodology this section introduces key causal inference concepts used in this paper. first, we show how an nlu task can be presented via a causal graph to show causal relationships and implications of the biases in the causal relationships. then, we discuss the causal effect and cma-the central idea that we use to decompose effects from biases. we also discuss a counterfactual inference framework-an alternative to a standard inference framework that uses the argmax from the softmax as the prediction. lastly, we discuss how we can apply cma to quantify the bias effect of an annotation artifact. ## experiments our experiments address the following research questions: (1) can we exploit knowledge from causal relationships to debias nlu tasks? (2) do different causal queries lead to different debias performances? (3) can we measure the impact of annotation artifacts on the prediction outcomes? we benchmark our method on three english relation-identification tasks: natural language inference, fact verification, and paraphrase identification. nli represents a generic benchmark for testing a machine's ability to identify a relationship between two texts. the other two tasks benchmark relationship-identification ability in real-world applications. each task contains both standard indistribution and challenge datasets to test the generalization ability. we train all our models only on the in-distribution datasets and test them on both standard benchmark datasets and challenge sets. ## conclusion we introduce a counterfactual framework for debiasing nlu models. our framework can improve robustness across three nlu tasks. it also allows us to analyze the impact of annotation artifacts. in contrast to previous debiasing nlu literature that focuses on reweighting, model-ensemble, and self-distillation, we present a causal perspective on this problem that can be combined with previous methods to enhance the performances further. counterfactual inference gives us the flexibility to apply it to any existing model without changing its parameters by focusing on the inference stage. unlike previous counterfactual inference for debiasing literature, where the main focus is using tie for inference only, we also used tie for analysis. moreover, we also provide another causal viewpoint by looking at the model as the treatment to construct a new causal query that outperforms tie across multiple challenge sets. causality can help us improve the generalization and robustness of nlu models. in the future, we will utilize causality techniques to identify and remove biases in nlu tasks.