Fighting Spurious Correlations in Text Classification via a Causal Learning Perspective

Yuqing Zhou, Ziwei ZhuNAACL 2025

Abstract

Modern NLP models often rely on spurious correlations—non-causal features associated with labels in training data—leading to performance degradation on out-of-distribution data. We present the Causally Calibrated Robust Classifier (CCR), a framework that integrates feature disentanglement, counterfactual reasoning, and an unbiased loss function. CCR achieves state-of-the-art robustness across multiple benchmarks without requiring expensive manual group labels.

Introduction

Deep learning models frequently exploit "shortcuts" in text classification. For instance, a sentiment classifier might associate a specific font or author style with a label rather than the semantic content. While existing robust learning methods mitigate this, they typically depend on "group labels" (annotations identifying spurious features), which are often unavailable in large-scale settings. CCR addresses this by inferring causal features through a two-stage training process.

Methodology

CCR employs a two-stage approach to isolate causal signals:

  1. Feature Disentanglement: Using covariance matrix regularization during initial training, the model ensures that learned internal representations are independent, facilitating the separation of causal and spurious features.
  2. Causal Feature Selection (CFS): Drawing from Judea Pearl’s causal inference theory, CCR maximizes the Probability of Necessity and Sufficiency (PNS) via counterfactual reasoning. It evaluates how predictions change when specific features are removed.
  3. Unbiased IPW Loss: To counteract the dominance of majority groups (samples where spurious features align with labels), CCR utilizes Inverse Propensity Weighting (IPW) to rebalance sample importance mathematically.

Experimental Evaluation

The framework was evaluated on four benchmarks covering various spurious correlations:

  • CivilComments: Toxicity detection with demographic biases.
  • MultiNLI: Natural language inference with negation word shortcuts.
  • Yelp-Author-Style: Sentiment tied to specific authorial styles.
  • Beer-Concept-Occurrence: Beer ratings correlated with specific attribute mentions.

Key Results and Discussion

CCR demonstrates superior performance in Worst-Group Accuracy (WGA) compared to existing methods that do not use group labels. Notably, on the CivilComments dataset, CCR outperformed Group-DRO and DFR—prominent methods that require manual group annotations.

Table 1: Main performance comparison across four datasets. CCR consistently achieves the highest Worst-Group Accuracy (WGA) among methods without group labels.

Ablation studies confirm that feature disentanglement is critical; without it, causal selection is less effective at filtering noise. Furthermore, explainability analysis using SHAP reveals that CCR significantly reduces reliance on spurious tokens compared to standard Empirical Risk Minimization (ERM).

Table 2: SHAP values indicating reliance on spurious tokens. CCR shows an order of magnitude lower reliance compared to ERM and other robust methods.

Conclusion and Future Work

CCR provides a robust, label-efficient solution for text classification by acting as a "causal filter" for the final classification layer. Future research will explore more advanced disentanglement techniques and refine propensity estimation, as the current unbiased loss depends on the quality of the initial stage-one model's estimates.

Summary updated

BibTeX
@inproceedings{zhou2025fighting,
  author = {Yuqing Zhou and Ziwei Zhu},
  title = {{Fighting Spurious Correlations in Text Classification via a Causal Learning Perspective}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2025},
  doi = {10.18653/v1/2025.naacl-long.215},
}
Figure