TL;DR
Invariant Risk Minimization (IRM) aims to learn representations robust to spurious shortcuts, but it typically requires environment labels that indicate when spurious correlations change. While prior work like EIIL infers these labels using a biased reference model, standard models trained via Empirical Risk Minimization (ERM) are rarely biased enough. This paper introduces Repeated Environment Inference for Invariant Learning (REIIL), an iterative method that repeatedly retrains an ERM model on the inferred "majority" environment to systematically amplify spurious features, producing sharper environment splits and significantly better out-of-distribution generalization.
What Problem Does This Paper Address?
Standard deep learning models often latch onto spurious correlations (e.g., classifying a cow based on green pastures) rather than true causal mechanisms (the shape of the animal). When deployed under domain shifts where those correlations break down, performance plummets.
Invariant learning frameworks—most notably Invariant Risk Minimization (IRM)—combat this by searching for representations whose relationship with the label remains stable across diverse training environments. However, these methods depend heavily on having explicit environment partitions, which are expensive, subjective, or impossible to obtain in real-world scenarios.
Environment Inference for Invariant Learning (EIIL) was proposed to infer these labels automatically by maximizing the IRM penalty using a reference model. In theory, EIIL requires a reference model that relies exclusively on spurious features. In practice, practitioners simply use an ERM model trained on the entire training set. Because standard ERM captures a mixture of both causal and spurious patterns, the inferred environment splits are often sub-optimal, leading downstream invariant learning algorithms to underperform or fail.
Methods
The authors propose REIIL (Repeated Environment Inference for Invariant Learning). The core observation is that training samples where the spurious correlation holds strongly tend to cluster into a single "majority" environment during inference:
- Initial Step: Train a standard ERM reference model on the full training set and perform the standard EIIL environment inference step to partition data into two environments.
- Iterative Refinement: Rather than immediately training the downstream invariant classifier, identify the inferred majority environment. Retrain an ERM model solely on this majority subset. Because this subset is more heavily saturated with spurious correlations, the resulting model becomes even more biased.
- Repeat: Re-run environment inference using this newly biased reference model, re-identify the majority environment, and retrain. The authors run this loop for $n = 9$ iterations, observing performance saturation.
- Downstream Training: Use the final inferred binary partition to train an invariant model (such as IRMv1 or a Weighted ERM baseline).
Full Data ──(Train ERM)──► Reference Model ──(EI Step)──► Partition
▲ │
│ ▼
└────── Retrain on Majority ────┘
Datasets
The authors evaluate REIIL on synthetic and image benchmarks:
- Colored MNIST (CMNIST): Standard synthetic binary classification benchmark where digit colors act as spurious anti-causal correlations.
- CIFAR-Background MNIST (CBMNIST) [Newly Introduced]: MNIST digits pasted onto CIFAR image backgrounds (10 classes), where CIFAR backgrounds act as unstable, anti-causal cues:
- CBMNIST [I]: ~97% correlation between digit and background; ~1% and ~2% shuffled backgrounds across the two latent environments (shuffled among 8 other backgrounds).
- CBMNIST [II]: Similar to [I], but shuffled images switch to exactly one predetermined alternate background.
- CBMNIST [III]: Less extreme spurious correlation, with shuffled background rates set to 10% and 20%.
- Synthetic Regression Benchmarks: Linear synthetic environments from Arjovsky et al. and Creager et al. with distinct noise levels across environments.
Key Insights and Ideas
- Reinforcing the Shortcut: If the data satisfies the condition that spurious features have higher mutual information with the label than causal features ($I(Y; Z) > I(Y; X)$), the inferred majority environment filters out causally informative (counter-spurious) examples. Retraining ERM on this majority environment produces an increasingly "flawed" model that relies almost purely on spurious cues—precisely what the EI objective requires to split the environments cleanly.
- Minority Environment as the Causal Reservoir: As iterations progress, the proportion of "shuffled" (causally informative) samples assigned to the minority environment increases monotonically, while the reference model's accuracy on that minority environment steadily drops toward random chance (Figure 5 in the paper).
- Weighted ERM as a Simpler Alternative: The authors discovered that training a Weighted ERM (WERM) model—which simply balances sample weights across the inferred environments rather than optimizing the complex IRM gradient penalty—matched the performance of IRM while remaining easier to optimize.
Key Results
- CBMNIST [I] & [II]: Native IRM failed to beat ERM due to the scarcity of shuffled samples. While EIIL improved accuracy over IRM, REIIL achieved the highest test accuracy, substantially widening the gap over both ERM and standard EIIL.
- CMNIST: Standard ERM already serves as a strong spurious model on CMNIST, meaning REIIL yielded modest accuracy improvements over EIIL, but exhibited significantly lower variance across runs.
- Synthetic Experiments: Across multiple noise setups (FOU, FOS, FEU, FES, etc.), REIIL consistently found models with lower validation and test errors than EIIL (e.g., on FEU test: REIIL achieved 14.72 error vs. EIIL's 26.06).
Limitations and Future Work
- Failure Under Weaker Spurious Shift: In CBMNIST [III] (where 10–20% of samples are shuffled), ERM outperformed all invariant methods. When the spurious correlation is not overwhelming, initial ERM models learn invariant causal features early on, breaking the foundational assumption of REIIL and degrading inference quality.
- Binary Environment Assumption: The method restricts environment inference to a binary split ($e_1, e_2$). Scaling this iterative procedure to handle multi-environment partitions with heterogeneous spurious shortcuts remains unexplored.
- Validation Metric Disconnect: In noisy synthetic setups, lower validation error did not always correspond to finding the true causal coefficients, emphasizing ongoing challenges with model selection under out-of-distribution shifts.
Summary updated