NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

WILDS: A Benchmark of in-the-Wild Distribution Shifts

Pang Wei Koh, Shiori Sagawa, Henrik Marklund, Sang Michael Xie, Marvin Zhang, Akshay Balsubramani, Weihua Hu, Michihiro Yasunaga, Richard Lanas Phillips, Sara Beery, Jure Leskovec, Anshul Kundaje, Emma Pierson, Sergey Levine, Chelsea Finn, Percy Liang

Abstract

Distribution shifts -- where the training distribution differs from the test distribution -- can substantially degrade the accuracy of machine learning (ML) systems deployed in the wild. Despite their ubiquity in the real-world deployments, these distribution shifts are under-represented in the datasets widely used in the ML community today. To address this gap, we present WILDS, a curated benchmark of 10 datasets reflecting a diverse range of distribution shifts that naturally arise in real-world applications, such as shifts across hospitals for tumor identification; across camera traps for wildlife monitoring; and across time and location in satellite imaging and poverty mapping. On each dataset, we show that standard training yields substantially lower out-of-distribution than in-distribution performance. This gap remains even with models trained by existing methods for tackling distribution shifts, underscoring the need for new methods for training models that are more robust to the types of distribution shifts that arise in practice. To facilitate method development, we provide an open-source package that automates dataset loading, contains default model architectures and hyperparameters, and standardizes evaluations. Code and leaderboards are available at https://wilds.stanford.edu.

Introduction: The Challenge of Distribution Shift

Most machine learning models are developed under the assumption that training and test data are independent and identically distributed (i.i.d.). However, real-world deployments frequently violate this assumption. Models often encounter distribution shifts, where the data seen in production differs from the training set. For instance, a medical imaging model trained on data from one hospital may fail when applied to images from another facility using different hardware or protocols.

While synthetic benchmarks (e.g., adding digital noise) have been used to study this, they often fail to capture the "messy" and complex shifts encountered in practice. The WILDS benchmark addresses this by providing a standardized platform to evaluate models against two primary types of shifts:

  1. Domain Generalization: The ability to generalize to entirely new domains not seen during training (e.g., new chemical scaffolds).
  2. Subpopulation Shift: Maintaining high performance across all subgroups within a dataset, particularly underrepresented ones (e.g., ensuring fairness across geographical regions).
Illustration of Domain Generalization and Subpopulation Shift within the WILDS benchmark.

The WILDS Benchmark

WILDS comprises 10 diverse datasets spanning multiple modalities and real-world applications:

  • Medical: Camelyon17 (tumor identification across hospitals) and RxRx1 (genetic perturbations across experimental batches).
  • Ecology: iWildCam2020 (animal species classification across camera traps) and GlobalWheat (wheat head detection across different countries).
  • Social/Text: CivilComments (toxicity classification across demographics) and Amazon (sentiment analysis across different users).
  • Satellite/Remote Sensing: FMoW (land use classification across time/regions) and PovertyMap (poverty estimation across countries).
  • Software: Py150 (code completion across different GitHub repositories).
  • Science: OGB-MolPCBA (molecular property prediction across different chemical scaffolds).

Methodology and Evaluation

To facilitate rigorous research, WILDS provides a complete ecosystem:

  • Standardized Splits: Train, validation, and test sets are carefully partitioned to isolate specific distribution shifts.
  • Tailored Metrics: Evaluation focuses on real-world utility, using metrics like "worst-group accuracy" or "macro F1 scores" to ensure performance is not averaged over marginalized groups.
  • Baseline Algorithms: The benchmark evaluates standard Empirical Risk Minimization (ERM) against state-of-the-art robust methods, including CORAL (feature alignment), IRM (Invariant Risk Minimization), and Group DRO (Distributionally Robust Optimization).

Key Insights: The Robustness Gap

The researchers identified several critical trends across the benchmark:

  • Significant Performance Drops: There is a consistent and massive gap between in-distribution (ID) and out-of-distribution (OOD) performance. Models that appear highly accurate during training often fail significantly in the wild.
  • Failure of Current Robust Methods: Specialized algorithms like IRM and Group DRO often failed to outperform simple ERM. This suggests that "in-the-wild" shifts are fundamentally more challenging than the synthetic shifts these methods were originally designed for.
  • Metadata as a Lever: The benchmark provides "domain IDs" (e.g., hospital ID) during training. Leveraging this metadata to learn invariant features remains a key area for future development.
  • Underspecification: Models with identical training performance can vary wildly on test data, highlighting the need for better model selection criteria during validation.

Results and Performance

The observed performance degradation was often severe:

  • Camelyon17: Accuracy dropped from 93.2% on seen hospitals to 70.3% on a new hospital.
  • CivilComments: Despite a high average accuracy of 92.2%, the accuracy on the most difficult demographic subgroup was only 56.0%.
  • FMoW: Land use classification accuracy fell from 59.7% (ID) to 32.3% when tested on the worst geographical region in a future time period.
  • Baseline Comparison: In 8 out of 10 datasets, robust algorithms provided no significant improvement over standard ERM, and occasionally degraded performance.

Conclusion and Future Directions

The WILDS benchmark serves as a call to action for the machine learning community. The failure of existing "robust" methods on these realistic datasets indicates a critical need for fundamentally new approaches to generalization. While the current benchmark focuses on classification and regression, future iterations may expand to more complex tasks. By providing an open-source package and public leaderboards, the authors aim to accelerate the development of models that are truly reliable for real-world deployment.

Summary updated

BibTeX
@inproceedings{koh2021wilds,
  author = {Pang Wei Koh and Shiori Sagawa and Henrik Marklund and Sang Michael Xie and Marvin Zhang and Akshay Balsubramani and Weihua Hu and Michihiro Yasunaga and Richard Lanas Phillips and Sara Beery and Jure Leskovec and Anshul Kundaje and Emma Pierson and Sergey Levine and Chelsea Finn and Percy Liang},
  title = {{WILDS: A Benchmark of in-the-Wild Distribution Shifts}},
  booktitle = {International Conference on Machine Learning},
  year = {2021},
  url = {https://openreview.net/forum?id=7LZf1WPvdFDi},
}
Figure