Leveraging Unlabeled Data to Predict Out-of-Distribution Performance

Saurabh Garg, Sivaraman Balakrishnan, Zachary C. Lipton, Behnam Neyshabur, Hanie Sedghi

TL;DR

Researchers from Carnegie Mellon and Google have developed Average Thresholded Confidence (ATC), a simple yet powerful method to predict how well a machine learning model will perform on new, unlabeled data. By learning a confidence threshold on training data, ATC estimates out-of-distribution (OOD) accuracy 2–4× more accurately than previous state-of-the-art methods.

What Problem Does This Paper Address?

We know that machine learning models are "brittle"—they perform great on data similar to their training set (IID) but often fail when they encounter real-world "distribution shifts" (OOD). For example, a self-driving car trained in sunny California might struggle in a snowy Pittsburgh winter.

The challenge is that in the real world, we often have plenty of unlabeled data from the new environment but no labels to actually calculate the model's accuracy. If we can't measure performance, we can't know if a model is safe to deploy. This paper tackles the problem of unsupervised performance estimation: predicting a model's target-domain accuracy using only labeled source data and unlabeled target data.

Methods

The authors propose a method called Average Thresholded Confidence (ATC). The intuition is straightforward: instead of just averaging a model's confidence (which is often misleadingly high on new data), we should find a "goldilocks" threshold.

  1. Find the Threshold: On a labeled validation set from the source (training) distribution, calculate a score for each example (like the maximum softmax probability or negative entropy). Find a threshold $t$ such that the fraction of examples with a score above $t$ exactly matches the model's actual accuracy on that validation set.
  2. Predict Target Accuracy: Apply that same threshold $t$ to the scores of the unlabeled target data. The predicted accuracy is simply the fraction of target examples that exceed the threshold.

This differs from standard "Average Confidence" (AC) because it doesn't assume the model is perfectly calibrated; it essentially "re-calibrates" the definition of a confident prediction based on the source performance.

Datasets

The authors conducted an extensive empirical evaluation across a massive range of scenarios:

  • Vision: ImageNet (including variants like ImageNet-C for corruptions, ImageNet-v2, ImageNet-R, and Sketch), CIFAR-10/100, and MNIST.
  • Subpopulation Shifts: The BREEDS benchmark, which tests models on novel subgroups (e.g., training on one type of dog and testing on another).
  • Real-world "In the Wild" Shifts: The WILDS benchmark, including satellite imagery (FMoW), cellular microscopy (RxRx1), product reviews (Amazon), and toxic comment detection (CivilComments).

Key Insights and Ideas

  • The Impossibility Result: The authors prove a sobering theoretical point: without making assumptions about the nature of the shift, it is mathematically impossible to perfectly identify accuracy. Predicting accuracy is essentially as hard as finding the optimal predictor for the new data.
  • The "Aha" Moment: Despite the theoretical difficulty, the threshold learned on the source data remains remarkably robust across many types of shifts. The paper suggests ATC works because it balances "falsely identified correct" predictions with "falsely identified incorrect" predictions.
  • Calibration Matters: While ATC is robust, the authors found that performing post-hoc calibration (like Temperature Scaling) on the source data further improves the accuracy of the performance estimates.

Key Results

  • Superior Accuracy: ATC consistently outperformed prior methods like Difference of Confidence (DOC) and Generalized Disagreement Equality (GDE). In many experiments, it reduced the Mean Absolute Error (MAE) of the accuracy prediction by 2–4×.
  • Consistency: On scatter plots comparing predicted vs. true accuracy, ATC points cluster tightly around the $y=x$ line, whereas other methods often wildly overestimate performance as the distribution shifts further away.
  • Versatility: The method proved effective for both convolutional neural networks (vision) and Transformer-based models (NLP).

Limitations and Future Work

  • Novel Subpopulations: While ATC is the best of the bunch, it still struggles with the BREEDS benchmark. When a model encounters entirely new categories of data it has never seen, the relationship between confidence and accuracy becomes much harder to predict.
  • Support Shift: If the target data exists in a region of the input space that was completely empty during training (a "support shift"), ATC can produce biased estimates.
  • Theoretical Expansion: The current theoretical toy model focuses on binary classification. The authors aim to extend this to multi-class settings to better understand why the threshold generalizes so well in practice.

For those interested in implementation, the authors have released their code on GitHub.

Summary updated

BibTeX
@inproceedings{garg2022leveraging,
  author = {Saurabh Garg and Sivaraman Balakrishnan and Zachary C. Lipton and Behnam Neyshabur and Hanie Sedghi},
  title = {{Leveraging Unlabeled Data to Predict Out-of-Distribution Performance}},
  booktitle = {International Conference on Learning Representations},
  year = {2022},
  url = {https://openreview.net/forum?id=o_HsiMPYh_x},
}
Figure