Paper: Explaining the Out-of-Distribution Detection Paradox through Likelihood Peaks (ICLR-2024)

Reviewer comment (Theory):
It would benefit the authors to be a bit more careful in their discussion about manifolds and sub-manifolds. Namely, it is a bit strange to hypothesize that OOD data lies on a lower-dimensional submanifold than ID data and call these "lower probability mass" regions, since a submanifold constitutes a measure-zero set with respect to the Lebesgue measure of the ambient dimension of the data. At one point the authors use the phrase "concentrate around a lower-dimensional submanifold" which might be better, but it would be helpful to formalize what the authors mean so that the hypothesis makes mathematical sense.

Author response:
Presentation
1. You asked us to be more precise in the work about manifolds, submanifolds, and probability mass. Thank you for the suggestion; we will update the language around manifolds in the manuscript accordingly. To summarize,
   - The in-distribution data sits on a submanifold (of zero Lebesgue measure).
   - The likelihood-based DGM, which represents a full-dimensional density, concentrates mass around the (complex) in-distribution submanifold in such a way as to encode the submanifold’s dimensionality [A].
   - Due to its inductive biases, the DGM density *also* inadvertently concentrates a negligible amount of mass around out-of-distribution submanifolds when these are “simpler” (i.e. of lower intrinsic dimension).
  
    Since there is a distinction between the probability mass of the DGM and the underlying (measure zero) submanifolds being modelled, there is no underlying error in the way we use these concepts, though we certainly take your point that they can be made clearer.

Reviewer comment (Novelty):
The first contribution claimed by the paper (to explain how DGMs can assign higher likelihood to OOD datapoints yet only generate in-distribution samples) has already been offered by previous work. See section 5.1 in [1], which offers the same explanation as the one given in this current submission, i.e. "OOD datapoints can be assigned higher likelihood while not being generated if they belong to regions of low probability mass." Moreover, in the related work, the authors repeat arguments made in [1] as if they were their own, e.g. "...we challenge this assumption..."

Author response:
Presentation
2. We thank you for pointing this out. You are correct that the notion that the OOD paradox must be due to lower probability mass was not originally proposed by us, although we do highlight that the paper you point out does not propose a way to empirically verify this. We will reword the manuscript to make this clear. Our main contributions are linking this explanation to intrinsic dimension, and exploiting this newfound connection to build a highly-performant OOD detection algorithm.

Reviewer comment (Theory):
Do the authors have any analysis to suggest that $\hat{\rho}_r(\mathbf{x})$ should be a good approximation of $\rho_r(\mathbf{x})$?

Author response:
You also had two additional questions:

1. Thank you for bringing this point up. We are currently conducting a set of experiments where the ground truth values of $\rho_r$ and $\frac{\partial}{\partial r} \rho_r$ are either known or can be accurately computed. We will include these results in the manuscript before the end of the discussion period.

Reviewer comment (Experiments):
Can the authors provide evidence that this method works better than, say, an arbitrary statistic of the generative model that is validated to perform well on both SVHN vs. CIFAR-10 and the reverse? How about that the proposed method is robust to the validation strategy (e.g. alternative dataset pairs or different strategy altogether)?

Author response:
You also had two additional questions:

2. You also asked us about whether choosing hyperparameters for $r$ based on SVHN-CIFAR-10 does better than choosing another arbitrary statistic from a generative model, and whether our method is robust to this choice. In the general rebuttal we propose a new intuitive way to select $r$ without hyperparameter tuning; we hope this resolves your concerns on this front. Otherwise, could you please clarify what kind of arbitrary statistic you have in mind? We do point out that the “complexity correction” and “likelihood ratios” baselines we compare against could be loosely interpreted as leveraging arbitrary statistics, namely the compression length of images and the likelihood of another model, respectively.

Reviewer comment (Novelty):
There are already some theoretical explanations for the flow-based generative model's over-confidence in OOD samples, such as the location and variances of the data and the model curvature [1]. Thus, what is the difference between their interpretation and the explanation in this paper?

Author response:
- (**W2**): Indeed several explanations have been proposed in the literature, as we summarized in the Background and Related Work sections, including [A]. In particular, the one you bring up [A] has strong assumptions, namely that the in- and out-of-distribution densities have overlapping support and that they are both Gaussian. When, as in our case, in- and out-of-distributions are semantically different, the support overlap assumption is unrealistic [C]. Our explanation and resulting method do not require either of these assumptions (note our local Taylor approximation results in a local Gaussian approximation, not a global one).

Reviewer comment (Theory):
The proposed method highly depends on a strong assumption that the probability mass around an OOD sample is negligible. However, the authors seem not to provide sufficient support for this assumption, which may weaken the convincing of the proposed methods. And the experiments can also not support this assumption well, as the tested datasets are limited. Actually, not all OOD datasets would be assigned higher likelihoods by flow models [2], like detecting random noise images as OOD, what would happen when applying this method to these datasets? Besides, these OOD datasets especially random noise may not be "sharply peaked" as they are distributed widely in the input space.

Author response:
- (**W3**): Please see our discussion above as to why OOD samples being assigned negligible probability mass is indeed well established. We also point out that we do **not** claim OOD data is **always** assigned higher density, nor that it **always** has lower intrinsic dimension. In our work we often discus non-pathological cases like training on SVHN and evaluating on CIFAR10, where CIFAR10 data is not assigned higher likelihoods (e.g. Figure 14 for this pair). This is completely consistent with previous literature, which has found OOD data is only assigned higher likelihoods when OOD data is “simpler” than in-distribution data, which we quantify through intrinsic dimension. You also ask what would happen if we used our method in non-pathological settings. First, note that Table 1 contains several such examples, e.g. models trained on MNIST and tested on FMNIST, or trained on SVHN and tested on CIFAR10, are not subject to the standard paradox (and the intrinsic dimension of OOD data is not lower in this case), yet our method nonetheless succeeds at OOD detection. If random noise was used as OOD data instead, despite not having a low-intrinsic dimension, it would achieve a lower likelihood and still be detected by the other threshold in our dual threshold method (Algorithm 1). We will include such a result by the end of the discussion period.

Reviewer comment (Theory):
"The explanation for the OOD paradox" is a little bit weak and empirical.

Author response:
- (**W4**): We respectfully disagree with this characterization of our work. We hope that all the points we made above elucidate why, and that you will consider reevaluating our work at the end of the discussion period once we have made the promised manuscript updates. Otherwise, please let us know aspects you believe are “weak” or “empirical” and we will engage in discussion around them.

Reviewer comment (Theory):
The current analysis is built exclusively on normalizing flows, while it does not have discussion of other models. In particular, for models like VAEs, where the exact likelihood is not available, is it still applicable?

Author response:
Thank you for your positive feedback on our ideas, methodology, and experimental results.

1. You asked whether our analysis is generalizable to models outside of normalizing flows; please see the general rebuttal for more discussion on this point.

Reviewer comment (Experiments):
The way to determine the radius $r$ seems to be ad hoc. It depends on the dataset and the flow model as well. Is there a more principled way of choosing it? Can we just set r to be extremely small?

Author response:
Thank you for your positive feedback on our ideas, methodology, and experimental results.

2. You also asked a couple of questions about setting $r$.
     - You asked about a more principled way of setting it; please see the general rebuttal, where we propose an improvement over our original approach.
     - You also asked why we cannot simply set $r$ to a very small value; we agree this is a relevant question and we will further elaborate on it when updating the paper. An intuitive way to think about this is that the hyperparameter $r$ effectively chooses a scale at which we probe the density model, and that it determines how sensitive the estimate is to slight perturbations in the density. This is completely analogous to how LIDL [A] sets the various amounts of noise it uses to estimate LID, and to how commonly used estimators of global intrinsic dimension set the number of nearest neighbours as a hyperparameter [B]. Please refer to section 2.4 of [A] for a discussion on how they heuristically choose the scale variable according to how sensitive they require their estimator to be.

[A] Tempczyk et al., “LIDL: Local Intrinsic Dimension Estimation Using Approximate Likelihood”, ICML 2022.

[B] Levina and Bickel, “Maximum Likelihood Estimation of Intrinsic Dimension”, NeurIPS 2004.