Discovering environments with XRM

Mohammad Pezeshki, Diane Bouchacourt, Mark Ibrahim, Nicolas Ballas, Pascal Vincent, David Lopez-Paz

TL;DR

This paper introduces Cross-Risk Minimization (XRM), a novel method for automatically discovering "environments" (subsets of data with shared spurious correlations) within a dataset, eliminating the need for costly human annotations. XRM achieves state-of-the-art out-of-distribution generalization performance by training twin networks that learn to imitate each other's confident mistakes, effectively isolating spurious features.

What Problem Does This Paper Address?

Modern AI systems often fail when deployed in real-world scenarios that differ from their training data. This phenomenon, known as out-of-distribution (OOD) generalization, is a major challenge. A common approach to tackle this is to identify and leverage "environments" within the data – subsets that share invariant features but may differ in spurious correlations. However, obtaining these environment annotations typically requires significant human effort and is prone to annotator bias. Existing methods for automatically discovering these environments often rely on complex hyperparameter tuning and early stopping criteria that themselves require human-annotated validation sets, defeating the purpose of automatic discovery.

Methods

XRM tackles this problem with a clever "twin network" approach. Here's the breakdown:

  • Twin Setup: XRM initializes two identical neural networks (twins).
  • Data Splitting: The training data is randomly split into two halves, with each twin "holding in" one half and "holding out" the other.
  • Imitating Mistakes (Echo Chamber): During training, each twin is encouraged to imitate the confident mistakes of its sibling. This is achieved by flipping the target labels to match the sibling's confident predictions. This "echo chamber" effect forces the twins to focus on spurious correlations, as these are often easier to learn and lead to confident mistakes.
  • Environment Discovery: After training, a simple "cross-mistake" formula uses the predictions of both twins to assign each data point to one of two discovered environments. This process works for both training and validation data.
  • Hyperparameter Tuning: XRM provides a built-in method for hyperparameter tuning by selecting the combination that maximizes the number of label flips, which correlates with good OOD performance.

Datasets

The paper evaluates XRM on several standard OOD generalization benchmarks:

  • Sub-population Shift Benchmarks: Waterbirds, CelebA, MultiNLI, Civil Comments, ColorMNIST, MetaShift, and ImageNetBG.
  • Domain Generalization Benchmark: DOMAINBED (including VLCS, PACS, OfficeHome, TerraIncognita, and DomainNet).
  • Additional Experiments: Dominoes (MF and MC versions), which are designed to have a strong spurious correlation.

Key Insights and Ideas

  • The "Echo Chamber" for Spuriousness: The core idea of XRM is to intentionally train networks to exploit spurious correlations by having them imitate each other's mistakes. This counter-intuitive approach is key to isolating these spurious features.
  • Label Flipping as a Signal: The probability of flipping a label is directly tied to a twin's confident misclassification on held-out data. This "label flipping" acts as a crucial signal for identifying spurious correlations and is used for hyperparameter selection.
  • No Human Annotations Needed: XRM's primary contribution is eliminating the need for human-annotated environments, a significant bottleneck in OOD generalization research.
  • Oracle Performance: XRM, when combined with OOD algorithms like GroupDRO, achieves performance comparable to using ground-truth human annotations, demonstrating its effectiveness.

Key Results

  • Waterbirds Benchmark: XRM + GroupDRO achieved 87% worst-group-accuracy, matching the oracle performance, while prior methods with early stopping only reached 79%.
  • ColorMNIST: XRM identified environments that led to better generalization than human-proposed ones.
  • DOMAINBED: XRM-inferred environments for CORAL achieved performance comparable to human-annotated environments across multiple datasets.
  • Efficiency: XRM's runtime is comparable to a standard ERM baseline, making it computationally feasible.

Limitations and Future Work

  • Two Environments Only: XRM inherently splits data into two environments per label. While this proved effective in experiments, the paper ponders whether this is always sufficient when more than two true underlying environments exist.
  • Causal Assumptions: Like other OOD methods, XRM relies on certain assumptions about the data's underlying causal structure. When these assumptions are violated, XRM may fail to discover relevant environments.
  • Future Work: The authors suggest exploring the theoretical underpinnings of XRM, particularly its relationship with model calibration and the phenomenon of memorization. They also aim to understand how XRM discovers environments that benefit all examples.

Summary updated

BibTeX
@inproceedings{pezeshki2024discovering,
  author = {Mohammad Pezeshki and Diane Bouchacourt and Mark Ibrahim and Nicolas Ballas and Pascal Vincent and David Lopez-Paz},
  title = {{Discovering environments with XRM}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=gPStP3FSY9},
}
Figure