Identifying spurious correlations for robust text classification

Zhao Wang, Aron CulottaEMNLP 2020

Abstract

Machine learning models often rely on spurious correlations—statistical patterns that do not reflect causal relationships—leading to failures under dataset shift and biased outcomes. We present a method to identify and filter these features by training a secondary word classifier on causal inference-based features. Our approach significantly improves robustness, particularly on minority data subsets where standard shortcuts fail, while maintaining cross-domain generalizability.

Introduction: The Shortcut Problem

Machine learning models are notorious for taking "shortcuts." In text classification, a model might learn that the word "Spielberg" is a strong indicator of a positive movie review. While this might be true on average in a specific dataset, "Spielberg" doesn't cause a review to be positive—a movie directed by him could still be terrible.

These spurious correlations pose significant risks:

  1. Dataset Shift: If the correlation breaks (e.g., a director releases a flop), the model fails.
  2. Algorithmic Fairness: Toxicity classifiers may associate specific demographic terms with "toxic" labels due to biased training data.
  3. Interpretability: Users lose trust in models that cite irrelevant features as primary decision factors.

Standard frequency-based methods often fail to distinguish these words because they frequently possess high statistical power.

Methodology: Causal Word Classification

The authors propose a supervised pipeline to classify individual words as either spurious or genuine. The process involves five key stages:

  1. Initial Training: A baseline classifier (e.g., Logistic Regression) identifies high-impact words.
  2. Counterfactual Matching: For a target word $w$, the system identifies "matched" sentence pairs that are semantically similar (via BERT embeddings) but differ only by the presence of $w$.
  3. Feature Extraction: Causal metrics, specifically the Average Treatment Effect (ATE), are calculated. This measures how much the label typically changes when a word is swapped within the same context.
  4. Word Classification: A secondary "word classifier" is trained on a small manually labeled set (200–300 words). Features include ATE, match quality, and context similarity variance.
  5. Robust Feature Selection: Spurious words are filtered out before retraining the final document classifier.
Classification of words into spurious and genuine categories based on logistic regression coefficients and counterfactual similarity.

Experimental Evaluation

The method was evaluated on sentiment analysis (IMDB, Amazon Kindle) and toxicity detection (Wikipedia, Twitter). To measure robustness, the authors focused on minority groups—subsets where spurious correlations contradict the ground truth (e.g., a negative review mentioning a "positive" spurious word like "Spielberg").

Key Results

  • Robustness Gains: In minority group tests, removing spurious features improved accuracy by 20% to 30% across different datasets.
  • Domain Generalization: A word classifier trained on IMDB successfully identified spurious words in Kindle reviews (0.74 AUC), suggesting that the "nature" of spuriousness is somewhat universal across domains.
  • Accuracy Trade-off: While removing spurious features may slightly lower accuracy on standard test sets where shortcuts still "work," it dramatically improves worst-case accuracy and model reliability.
Robustness evaluation across IMDB and Kindle datasets, comparing different feature selection strategies on majority and minority groups.

Discussion and Limitations

A key insight is the use of causal inference as a feature rather than a strict mathematical constraint. This makes the approach practical for real-world NLP tasks. However, the method's success depends on the availability of high-quality counterfactual matches. In small or homogeneous datasets, ATE estimates may become noisy. Furthermore, while the manual labeling requirement is minimal (300 words), future work could explore unsupervised bootstrapping to define "genuineness" for new tasks.

Conclusion

By distinguishing between causal and coincidental patterns, this research provides a path toward more trustworthy and robust text classification. The ability to transfer "spuriousness knowledge" across domains highlights the potential for building general-purpose filters for misleading linguistic features.

Summary updated

BibTeX
@inproceedings{wang2020identifying,
  author = {Zhao Wang and Aron Culotta},
  title = {{Identifying spurious correlations for robust text classification}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2020},
  doi = {10.18653/v1/2020.findings-emnlp.308},
}
Figure