Standard machine learning models are notorious for taking shortcuts. If a model learns that "waterbirds" usually appear against blue water backgrounds, it might simply look for the color blue rather than the features of the bird itself. When that model is later tested on a "waterbird on land," it fails spectacularly.
To fix this, researchers use Invariant Learning, which forces models to ignore these "spurious correlations." However, there is a catch: these methods usually require "environment labels"—manual tags telling the model which data comes from which context (e.g., "this is a photo from the desert," "this is from the forest"). In the real world, these labels are rarely available.
In this paper, Creager et al. introduce EIIL (Environment Inference for Invariant Learning), a framework that automatically discovers these environments, allowing us to train robust models even when we don't know the underlying data partitions.
TL;DR
EIIL removes the need for manual "environment" labels in invariant learning by automatically partitioning data into groups that highlight spurious correlations. By inferring these environments from the biases of a simple reference model, EIIL enables robust generalization that often matches or exceeds methods using human-provided labels.
What Problem Does This Paper Address?
The core challenge is distribution shift. A model trained on one distribution (e.g., hospital A) often fails on another (hospital B) because it relies on features that are predictive in the training set but aren't "causal" or "invariant" (like the specific model of an X-ray machine).
Methods like Invariant Risk Minimization (IRM) solve this by looking for features that work consistently across different "environments." But defining these environments is hard. Should they be based on geography? Time? Lighting? If you choose the wrong partitions, the invariant learner won't find the right features. EIIL addresses the "missing label" problem by treating environment discovery as an optimization task.
Methods
EIIL is a two-stage framework:
- Environment Inference (EI): First, you train a "reference model" using standard Empirical Risk Minimization (ERM). This model is expected to be biased. EIIL then searches for a way to split the training data into two (or more) environments that maximally violate the invariance principle for that reference model. Essentially, it groups data points such that the reference model's behavior looks as inconsistent as possible across the groups.
- Invariant Learning (IL): Once these "worst-case" environments are identified, they are fed into an off-the-shelf invariant learner (like IRM or GroupDRO) to train a final, robust model from scratch.
The core insight here is that the bias of a simple model is actually a useful signal. By finding where a biased model succeeds and fails, we can identify the spurious features we want our final model to ignore.
Datasets
The authors evaluate EIIL on several benchmarks known for spurious correlations:
- CMNIST (Colored MNIST): A synthetic digit task where color is highly predictive of the label during training but misleading at test time.
- Waterbirds: A dataset of landbirds and waterbirds superimposed on land or water backgrounds.
- Adult-Confounded: A version of the UCI Adult census dataset modified to have a pernicious bias between subgroups and labels.
- CivilComments-WILDS: A large-scale text dataset for toxicity detection where models often develop biases against specific identity groups.
Key Insights and Ideas
- The "Starkness" of Environments: Surprisingly, EIIL can outperform IRM even when IRM has access to human-provided environment labels. This is because human labels might not be the most "informative" for the algorithm. EIIL finds the "starkest" possible split that forces the model to abandon spurious shortcuts.
- Connection to Fairness: The paper links domain generalization to algorithmic fairness. In fairness, we want "group sufficiency" (the model should be equally calibrated for all groups). EIIL uses this same logic to ensure the model doesn't rely on "sensitive" or spurious attributes.
- Heuristic Binning: For large datasets, the authors propose a "binning" heuristic: group data by the reference model's confidence and the true label. This simple trick effectively identifies the "easy" (spurious-aligned) and "hard" (spurious-misaligned) examples.
Key Results
- CMNIST: EIIL achieved 68.4% test accuracy, significantly beating standard ERM (~14%) and even outperforming IRM with manual labels (~65%).
- Waterbirds: EIIL improved "worst-group" accuracy (the hardest cases, like waterbirds on land) by 18% compared to standard training, reaching 78.7%.
- Adult-Confounded: EIIL achieved 78.8% accuracy on the "audit" test set, whereas ERM collapsed to 31.1% and a competing fairness method (ARL) reached only 61.3%.
Limitations and Future Work
- Reference Model Dependency: EIIL's success depends on the reference model actually capturing the spurious correlation. If the reference model is "too good" (or too bad), the inferred environments might not be useful.
- Computational Overhead: The two-stage process requires training multiple models and optimizing the environment assignments, which is more computationally expensive than standard ERM.
- Future Directions: The authors suggest "amortizing" the environment inference (making it faster) and exploring how to automatically determine the number of environments needed, rather than assuming a binary split.
Summary updated