mlsanityData to 7 Oct 2026

Counterfactual Invariance to Spurious Correlations: Why and How to Pass Stress Tests

arXiv 2106.00545 ↗First posted 31 May 2021cs.LG cs.AI stat.MLcited by 77

Not on the map. Why?

Abstract (arXiv)

Informally, a 'spurious correlation' is the dependence of a model on some aspect of the input data that an analyst thinks shouldn't matter. In machine learning, these have a know-it-when-you-see-it character; e.g., changing the gender of a sentence's subject changes a sentiment predictor's output. To check for spurious correlations, we can 'stress test' models by perturbing irrelevant parts of input data and seeing if model predictions change. In this paper, we study stress testing using the tools of causal inference. We introduce counterfactual invariance as a formalization of the requirement that changing irrelevant parts of the input shouldn't change model predictions. We connect counterfactual invariance to out-of-domain model performance, and provide practical schemes for learning (approximately) counterfactual invariant predictors (without access to counterfactual examples). It turns out that both the means and implications of counterfactual invariance depend fundamentally on the true underlying causal structure of the data -- in particular, whether the label causes the features or the features cause the label. Distinct causal structures require distinct regularization schemes to induce counterfactual invariance. Similarly, counterfactual invariance implies different domain shift guarantees depending on the underlying causal structure. This theory is supported by empirical results on text classification.

Key facts. Cited by 77 papers in the map (data through 7 Oct 2026). Builds on 28 of its 42 references that are in the map. First posted on arXiv 31 May 2021.

Builds on

28 of 42 references.

References · 28

  1. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
  2. 2015Domain-Adversarial Training of Neural Networkscited by 3,023
  3. 2017A Broad-Coverage Challenge Corpus for Sentence Understanding through Inferencecited by 2,665
  4. 2019A Survey on Bias and Fairness in Machine Learningcited by 1,911
  5. 2019Invariant Risk Minimizationcited by 1,832
  6. 2019Distributionally Robust Neural Networks for Group Shifts: On the Importance of Regularization for Worst-Case Generalizationcited by 1,232
  7. 2020Beyond Accuracy: Behavioral Testing of NLP models with CheckListcited by 979
  8. 2017Counterfactual Fairnesscited by 802
  9. 2019EDA: Easy Data Augmentation Techniques for Boosting Performance on Text Classification Taskscited by 800
  10. 2018Annotation Artifacts in Natural Language Inference Datacited by 656
  11. 2013Domain Generalization via Invariant Feature Representationcited by 622
  12. 2014Deep Domain Confusion: Maximizing for Domain Invariancecited by 597
16 more
  1. 2015Causal inference using invariant prediction: identification and confidence intervalscited by 533
  2. 2019Learning the Difference that Makes a Difference with Counterfactually-Augmented Datacited by 428
  3. 2020Weakly-Supervised Disentanglement Without Compromisescited by 237
  4. 2021Polyjuice: Generating Counterfactuals for Explaining, Evaluating, and Improving Modelscited by 219
  5. 2018Stress Test Evaluation for Natural Language Inferencecited by 211
  6. 2020Representation Learning via Invariant Causal Mechanismscited by 197
  7. 2020Data Augmentation using Pre-trained Transformer Modelscited by 168
  8. 2017Mind the Class Weight Bias: Weighted Maximum Mean Discrepancy for Unsupervised Domain Adaptationcited by 151
  9. 2018Counterfactual Fairness in Text Classification through Robustnesscited by 150
  10. 2021Model-Based Domain Generalizationcited by 103
  11. 2020Learning What Makes a Difference from Counterfactual Examples and Gradient Supervisioncited by 66
  12. 2020Explaining The Efficacy of Counterfactually Augmented Datacited by 64
  13. 2018Counterfactuals uncover the modular structure of deep generative modelscited by 51
  14. 2020Counterfactually-Augmented SNLI Training Data Does Not Yield Better Generalization Than Unaugmented Datacited by 27
  15. 2018Adversarial Alignment of Class Prediction Uncertainties for Domain Adaptationcited by 8
  16. 2018Counterfactual Normalization: Proactively Addressing Dataset Shift and Improving Reliability Using Causal Mechanismscited by 7

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2021: 6; 2022: 25; 2023: 14; 2024: 10; 2025: 9; 2026: 13.

77 papers.

Sort:

By area:

  1. 2022Last Layer Re-Training is Sufficient for Robustness to Spurious Correlationscited by 379
  2. 2021Causal Inference in Natural Language Processing: Estimation, Prediction, Interpretation and Beyondcited by 177
  3. 2022On Feature Learning in the Presence of Spurious Correlationscited by 145
  4. 2021Measure and Improve Robustness in NLP Models: A Surveycited by 107
  5. 2021Desiderata for Representation Learning: A Causal Perspectivecited by 76
  6. 2022Measuring Causal Effects of Data Statistics on Language Model's `Factual' Predictionscited by 57
  7. 2022A Comprehensive Study of Image Classification Model Sensitivity to Foregrounds, Backgrounds, and Visual Attributescited by 56
  8. 2022Causal Discovery in Heterogeneous Environments Under the Sparse Mechanism Shift Hypothesiscited by 54
  9. 2022Diagnosing failures of fairness transfer across distribution shift in real-world medical settingscited by 45
  10. 2022Predictive Multiplicity in Probabilistic Classificationcited by 44
  11. 2021An Investigation of the (In)effectiveness of Counterfactually Augmented Datacited by 42
  12. 2021Out-of-distribution Generalization in the Presence of Nuisance-Induced Spurious Correlationscited by 41
38 more
  1. 2022OOD Link Prediction Generalization Capabilities of Message-Passing GNNs in Larger Test Graphscited by 38
  2. 2022Invariant and Transportable Representations for Anti-Causal Domain Shiftscited by 37
  3. 2022DoCoGen: Domain Counterfactual Generation for Low Resource Domain Adaptationcited by 36
  4. 2024CLIP the Bias: How Useful is Balancing Data in Multimodal Learning?cited by 35
  5. 2024How Likely Do LLMs with CoT Mimic Human Reasoning?cited by 34
  6. 2023Leveraging sparse and shared feature activations for disentangled representation learningcited by 32
  7. 2023Don't blame Dataset Shift! Shortcut Learning due to Gradients and Cross Entropycited by 30
  8. 2022FaiRR: Faithful and Robust Deductive Reasoning over Natural Languagecited by 29
  9. 2022Exploring The Landscape of Distributional Robustness for Question Answering Modelscited by 23
  10. 2023Spuriosity Didn't Kill the Classifier: Using Invariant Predictions to Harness Spurious Featurescited by 21
  11. 2022Nuisances via Negativa: Adjusting for Spurious Correlations via Data Augmentationcited by 18
  12. 2022Causal Intervention Improves Implicit Sentiment Analysiscited by 16
  13. 2024Predictive Churn with the Set of Good Modelscited by 15
  14. 2022Domain Generalization -- A Causal Perspectivecited by 14
  15. 2022DC-Check: A Data-Centric AI checklist to guide the development of reliable machine learning systemscited by 14
  16. 2022MMD-B-Fair: Learning Fair Representations with Statistical Testingcited by 13
  17. 2023Learning for Counterfactual Fairness from Observational Datacited by 13
  18. 2023Beyond Distribution Shift: Spurious Features Through the Lens of Training Dynamicscited by 11
  19. 2022Evaluating Robustness to Dataset Shift via Parametric Robustness Setscited by 10
  20. 2022Fairness and robustness in anti-causal predictioncited by 10
  21. 2022A Reduction to Binary Approach for Debiasing Multiclass Datasetscited by 9
  22. 2023Invariant Anomaly Detection under Distribution Shifts: A Causal Perspectivecited by 8
  23. 2024Clarify: Improving Model Robustness With Natural Language Correctionscited by 8
  24. 2022Breaking Correlation Shift via Conditional Invariant Regularizercited by 7
  25. 2022FAST: Improving Controllability for Text Generation with Feedback Aware Self-Trainingcited by 7
  26. 2024A Comprehensive Guide to Explainable AI: From Classical Models to LLMscited by 7
  27. 2023Are demographically invariant models and representations in medical imaging fair?cited by 6
  28. 2022The Causal Structure of Domain Invariant Supervised Representation Learningcited by 5
  29. 2023Prominent Roles of Conditionally Invariant Components in Domain Adaptation: Theory and Algorithmscited by 5
  30. 2024How often are errors in natural language reasoning due to paraphrastic variability?cited by 5
  31. 2021Learning Invariant Representations with Missing Datacited by 4
  32. 2023Results on Counterfactual Invariancecited by 4
  33. 2023Prediction without Preclusion: Recourse Verification with Reachable Setscited by 4
  34. 2024Causally Inspired Regularization Enables Domain General Representationscited by 4
  35. 2023Consistent Text Categorization using Data Augmentation in e-Commercecited by 3
  36. 2024Domain Generalization via Causal Adjustment for Cross-Domain Sentiment Analysiscited by 3
  37. 2025Measure-Theoretic Anti-Causal Representation Learningcited by 3
  38. 2022RealPatch: A Statistical Matching Framework for Model Patching with Real Samplescited by 2

50 most cited of 77 All 77 (JSON)