Introduction
Likelihood-based deep generative models (DGMs), such as Normalizing Flows and Diffusion Models, are designed to learn the probability distribution of a dataset. Intuitively, we expect these models to assign high likelihoods to data similar to their training set and low likelihoods to everything else.
However, researchers have observed a bizarre and persistent "Likelihood Paradox": when trained on a relatively complex dataset, DGMs frequently assign higher likelihoods to out-of-distribution (OOD) data from simpler sources. Adding to the mystery, OOD samples are never actually generated by these DGMs despite having higher likelihoods. This two-pronged paradox has made likelihood-based OOD detection highly unreliable for safety-critical applications like autonomous driving or medical imaging. This paper provides a conclusive geometric explanation for this phenomenon and proposes a robust detection method to solve it.
The Likelihood Paradox
The paradox is most pronounced in "pathological" dataset pairs. For instance, a model trained on a complex dataset like Fashion-MNIST (clothes) will often assign much higher likelihoods to a simpler dataset like MNIST (digits), which it has never seen.
Even more confusingly, the authors highlight a new pathology: models often assign lower likelihoods to their own generated samples than to OOD data. This definitively proves that likelihood alone is a poor metric for determining if a sample "belongs" to a learned distribution.
The Geometric Solution: Density vs. Probability Mass
The authors argue that the missing piece of the puzzle is geometry, specifically leveraging the "Manifold Hypothesis"—the idea that high-dimensional data actually lies on much lower-dimensional "surfaces" or manifolds.
The core insight is the distinction between density and probability mass. Probability mass is roughly equivalent to Density × Volume. OOD data can have massive density, but if it exists on a manifold with a much lower dimension than the training data, its "volume" in the model's learned space is effectively zero.
This explains both sides of the paradox:
- High Likelihood: The simpler OOD data sits on a sharp, low-dimensional peak, resulting in a massive density spike.
- Never Generated: Because the volume of this low-dimensional manifold is negligible, the total probability mass is near zero, meaning the model will almost never sample from it.
Furthermore, this explains why the paradox only goes one way. A model trained on simple digits (MNIST) does not assign high likelihood to complex clothes (FMNIST) because the complex data does not fit into a lower-dimensional subspace of the simple data.
The Dual Threshold Algorithm
To identify these deceptive, high-density OOD regions, the authors propose using Local Intrinsic Dimension (LID). LID measures the dimensionality of the manifold at a specific point, acting as a mathematically grounded proxy for the "volume" term in the probability mass equation.
They estimate LID differently depending on the architecture:
- Normalizing Flows: By calculating the numerical rank of the Jacobian matrix of the transformation.
- Diffusion Models: By utilizing the properties of the score function (the gradient of the log-density), which tends to point orthogonally to the data manifold.
Instead of relying solely on a likelihood threshold, the authors propose a Dual Threshold Algorithm:
- If likelihood is low $\rightarrow$ OOD.
- If likelihood is high BUT LID is low $\rightarrow$ OOD (This catches the paradox).
- Otherwise $\rightarrow$ In-Distribution.
Key Results and Impact
The dual-threshold method significantly outperforms standard likelihood-based detection across standard computer vision benchmarks (including CIFAR-10, SVHN, and CelebA).
In the pathological Fashion-MNIST vs. MNIST task, standard likelihood yields an AUC-ROC of only 0.07 (worse than random guessing). The proposed dual-threshold method boosts this to an impressive 0.95. The method matches or exceeds the performance of state-of-the-art OOD detection techniques while remaining entirely unsupervised and requiring only a single pre-trained model.
Limitations
While the theory is general, the current LID estimators are specifically tailored for Normalizing Flows and Diffusion Models. Applying this framework to other architectures, like VAEs or GANs, will require developing new, tractable LID estimators. Additionally, the method relies on a threshold to determine the numerical rank of matrices; while the authors propose an automated way to set this, performance remains somewhat sensitive to this hyperparameter.
Summary updated