Mitigating Spurious Correlation in Natural Language Understanding with Counterfactual Inference

Can Udomcharoenchaikit, Wuttikorn Ponwitayarat, Patomporn Payoungkhamdee, Kanruethai Masuk, Weerayut Buaphet, Ekapol Chuangsuwanich, Sarana NutanongEMNLP 2022

Introduction

Natural Language Understanding (NLU) models often achieve high performance by exploiting "shortcuts" or spurious correlations within datasets rather than developing a true understanding of language. In tasks like Natural Language Inference (NLI), models frequently rely on annotation artifacts—such as lexical overlap between a premise and a hypothesis—to predict labels like "entailment." While effective on standard benchmarks, these models fail significantly when faced with "challenge sets" designed to break these shortcuts. This paper proposes a causal analysis framework using counterfactual inference to identify and mitigate these biases at test time.

Methodology: Causal Mediation Analysis

The authors address spurious correlations by modeling the NLU process through a causal graph. In this framework, A represents the annotation artifact (the shortcut), X is the input text, and Y is the model's prediction. The goal is to separate the Total Effect (TE) of an input into two components: the Pure Direct Effect (PDE), which represents the influence of the bias or shortcut, and the Total Indirect Effect (TIE), which represents the actual linguistic reasoning performed by the model.

Overview of the annotation process, causal graph, and counterfactual inference framework.

Key Innovations

A significant contribution is viewing the model itself as the treatment ($TE_{model}$). This approach asks: "What would the prediction be if we used a sophisticated deep learning model instead of a simple bias-only model?" This method allows for inference-time debiasing of pre-trained models (e.g., BERT, RoBERTa) without requiring expensive retraining. By training a small "bias-only" model to estimate shortcut influence, the bias can be subtracted during inference. A learnable parameter ($c$) is used to control the "sharpness" of this removal, ensuring the model remains accurate on standard data.

Experimental Setup

The framework was evaluated across three major NLU tasks using standard training sets and specific challenge sets to test robustness:

  • Natural Language Inference (NLI): Trained on MNLI; evaluated on HANS (designed to trip up models relying on lexical overlap).
  • Fact Verification: Trained on FEVER; evaluated on FEVER Symmetric.
  • Paraphrase Identification: Trained on QQP; evaluated on PAWS (uses word scrambling to create difficult non-paraphrases).

Results and Discussion

The counterfactual inference methods consistently improved performance on challenge sets without sacrificing accuracy on in-distribution data.

Performance comparison of various debiasing methods across NLI, Fact Verification, and Paraphrase Identification tasks.

As shown in the results, applying the $TE_{model}$ query to a baseline BERT model on the HANS dataset improved accuracy from 65.55% to 68.08%. When combined with training-time debiasing methods like Confidence Regularization (Conf-Reg), performance reached 70.99%. The improvements were even more pronounced in paraphrase identification (PAWS), where the score jumped from 31.34% to 58.50%. Crucially, these gains on out-of-distribution (OOD) data did not degrade performance on standard sets like MNLI dev-mm, which remained stable around 84-85%.

Conclusion and Limitations

While the causal decomposition framework proves effective, it relies on a linearity assumption that may not perfectly hold for highly non-linear NLU models. Additionally, the framework shows a slight preference for low-confidence predictions, which requires careful monitoring to ensure it is not validating biased models that simply produce low-confidence outputs. Future work aims to extend these techniques to mitigate more complex biases, such as gender or racial bias, in large language models.

Summary updated

BibTeX
@inproceedings{udomcharoenchaikit2022mitigating,
  author = {Can Udomcharoenchaikit and Wuttikorn Ponwitayarat and Patomporn Payoungkhamdee and Kanruethai Masuk and Weerayut Buaphet and Ekapol Chuangsuwanich and Sarana Nutanong},
  title = {{Mitigating Spurious Correlation in Natural Language Understanding with Counterfactual Inference}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2022},
  doi = {10.18653/v1/2022.emnlp-main.777},
}
Figure