[Paper Review] Hierarchical VAEs Know What They Don't Know
This paper identifies that hierarchical VAEs fail at out-of-distribution (OOD) detection because low-level features (e.g., edges) generalize across datasets and dominate likelihood estimates, leading to high likelihoods for OOD data. To address this, it proposes a novel, fully unsupervised likelihood-ratio score that enforces in-distribution activation across all hierarchical feature levels, achieving state-of-the-art OOD detection performance across multiple benchmarks.
Deep generative models have been demonstrated as state-of-the-art density estimators. Yet, recent work has found that they often assign a higher likelihood to data from outside the training distribution. This seemingly paradoxical behavior has caused concerns over the quality of the attained density estimates. In the context of hierarchical variational autoencoders, we provide evidence to explain this behavior by out-of-distribution data having in-distribution low-level features. We argue that this is both expected and desirable behavior. With this insight in hand, we develop a fast, scalable and fully unsupervised likelihood-ratio score for OOD detection that requires data to be in-distribution across all feature-levels. We benchmark the method on a vast set of data and model combinations and achieve state-of-the-art results on out-of-distribution detection.
Motivation & Objective
- To investigate why deep generative models, particularly hierarchical VAEs, assign higher likelihoods to out-of-distribution (OOD) data than in-distribution data, despite being trained on a single distribution.
- To identify the root cause of this failure, particularly the role of generalized low-level features (e.g., edges) that are shared across different data distributions.
- To develop a fast, scalable, and fully unsupervised OOD detection method that avoids reliance on low-level features dominating the likelihood estimate.
- To demonstrate state-of-the-art performance on OOD detection across diverse data and model combinations using the proposed likelihood-ratio score.
Proposed method
- The method introduces a likelihood-ratio score, denoted as $LLR^{>l}$, which compares the likelihood of a sample under the model’s full posterior to its likelihood under a conditional prior at each hierarchical layer $l$.
- The score ensures that a sample must be in-distribution at every feature level from the topmost down to layer $l$, preventing low-level features from misleading the likelihood estimate.
- The approach uses importance sampling with 1000 samples to compute the likelihoods, enabling stable and scalable OOD detection without requiring labeled OOD data.
- The model is trained using a hierarchical VAE architecture with multiple latent layers, where each layer’s posterior is conditioned on the higher-level latents, and the prior is factorized across layers.
- The method evaluates OOD detection performance using standard metrics: AUROC, AUPRC, and FPR80, across multiple datasets including MNIST, FashionMNIST, CIFAR10, and Omniglot.
Experimental results
Research questions
- RQ1Why do hierarchical VAEs assign higher likelihoods to out-of-distribution data than to in-distribution data, despite being trained on a single distribution?
- RQ2To what extent do low-level features (e.g., edges) generalize across datasets and dominate likelihood estimates in hierarchical VAEs?
- RQ3Can a likelihood-ratio score that enforces in-distribution activation across all hierarchical feature levels improve OOD detection performance?
- RQ4Does the proposed method achieve state-of-the-art OOD detection performance in a fully unsupervised setting without requiring OOD labels or examples?
Key findings
- The proposed likelihood-ratio score $LLR^{>1}$ achieves an AUROC of 0.998 on the notMNIST dataset when trained on FashionMNIST, outperforming standard likelihoods.
- On the Omniglot28x28 dataset, $LLR^{>2}$ achieves a perfect AUROC of 1.000 and AUPRC of 1.000 when trained on MNIST, indicating near-perfect OOD detection.
- For the HVAE trained on CIFAR10, $LLR^{>1}$ achieves an AUROC of 0.835 and AUPRC of 0.835 on the CIFAR100 OOD set, significantly outperforming the standard likelihood $\mathcal{L}^{>1}$, which achieves 0.479 AUROC.
- On the challenging Omniglot28x28Inverted dataset, $LLR^{>1}$ achieves an AUROC of 0.944 and AUPRC of 0.953, while the standard likelihood $\mathcal{L}^{>1}$ scores only 0.450 AUROC, demonstrating the method’s robustness to distribution shifts.
- The method achieves state-of-the-art performance across all tested datasets and model combinations, with AUROC scores consistently above 0.95 on most benchmarks, including 0.999 on KMNIST and 1.000 on SmallNORB28x28.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.