Testing for Typicality with Respect to an Ensemble of Learned Distributions

Forrest Laine, Claire J. TomlinarXiv 2020 · OpenReview

TL;DR

This paper tackles the challenge of detecting "out-of-distribution" (OOD) data when the underlying data distribution is learned, not known. They propose using an ensemble of learned density models and testing for "typicality" within this ensemble, showing theoretically and empirically that this approach can better identify OOD data compared to using a single learned model.

What Problem Does This Paper Address?

Machine learning models are notoriously brittle when faced with data that differs from their training distribution. While we can train highly performant models, reliably detecting when they encounter OOD data remains a significant challenge. This is crucial for deploying these models safely, as OOD inputs can lead to unpredictable and potentially erroneous behavior. The core problem is that traditional "goodness-of-fit" tests, designed to check if data conforms to a known distribution, struggle when the "known" distribution is actually a learned approximation. These learned models can sometimes assign higher probabilities to OOD data than to in-distribution data, making anomaly detection difficult.

Methods

The authors build upon the concept of "typicality," which relates to whether data points fall within a region of high probability density under a given distribution. They propose a novel approach: instead of relying on a single learned density model, they train an ensemble of density models. The key idea is that a data point is considered anomalous if it is not typical with respect to any of the models in the ensemble.

The theoretical underpinnings involve proving that:

  1. A typicality test is a valid approach for goodness-of-fit.
  2. For a well-constructed ensemble of learned models, the intersection of their typical sets approximates the typical set of the true (ground-truth) distribution. This is achieved by ensuring the learned models are sufficiently "different" from each other to avoid collectively over-assigning density to the same OOD regions.

Datasets

The paper uses synthetic data generated from a high-dimensional mixture of Gaussians distribution for its case study and validation. No new benchmarks are introduced; the focus is on demonstrating the proposed method's effectiveness on a controlled synthetic setting.

Key Insights and Ideas

  • Learned densities can be misleading: Even if a learned density model is expressive enough to represent the true distribution, it can get stuck in local optima during training. This can lead to the learned model assigning high density to regions between the true modes of the data, making OOD data in these regions appear "typical" to the learned model.
  • Ensembles as a solution: By combining multiple learned models, each trained with different random initializations, the paper shows that the "blind spots" (regions where individual models incorrectly assign high density) of one model can be compensated for by others.
  • Intersection of typical sets: The core theoretical contribution is demonstrating that the intersection of typical sets from an ensemble of learned densities can effectively recover the typical set of the ground-truth distribution, especially when the ensemble members are sufficiently diverse. This intersection acts as a more robust indicator of true typicality.

Key Results

The paper presents a case study using a 100-dimensional mixture of Gaussians.

  • They show that individual learned density models, despite being trained to explain the data, often only capture about 12 out of 20 modes of the true distribution.
  • Consequently, about 60% of samples from a learned distribution might fall outside the typical set of the true distribution, making them appear anomalous to a single-model test.
  • The proposed ensemble method, when tested on synthetic data, showed that about 94.8% of samples generated by the ensemble were typical with respect to the ground-truth distribution, a significant improvement over individual models.

Limitations and Future Work

  • Theoretical bounds: The paper provides theoretical bounds for the ensemble method, but these are sufficient conditions and may not be tight. The authors suggest that in practice, it's often easier to find a good ensemble than the bounds suggest.
  • Empirical evaluation: The primary validation is on synthetic data. The authors acknowledge that future work should involve extending error rate bounds to the multi-typicality test and further evaluating its empirical performance on diverse real-world domains.
  • Computational cost: Training an ensemble of models inherently increases computational cost compared to training a single model.

Summary updated

Abstract

Methods of performing anomaly detection on high-dimensional data sets are needed, since algorithms which are trained on data are only expected to perform well on data that is similar to the training data. There are theoretical results on the ability to detect if a population of data is likely to come from a known base distribution, which is known as the goodness-of-fit problem. One-sample approaches to this problem offer significant computational advantages for online testing, but require knowing a model of the base distribution. The ability to correctly reject anomalous data in this setting hinges on the accuracy of the model of the base distribution. For high dimensional data, learning an accurate-enough model of the base distribution such that anomaly detection works reliably is very challenging, as many researchers have noted in recent years. Existing methods for the one-sample goodness-of-fit problem do not account for the fact that a model of the base distribution is learned. To address that gap, we offer a theoretically motivated approach to account for the density learning procedure. In particular, we propose training an ensemble of density models, considering data to be anomalous if the data is anomalous with respect to any member of the ensemble. We provide a theoretical justification for this approach, proving first that a test on typicality is a valid approach to the goodness-of-fit problem, and then proving that for a correctly constructed ensemble of models, the intersection of typical sets of the models lies in the interior of the typical set of the base distribution. We present our method in the context of an example on synthetic data in which the effects we consider can easily be seen.
BibTeX
@misc{laine2020testing,
  author = {Forrest Laine and Claire J. Tomlin},
  title = {{Testing for Typicality with Respect to an Ensemble of Learned Distributions}},
  year = {2020},
  eprint = {2011.06041},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2011.06041},
}
Figure