Discovering environments with XRM

Mohammad Pezeshki, Diane Bouchacourt, Mark Ibrahim, Nicolas Ballas, Pascal Vincent +1 more
2/12/2026

Official code: facebookresearch/XRM (18 stars, last commit 2024-12-06).

Abstract

Environment annotations are essential for the success of many out-of-distribution (OOD) generalization methods. Unfortunately, these are costly to obtain and often limited by human annotators' biases. To achieve robust generalization, it is essential to develop algorithms for automatic environment discovery within datasets. Current proposals, which divide examples based on their training error, suffer from one fundamental problem. These methods introduce hyper-parameters and early-stopping criteria, which require a validation set with human-annotated environments, the very information subject to discovery. In this paper, we propose Cross-Risk-Minimization (XRM) to address this issue. XRM trains twin networks, each learning from one random half of the training data, while imitating confident held-out mistakes made by its sibling. XRM provides a recipe for hyper-parameter tuning, does not require early-stopping, and can discover environments for all training and validation data. Algorithms built on top of XRM environments achieve oracle worst-group-accuracy, addressing a long-standing challenge in OOD generalization. Code available at \url{https://github.com/facebookresearch/XRM}.

View on arXivView PDF

Code Implementations(1)

Discovering environments with XRM

181PythonJan 26, 20241 years agoNOASSERTION

Similar Papers

Cite this paper

@article{pezeshki2026discovering,
  title  = {Discovering environments with XRM},
  author = {Mohammad Pezeshki and Diane Bouchacourt and Mark Ibrahim and Nicolas Ballas and Pascal Vincent and David Lopez-Paz},
  year   = {2026},
  eprint = {2309.16748},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/pdf/2309.16748},
  journal = {ICML 2023 2023}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2309.16748.svg)](https://codeofpaper.com/paper/2309.16748)

Discussion