End-to-End Self-Debiasing Framework for Robust NLU Training

Abbas Ghaddar, Philippe Langlais, Mehdi Rezagholizadeh, Ahmad Rashid

Abstract

Existing Natural Language Understanding (NLU) models have been shown to incorporate dataset biases leading to strong performance on in-distribution (ID) test sets but poor performance on out-of-distribution (OOD) ones. We introduce a simple yet effective debiasing framework whereby the shallow representations of the main model are used to derive a bias model and both models are trained simultaneously. We demonstrate on three well studied NLU tasks that despite its simplicity, our method leads to competitive OOD results. It significantly outperforms other debiasing approaches on two tasks, while still delivering high in-distribution performance.

Introduction

Modern NLU models, particularly those based on the Transformer architecture like BERT, often achieve high scores on standard benchmarks by identifying spurious correlations—shortcuts in the data that do not represent true linguistic logic. For instance, in Natural Language Inference (NLI) tasks, a model might learn that the presence of the word "not" frequently correlates with a "contradiction" label, regardless of the actual semantic relationship between sentences.

While these shortcuts yield high performance on in-distribution (ID) data, they fail on out-of-distribution (OOD) challenge sets designed to subvert these biases. Previous solutions typically required a two-stage process: manually defining biases to train a separate "bias model," which then guides the "main model." This approach is labor-intensive and requires prior knowledge of specific dataset biases.

Methodology: The Self-Debiasing Framework

We propose an end-to-end self-debiasing framework that eliminates the need for manual feature engineering or multi-stage training. The approach is built on three core components:

  1. Internal Bias Model: Instead of an external architecture, a simple attention-based classifier is attached to the intermediate layers (typically layers 3 or 4) of the main BERT model. This leverages the tendency of bottom layers to capture the lexical and syntactic information where biases often reside.
  2. Biased Feature Regularization: Once the bias model identifies tokens used for its decision via attention weights, Gaussian noise is injected into those specific representations. This "blurs" the shortcuts, forcing the main model to rely on deeper semantic features.
  3. Mutual Re-weighting: The main and bias models are trained simultaneously, re-weighting each other's training samples. If the bias model is highly confident, the main model’s loss for that sample is down-weighted to prevent it from learning the easy shortcut.
Architecture of the end-to-end self-debiasing framework, showing the internal bias model and noise injection mechanism.

Experimental Evaluation

The framework was evaluated across three major NLU tasks, comparing standard ID sets against OOD challenge sets:

  • Natural Language Inference: MNLI (ID) vs. HANS (OOD).
  • Fact Verification: FEVER (ID) vs. FEVER Symmetric (OOD).
  • Paraphrase Identification: QQP (ID) vs. PAWS (OOD).

Key Results and Analysis

The proposed method delivered significant gains in OOD robustness while maintaining competitive ID performance. Notably, on the HANS dataset, the framework achieved 71.2% accuracy, a substantial improvement over the vanilla BERT-base (62.4%) and previous state-of-the-art debiasing methods. Similarly, on FEVER Symmetric, it reached 63.8%, compared to the baseline's 55.1%.

Performance comparison on ID and OOD datasets against baseline models and previous debiasing techniques.

Ablation studies (shown in the table above) confirm that both noise injection and mutual re-weighting are critical. Removing either component leads to a significant drop in OOD performance across all tasks. Furthermore, the framework is highly efficient, adding only approximately 0.5M parameters to the 110M parameter BERT-base model without increasing overall training time.

Conclusion

This work demonstrates that the "bias model" necessary for debiasing is already present within the shallow layers of the main model. By tapping into these internal representations and using noise as a regularizer, we can build more robust NLU systems that resist spurious correlations. Future work will focus on making the framework hyperparameter-free and extending it to more complex tasks like Question Answering.

Summary updated

Abstract

Existing Natural Language Understanding (NLU) models have been shown to incorporate dataset biases leading to strong performance on in-distribution (ID) test sets but poor performance on out-of-distribution (OOD) ones. We introduce a simple yet effective debiasing framework whereby the shallow representations of the main model are used to derive a bias model and both models are trained simultaneously. We demonstrate on three well studied NLU tasks that despite its simplicity, our method leads to competitive OOD results. It significantly outperforms other debiasing approaches on two tasks, while still delivering high in-distribution performance.
BibTeX
@inproceedings{ghaddar2021end,
  author = {Abbas Ghaddar and Philippe Langlais and Mehdi Rezagholizadeh and Ahmad Rashid},
  title = {{End-to-End Self-Debiasing Framework for Robust NLU Training}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2021},
  url = {https://openreview.net/forum?id=iMIC-7tfUgB},
}
Figure