TL;DR
Out-of-distribution (OOD) generalization algorithms usually require expensive human annotations to tell the model which features are spurious (e.g., background color) and which are invariant. This paper introduces Cross-Risk Minimization (XRM), a method that automatically discovers these environments by training twin networks to intentionally imitate each other's mistakes. XRM eliminates the need for human-annotated validation sets and achieves "oracle-level" performance on standard benchmarks.
What Problem Does This Paper Address?
Machine learning models are notoriously lazy; they often rely on "spurious correlations" to make predictions. For example, in the Waterbirds dataset, waterbirds are usually pictured on water, and landbirds on land. A standard model will learn to classify the background rather than the bird, failing catastrophically when presented with a landbird on water.
To fix this, researchers use OOD generalization algorithms (like GroupDRO) that force the model to perform well across different "environments" or groups. However, these algorithms require human-annotated group labels, which are expensive to obtain and often limited by human bias.
Recent attempts to automatically discover these environments suffer from a frustrating Catch-22: they require incredibly precise hyperparameter tuning and early stopping to work. To tune those parameters, you need a validation set that already has human annotations—defeating the entire purpose of automatic discovery. XRM solves this by providing a fully unsupervised way to discover environments without needing early stopping or annotated validation data.
Methods
XRM operates in two phases: first, it discovers the environments, and second, it passes those environments to a standard OOD algorithm (like GroupDRO) to train the final robust model. The core innovation lies in the discovery phase:
- The Twin Setup: XRM splits the training data randomly in half. It initializes two "twin" neural networks ($f^a$ and $f^b$). Twin A trains on Half A; Twin B trains on Half B.
- The "Echo Chamber" (Label Flipping): During training, XRM checks how Twin A performs on Half B (its held-out data). If Twin A confidently misclassifies an image, XRM actually flips the true label of that image to match Twin A's mistake. Twin B is then forced to learn this wrong label. This creates an echo chamber that forces both networks to double down on "simplicity bias"—learning only the easiest, most spurious shortcuts.
- Model Selection: Because the networks are forced into a stable echo chamber, XRM doesn't need delicate early stopping. To pick the best hyperparameters, you simply choose the setup that results in the highest percentage of flipped labels at the end of training.
- The Cross-Mistake Formula: Once trained, XRM groups the data. If an example was misclassified by the twin that held it out, it goes into one environment (the "cross-mistake" group). If it was classified correctly, it goes into the other.
Key Insights and Ideas
- Embrace the bias to defeat it: Previous methods try to carefully stop a model before it memorizes the minority groups, which is highly unstable. XRM takes the opposite approach: it actively sabotages the twins by flipping labels, forcing them to rely entirely on spurious correlations. This makes isolating the spurious features much cleaner.
- Mistakes as a signal: A confident mistake on held-out data is a massive red flag that a model is relying on a spurious shortcut. By tracking these cross-mistakes, XRM can perfectly isolate minority groups (e.g., landbirds on water).
- Solving the Catch-22: Using the "total number of flipped labels at convergence" as a hyperparameter selection metric is a brilliant workaround. It completely removes the need for a human-annotated validation set, making XRM truly unsupervised.
Key Results
- Oracle-Level Performance: On the Waterbirds dataset, a standard ERM model achieves 61% worst-group accuracy. GroupDRO with perfect human annotations (the "oracle") achieves 87%. XRM + GroupDRO also achieves 87%, perfectly matching the oracle without seeing a single human annotation.
- Consistent Gains: Across the standard quartet of datasets (Waterbirds, CelebA, MultiNLI, CivilComments), standard training yields a 67.3% average worst-group accuracy. XRM boosts this to 80.4%, practically identical to the 80.6% achieved using human annotations.
- Efficiency: XRM is computationally lightweight. While competing automatic discovery methods (like "Learning to Split") took ~20 hours to run on Waterbirds, XRM took just 10 minutes on the same hardware.
Limitations and Future Work
XRM assumes that the spurious feature is "simpler" or faster to learn than the true invariant feature (which is usually true in practice). However, if the invariant feature is actually the simpler one, XRM will group the data backward. The authors demonstrate this failure mode using an "Inverse ColorMNIST" dataset.
Future work will explore the theoretical underpinnings of XRM—specifically, how label flipping mathematically relates to the principle of causal invariance—and investigate how XRM interacts with different types of neural network memorization.
Summary updated