Leveraging unlabeled data to predict out-of-distribution performance

Saurabh Garg, Sivaraman Balakrishnan, Zachary Chase Lipton, Behnam Neyshabur, Hanie Sedghi

TL;DR

When machine learning models face "distribution shift" in the real world, their accuracy often plummets. This paper introduces Average Thresholded Confidence (ATC), a simple yet remarkably effective method to predict a model's performance on new, unlabeled data by learning a specific confidence threshold on the training set. ATC estimates target accuracy 2–4× more accurately than previous state-of-the-art methods across a wide variety of datasets and shift types.

What Problem Does This Paper Address?

Standard machine learning assumes that the data a model sees during deployment (the "target") looks just like the data it was trained on (the "source"). In reality, distributions shift: lighting changes, new subpopulations appear, or data is corrupted.

The challenge is that while we can easily detect that a shift has occurred, it is notoriously difficult to predict how much the model's accuracy will drop without collecting expensive new labels. Previous attempts either required additional labeled data from multiple "seen" shifts to train a regression model or relied on the model being "calibrated" on the new data—a condition that rarely holds true under distribution shift.

Methods

The authors propose a method called Average Thresholded Confidence (ATC). The logic is elegant:

  1. Score the Source: Take a labeled validation set from the source distribution. For every example, calculate a "confidence score" (like the maximum softmax probability or negative entropy).
  2. Find the Threshold: Find a threshold $t$ such that the fraction of source examples with a score above $t$ exactly matches the model's accuracy on that set.
  3. Predict on Target: When presented with unlabeled target data, calculate the same scores. ATC predicts the target accuracy as simply the fraction of examples that score above that same threshold $t$.
Overview of the Average Thresholded Confidence (ATC) method.

Crucially, the authors found that applying Temperature Scaling (a post-hoc calibration technique) to the model on the source data significantly boosts the accuracy of these predictions.

Datasets

The authors conducted an extensive evaluation using:

  • Vision: ImageNet (including corrupted versions like ImageNet-C and natural shifts like ImageNet-v2/R/Sketch), CIFAR-10/100, and MNIST (shifting to USPS/SVHN).
  • Subpopulation Shifts: The BREEDS benchmark, which tests how models handle entirely new sub-classes (e.g., training on "poodles" and "beagles" but testing on "rottweilers").
  • Real-world Shifts: The WILDS benchmark, featuring satellite imagery (FMoW), medical imaging (RxRx1), and text (Amazon reviews, CivilComments).

Key Insights and Ideas

  • The Impossibility Result: The authors prove theoretically that without making assumptions about the nature of the shift, it is impossible to perfectly estimate accuracy. This is a sobering reminder that any estimation method (including ATC) has "blind spots."
  • Confidence as a Proxy for Correctness: The core "aha" moment is that while raw confidence scores are often overconfident under shift, the relative ordering of scores often remains useful. By matching the threshold to the source error, ATC "re-anchors" the confidence metric to the model's actual performance.
  • Simplicity Wins: Unlike prior methods like Generalized Disagreement Equality (GDE), which requires training two separate models, or regression-based methods that need labels from multiple shifted domains, ATC is a "black-box" method. It requires only one model and zero labels from the target domain.

Key Results

  • Superior Accuracy: ATC consistently outperformed prior methods. On CIFAR and ImageNet, it reduced the Mean Absolute Error (MAE) of accuracy predictions by 2–4× compared to the next best competitor.
  • Robustness: In scatter plots comparing predicted vs. true accuracy, ATC points fall remarkably close to the $y=x$ line (the "perfect prediction" line), whereas other methods often systematically over- or under-estimate performance.
Predicted vs. True OOD Accuracy on ImageNet200.
  • Toy Model Validation: The authors used a simple mathematical model with "spurious features" (features that correlate with the label but aren't the cause) to show that ATC correctly tracks performance even when the correlation of those spurious features changes in the target data.

Limitations and Future Work

  • The "Novel Subpopulation" Gap: While ATC dominates other methods on the BREEDS benchmark, its absolute error is still higher there than on other datasets. Predicting performance when the model encounters entirely new types of objects remains a difficult frontier.
  • Specific Shift Failures: The authors identify specific types of shifts (like "support shifts" where the range of data values changes drastically) where ATC can be biased.
  • Multi-class Theory: While the empirical results cover many classes, the theoretical proofs are currently focused on binary classification. Extending the theory to the multi-class setting is a suggested next step.

Summary updated

BibTeX
@inproceedings{garg2022leveraging,
  author = {Saurabh Garg and Sivaraman Balakrishnan and Zachary Chase 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