NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Causal-structure Driven Augmentations for Text OOD Generalization

Amir Feder, Yoav Wald, Claudia Shi, Suchi Saria, David M. Blei

Introduction

Machine learning models, particularly those operating on natural language, often achieve high performance by exploiting spurious correlations—statistical patterns that exist in the training data but do not reflect the underlying causal mechanisms. In safety-critical domains like healthcare, these "shortcuts" can be disastrous. For instance, a model might learn to associate a specific clinician's writing style with a diagnosis rather than the patient's symptoms. When deployed in a new environment with different clinicians, the model's performance collapses. This failure of Out-of-Distribution (OOD) generalization is a primary hurdle for the reliable deployment of AI.

This paper introduces CATO (Causal-structure Driven Augmentations), a framework that leverages the generative capabilities of Large Language Models (LLMs) to create counterfactual training data. By rewriting text to break spurious links while preserving invariant features, CATO enables models to learn more robust, causally-grounded representations.

The Challenge of Spurious Correlations

The core of the OOD generalization problem lies in the presence of confounding variables. In a clinical setting, a caregiver's identity (a nuisance variable) might influence the style of a medical note. If certain caregivers are assigned to specific types of cases, the model may latch onto stylistic markers rather than clinical facts.

Standard mitigation strategies often involve re-weighting existing data points to balance the distribution. However, the authors demonstrate mathematically that counterfactual augmentation—creating new examples where the spurious feature is altered—offers superior sample complexity. In scenarios where spurious correlations are strong, re-weighting requires an impractical amount of data, whereas CATO can effectively "deconfound" the dataset with significantly fewer samples.

The CATO Framework

CATO utilizes LLMs as "style transfusers" to generate counterfactual versions of training examples. The goal is to answer the question: "What would this text look like if the spurious attribute were different?" The researchers propose two primary algorithms for this generation:

  1. Matching (Algorithm 1B): This method uses auxiliary data (such as vitals or medications) to identify "similar" patients treated by different caregivers. An LLM is then prompted to rewrite a specific note in the style of a caregiver who treated a comparable case, effectively isolating the clinical content from the stylistic signature.
  2. Difference-in-Differences (Algorithm 1A): Inspired by econometric methodologies, this approach uses "pre-treatment" data (e.g., notes written before a final diagnosis) to identify the specific stylistic "delta" of a caregiver. This delta is then applied to other notes to create synthetic variations.

LLMs are uniquely suited for this task because they can maintain the semantic integrity of medical facts while fluidly altering the form, tone, and conciseness of the prose.

Experimental Evaluation

The authors evaluated CATO across three distinct domains to test its robustness and versatility:

Clinical Narratives

Using the MIMIC-III dataset (comprising over 2 million notes), the team trained models to predict clinical conditions. They then tested these models on the i2b2-2006 and i2b2-2010 datasets, which represent entirely different hospital environments. CATO improved precision by over 7% absolute and significantly boosted recall compared to the baseline PubMedBERT model. It consistently outperformed established OOD algorithms such as Invariant Risk Minimization (IRM) and Maximum Mean Discrepancy (MMD).

Restaurant Reviews

To test the method on more general text, the researchers used the CeBAB dataset, introducing a spurious correlation between specific "food mentions" and overall ratings. CATO achieved 0.75 accuracy, while the observational baseline dropped to 0.64, proving that the model had successfully learned to ignore the spurious food features in favor of actual sentiment.

Synthetic Data

Controlled experiments using Gaussian environments revealed a surprising degree of robustness: even when the LLM-generated counterfactuals were "noisy" or imperfectly rewritten, the resulting classifiers still outperformed standard baselines. This suggests that even approximate causal augmentations provide a powerful regularization signal.

Limitations and Future Directions

While CATO represents a significant step forward, it is not without challenges:

  • Causal Priors: CATO requires prior knowledge of the problem's causal structure to identify which attributes are spurious.
  • LLM Bias: There is a risk that the LLM used for augmentation may introduce its own biases or hallucinations into the training set.
  • Computational Overhead: Generating counterfactuals for large-scale datasets is computationally more intensive than standard training.

Future research will focus on automated methods for discovering causal structures directly from data and refining LLM prompting to ensure absolute fidelity to core facts in sensitive domains.

Conclusion

CATO demonstrates that causal knowledge is a force multiplier for machine learning. By moving beyond simple pattern matching and using LLMs to simulate counterfactual realities, we can build models that are not only more accurate but more reliable when facing the unpredictability of the real world.

Summary updated

BibTeX
@inproceedings{feder2023causal,
  author = {Amir Feder and Yoav Wald and Claudia Shi and Suchi Saria and David M. Blei},
  title = {{Causal-structure Driven Augmentations for Text OOD Generalization}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
}
Figure