Know When to Abstain: Optimal Selective Classification with Likelihood Ratios

Alvin Heng, Harold Soh

Machine learning models are notoriously overconfident. They often provide high-certainty predictions for inputs they have never seen before, leading to silent and potentially dangerous failures. Selective classification (SC) aims to fix this by allowing a model to abstain from predicting when uncertainty is high, effectively deferring the decision to a human expert or fallback system.

While many "post-hoc" methods exist to decide when to reject an input (like looking at the maximum softmax probability), they are often heuristic and lack a unified theoretical foundation. Furthermore, most SC methods are tested on identically distributed (i.i.d.) data. In reality, models face covariate shift—for example, a model trained on photos of cats being tested on sketches of cats. This paper seeks a principled, robust way to design selection functions that work even when the data distribution shifts.

The Neyman–Pearson Approach to Abstention

The authors revisit selective classification through the lens of the classical Neyman–Pearson lemma, a foundational result in statistics. They show that the mathematically optimal selection rule is a likelihood ratio test: the density of the input given the model is correct divided by the density given it is wrong.

Most existing methods only look at how "in-distribution" a sample is. This paper argues that explicitly modeling the distribution of errors is the key to optimal abstention. Based on this insight, they propose two novel distance-based selectors:

  1. $\Delta$-MDS: This method tracks two sets of statistics per class: the mean and covariance of features for samples the model gets right, and those it gets wrong. The selection score is the difference between these two Mahalanobis distances.
  2. $\Delta$-KNN: A non-parametric version that compares the distance of a test point to its $k$-nearest "correct" training neighbors versus its $k$-nearest "wrong" training neighbors.
Illustration of distance-based selection comparing correct and wrong distributions.

The authors also demonstrate that these distance-based scores can be linearly combined with logit-based scores (like RLog, which looks at the margin between the top two predictions) to create a hybrid selector. This hybrid captures both geometric feature density and learned decision boundaries. Logit-based methods are great at identifying uncertainty near decision boundaries, while distance-based methods ($\Delta$-MDS/KNN) are better at identifying when an input has drifted away from the known data manifold. Combining them provides a "best of both worlds" robustness.

Experimental Validation and Key Results

The authors conducted an extensive evaluation across vision and language domains, testing state-of-the-art architectures like CLIP, EVA, and DistilBERT. For vision tasks, they used ImageNet-1K as the base and tested on seven covariate-shifted variants, including ImageNet-R (renditions), ImageNet-A (adversarial), ObjectNet, and ImageNet-C (corruptions).

Performance comparison of selective classification methods across ImageNet variants.

The results demonstrate massive performance gains:

  • Significant Error Reduction: On CLIP models, moving from standard distance methods to the Neyman-Pearson-informed $\Delta$-variants resulted in a roughly 50% reduction in average Selective Risk (measured by AURC and NAURC).
  • State-of-the-Art Hybrids: The hybrid $\Delta$-KNN-RLog emerged as the top performer for CLIP, while $\Delta$-MDS-RLog excelled for supervised models like EVA.
  • Sample Efficiency: $\Delta$-KNN proved remarkably stable. It outperformed standard baselines even when only 0.1% of labeled training data (roughly one image per class) was used to compute the "correct vs. wrong" statistics.
  • Non-Parametric Resilience: $\Delta$-KNN is particularly impressive because it doesn't assume the data follows a specific distribution (like a Gaussian), making it highly effective for models like CLIP that are trained with contrastive losses.

Limitations and Future Directions

While highly effective, these methods require a one-time pass over the training set to cache feature vectors or statistics. Although this computational overhead is amortized over future inferences, it does require access to training data or a representative validation set. Additionally, performance depends on choosing a combination weight and the number of neighbors ($k$), though the authors provide simple heuristics that work well in practice.

Currently focused on classification, extending this Neyman–Pearson framework to more complex tasks like semantic segmentation, time-series forecasting, or generative LLMs represents a promising next step for building more reliable AI systems.

Summary updated

BibTeX
@inproceedings{heng2026know,
  author = {Alvin Heng and Harold Soh},
  title = {{Know When to Abstain: Optimal Selective Classification with Likelihood Ratios}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=RsfaFXBFzM},
}
Figure