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, Irena Gao, Tony Lee, Etienne David, Ian Stavness, Wei Guo, Berton Earnshaw, Imran Haque, Sara M. Beery, Jure Leskovec, Anshul Kundaje, Emma Pierson, Sergey Levine, Chelsea Finn, Percy Liang

Introduction

Most machine learning models are developed under the "i.i.d. assumption," which posits that training and test data are drawn from the exact same distribution. In the real world, however, this assumption is almost always violated. A model trained on medical images from one hospital might fail at another due to different equipment, or a wildlife camera trap model might fail when moved to a new forest with different lighting and backgrounds.

Existing benchmarks for "distribution shift" often rely on synthetic transformations—like rotating digits or adding artificial noise—or small-scale datasets. These fail to capture the complexity of "in-the-wild" shifts. To address this, researchers introduced WILDS, a curated benchmark of 10 diverse, real-world datasets designed to evaluate how machine learning models handle realistic distribution shifts. The benchmark reveals a massive performance gap between standard training and real-world deployment, showing that current "robust" algorithms often fail to close this gap.

Formalizing Distribution Shifts

The authors formalize two primary types of distribution shifts evaluated in the benchmark:

1. Domain Generalization In this setting, the model is tested on entirely unseen domains. For example, a model might be trained on data from four hospitals and tested on a fifth. The goal is to minimize the average error on these new, unseen domains.

Domain Generalization: Testing on entirely unseen domains, such as new molecular scaffolds.

2. Subpopulation Shift Here, the training and test domains overlap, but their proportions differ significantly. For instance, a toxicity classifier might see very few comments from a specific demographic during training. The goal is to minimize the worst-case error across all subpopulations, ensuring the model doesn't fail disproportionately on underrepresented groups.

Subpopulation Shift: Training and test domains overlap, but their proportions differ, leading to disparate performance across groups.

The WILDS Datasets

The WILDS benchmark consists of 10 datasets spanning various modalities (images, text, graphs, code) and applications. These include:

  • iWildCam2020-WILDS: Species identification across different camera trap locations.
  • Camelyon17-WILDS: Tumor identification across different hospitals.
  • RxRx1-WILDS: Genetic treatment classification across experimental batches.
  • OGB-MolPCBA: Molecular property prediction across different chemical scaffolds.
  • GlobalWheat-WILDS: Wheat head detection across different countries and growing conditions.
  • CivilComments-WILDS: Toxicity detection across different demographic mentions.
  • FMoW-WILDS: Land use classification across different years and geographical regions.
  • PovertyMap-WILDS: Poverty estimation across different countries and urban/rural areas.
  • Amazon-WILDS: Sentiment analysis across different users.
  • Py150-WILDS: Code completion across different GitHub repositories.

Key Insights and Baseline Failures

To establish baselines, the authors evaluated standard Empirical Risk Minimization (ERM) against several popular robust optimization algorithms, including CORAL, IRM (Invariant Risk Minimization), and Group DRO (Distributionally Robust Optimization).

The results provided a sobering look at the state of out-of-distribution (OOD) generalization:

  • The "In-the-Wild" Gap is Real: Standard models (ERM) consistently show a significant drop in performance when moving from in-distribution (ID) to OOD data. For example, on the Camelyon17 hospital dataset, accuracy drops from ~93% to ~70%. In the PovertyMap dataset, the Pearson correlation dropped from 0.60 (ID) to 0.45 (OOD).
  • Current Robust Methods are Insufficient: Surprisingly, algorithms specifically designed for robustness (like IRM and CORAL) often failed to outperform simple ERM on these realistic datasets. In 8 out of 10 datasets, these robust algorithms did not provide a meaningful improvement. This suggests that methods developed on synthetic benchmarks do not necessarily translate to real-world complexity.
  • The Group DRO Exception: Group DRO showed a significant gain on the CivilComments-WILDS dataset, improving worst-group accuracy from 56.0% to 70.0%. This is likely because the subpopulation shift in that dataset is well-defined by the provided demographic metadata.

Limitations and Future Directions

The authors highlight several ongoing challenges in building robust models. Validating models for OOD performance is inherently difficult because the OOD test data is unavailable during development, emphasizing the need for better OOD validation strategies. Additionally, some datasets only have a few domains (e.g., 5 hospitals in Camelyon17), making it hard for models to learn truly "invariant" features.

Ultimately, the paper suggests that simply changing the loss function may not be enough. Future improvements might require better architectures, pre-training on massive external datasets, or leveraging unlabeled data through unsupervised domain adaptation. WILDS serves as a living benchmark to track the community's progress in tackling these fundamental challenges of real-world machine learning.

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 Irena Gao and Tony Lee and Etienne David and Ian Stavness and Wei Guo and Berton Earnshaw and Imran Haque and Sara M. 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