Aggregation Hides Out-of-Distribution Generalization Failures from Spurious Correlations

Olawale Salaudeen, Haoran Zhang, Kumail Alhamoud, Sara Beery, Marzyeh Ghassemi

Introduction

In machine learning, a dominant paradigm known as "Accuracy-on-the-Line" (AoTL) suggests that improvements in a model's in-distribution (ID) performance reliably translate to improvements in out-of-distribution (OOD) performance. This observation has led to a degree of optimism regarding model robustness, suggesting that spurious correlations—features like background color or lighting that provide shortcuts during training—might be naturally overcome as models become more accurate overall.

However, this paper demonstrates that this optimistic view is often a byproduct of data aggregation. By averaging performance across diverse OOD datasets, researchers may be inadvertently masking significant failure modes. The authors introduce OODSelect, a method to identify semantically coherent subsets of data where the trend flips: higher ID accuracy actually predicts lower OOD accuracy. These "Accuracy-on-the-Inverse-Line" (AoTIL) subsets reveal that models are often still fundamentally reliant on training-set shortcuts that fail in specific, predictable ways.

Methodology: Uncovering the Inverse Line

To identify these hidden vulnerabilities, the authors developed OODSelect, a gradient-based selection procedure. The goal is to find a subset of OOD data where the correlation between ID and OOD performance is minimized (or made strongly negative).

1. Model Population

The researchers first established a baseline by training a massive population of models—up to 4,200 per dataset. These models varied across architectures (including ResNets, Vision Transformers, and BERT), initializations, and hyperparameters to ensure the findings were not specific to a single model type.

2. Optimization and OODSelect

The core of the method involves a selection vector $s$ that determines which OOD examples to include in a subset. The objective function is designed to minimize the Pearson correlation between ID accuracy and the accuracy on the selected OOD subset. Because selecting discrete examples is a computationally difficult combinatorial problem, the authors relaxed $s$ to be continuous (using a sigmoid function) and optimized it using the Adam optimizer. A penalty term was included to ensure the resulting subsets remained large enough to be statistically significant.

3. Semantic Validation

To ensure these subsets were not merely collections of random noise or "hard" examples, the authors used Vision-Language Models (VLMs) and metadata to analyze the semantic characteristics of the identified AoTIL subsets.

Experimental Results

The study evaluated several prominent benchmarks in domain generalization and distribution shift, including medical imaging (Chest X-rays, WILDSCamelyon), computer vision (PACS, TerraIncognita), and natural language processing (WILDSCivilComments).

The Masking Effect of Aggregation

The results across all benchmarks were consistent: while the aggregate OOD dataset might show a positive correlation, OODSelect consistently found large subsets where the correlation was strongly negative (as low as -0.9 Pearson R).

  • Chest X-rays: On the full OOD set, the correlation was a robust 0.86. However, OODSelect identified a subset comprising 77% of the data (55,000 examples) where the correlation flipped to -0.60.
  • CivilComments: The method identified a 50% subset where higher ID accuracy predicted lower OOD accuracy in toxic comment detection.
  • TerraIncognita: Even in datasets that appeared robust at the aggregate level, a 25% slice of the data exhibited a notable negative correlation.

Shortcuts as Predictive Failures

The existence of these inverse lines suggests that the features models use to achieve high accuracy on training data are the exact same features that cause them to fail on these specific OOD subsets. For example, in the Chest X-ray dataset, the AoTIL subset was semantically linked to specific clinical conditions like pleural effusion. In wildlife camera traps (TerraIncognita), failures were linked to specific lighting conditions, such as infrared versus daylight.

Discussion and Implications

The findings suggest that current robustness benchmarks may be providing a false sense of security. Because AoTIL trends are architecture-agnostic—holding true even when the models used to find the subsets differ from those used to test them—they represent fundamental failures in how models learn to generalize.

Limitations

The primary drawback of OODSelect is its computational cost, as it requires training thousands of models to achieve stable correlation estimates. However, the authors argue this is a necessary one-time cost for developing a truly rigorous benchmark. Furthermore, while many subsets are semantically interpretable, some (particularly in histopathology) remain difficult for humans to explain, even with VLM assistance.

Conclusion

This research highlights a critical need to move beyond aggregate metrics when evaluating model robustness. By adopting tools like OODSelect, the machine learning community can better identify and address the specific spurious correlations that lead to systematic failures, ensuring that models are robust not just on average, but across the diverse and challenging conditions of the real world.

Summary updated

BibTeX
@inproceedings{salaudeen2025aggregation,
  author = {Olawale Salaudeen and Haoran Zhang and Kumail Alhamoud and Sara Beery and Marzyeh Ghassemi},
  title = {{Aggregation Hides Out-of-Distribution Generalization Failures from Spurious Correlations}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=w97lDmoD0U},
}
Figure