Abstract
Machine learning algorithms often encounter different or "out-of-distribution" (OOD) data at deployment time, and OOD detection is frequently employed to detect these examples. While it works reasonably well in practice, existing theoretical results on OOD detection are highly pessimistic. In this work, we take a closer look at this problem, and make a distinction between uniform and non-uniform learnability, following PAC learning theory. We characterize under what conditions OOD detection is uniformly and non-uniformly learnable, and we show that in several cases, non-uniform learnability turns a number of negative results into positive. In all cases where OOD detection is learnable, we provide concrete learning algorithms and a sample-complexity analysis.
Introduction
In real-world applications, machine learning models frequently encounter data that deviates from their training distribution—such as a self-driving car encountering a novel vehicle type or a medical AI processing a patient demographic not represented in its training set. Out-of-Distribution (OOD) detection serves as a critical "safety valve," identifying these novel examples so the system can abstain from making potentially risky predictions.
Despite the empirical success of various OOD detection methods, theoretical research has often been skeptical, suggesting that OOD detection is either "impossible" or requires overly restrictive assumptions. This paper bridges the gap between pessimistic theory and practical success by investigating the fundamental mathematical conditions under which OOD detection is learnable.
Theoretical Framework and Methods
The authors leverage classical tools from Probably Approximately Correct (PAC) learning theory to analyze the OOD problem. A central contribution is the distinction between two types of learnability:
- Uniform Learnability: A single sample complexity bound exists for all distributions within a domain space.
- Non-Uniform Learnability: The number of samples required to learn a detector may depend on the specific properties of the distribution encountered.
The paper introduces the Maximal Zero OOD Risk Procedure, a principled algorithm that considers all domains consistent with training data and selects a hypothesis that minimizes the risk of failing to detect OOD examples. Additionally, the authors adapt the concept of VC-dimension to OOD detection to quantify the complexity of different domain spaces.
Key Insights: The Role of Geometry and Structure
A major finding is that many scenarios previously deemed "impossible" are actually learnable in a non-uniform sense. This explains why practical methods often succeed: they do not need to converge at the same rate for every possible distribution, but rather eventually converge for the specific distribution at hand.
The authors demonstrate that simple disjointness of supports is insufficient for learnability. Without additional structure, OOD detection can remain impossible even if the In-Distribution (ID) and OOD data do not overlap. They identify several "geometric lifelines" that enable learnability:
- $\tau$-Far Supports ($\tau$-FSA): A minimum physical gap $\tau$ between ID and OOD data.
- Hölder Continuity: Smooth transitions in data density.
- Convexity (ConvexID): If ID data forms a convex set, a Convex Hull Procedure can effectively define the boundary.
Key Results and the Learnability Map
The research provides a comprehensive taxonomy of OOD learnability across different assumptions. Notably, the authors disprove the conjecture that finite VC-dimension alone guarantees OOD learnability, showing that OOD detection is fundamentally more challenging than standard supervised learning.
The results indicate that while OOD detection is not learnable under the basic Disjoint Support Assumption (DSA), it becomes non-uniformly learnable under $\tau$-FSA or Hölder continuity. To achieve uniform learnability (a "guaranteed speed" of learning), one typically needs the ID data to be bounded within a specific radius in addition to maintaining a gap from OOD data.
Conclusion and Future Directions
This work shifts the theoretical perspective on OOD detection from pessimism to a nuanced understanding of learnability. By focusing on non-uniform learnability, the authors provide a theoretical basis for the success of practical OOD methods.
Future research may explore:
- Batch Testing: Determining if processing unlabeled test points in batches simplifies detection.
- Online Adaptation: Developing detectors that refine their boundaries as they encounter more OOD examples.
- Average-Case Analysis: Moving beyond adversarial worst-case risks to find more practical bounds for typical data distributions.
Summary updated