A Density-Ratio Readout Theory of Label-Free Out-of-Distribution Detection
Anonymous authors
ICLR 2027
TL;DR. An unlabeled test batch turns OOD detection into a finite-resolution density-ratio readout problem: low-degree projections yield closed-form scores, with degree 2 capturing strong near-OOD signal through anisotropic batch covariance.
Abstract. Out-of-distribution (OOD) detection is not simply a test of nominal atypicality. Reference typicality need not reveal which distribution a sample was drawn from. An unlabeled test batch adds population-level evidence of how the test distribution differs from the reference. This paper asks what becomes detectable from this information and how much can be recovered from finite data. At the population level, the batch-to-reference density ratio identifies where the test population is overrepresented relative to the reference, providing direct evidence of distributional difference. Finite data, however, limit how finely this ratio can be resolved, and finer resolution requires higher-order batch moments. Low-degree readouts that maximize the deflection, a standardized batch--reference contrast, have closed forms in the batch moments under a whitened Gaussian working model, with degree 2 requiring only the batch mean and covariance. Experiments from CIFAR to ImageNet show that the simple degree-2 readout outperforms ratio estimators on average, with its near-OOD gain largely reproduced by the directions along which the batch covariance departs from the reference.
Are you an author? Claim this paper to see who's reading it, with views and other statistics, and to write about it here.
Claim this paperedit · history
ICLR 2027
Under review · 3 reviews · OpenReview
Updated 24 Nov 2026, 17:08 UTC.
- Rating
- 3/4
- Confidence
- 3/4
- Soundness
- 2/3
- Presentation
- 2/3
- Informativeness
- 2/3
Read review
Summary
The work proposes a detection method based on a density ratio, an approach motivated by the fact that if anomalies fall in a high density region of the reference distribution, a detector using only the reference distribution may treat them as in-distribution. The proposed detector compares a reference dataset, with in-distribution data, to a batch dataset, made of both in-distribution and anomaly data; its resolution is described by the polynomial degree of the score, being the expressive moments of the batch dataset. A closed form expression of the scores for degrees 1 and 2 is derived for a whitened Gaussian as reference distribution. The method is then tested on classical datasets (cifar10, svhn,...), where the results tend to favor the proposed "ratio" detector of degree 2 based on the mean and covariance of the batch vs in-distribution data, in particular on near out of distribution data.
Strengths
The proposed methods is a well constructed aggregation of the state of the art, with a clear segmentation of the different contributions: the link from the batch dataset literature (Blanchard et al...) and the polynomial readout is a good idea.
The derivations seem correct, the proposed method performs well, and its results are properly analyzed in sections 4.3-5, followed by a discussion of its limitations.
Weaknesses
The paper is not very well written:
- The third contribution "near-OOD signal lies in covariance directions" is oddly stated, since the term "covariance directions" is hardly used afterwards. It should be made clear that it is a result of the g2 detector and its analysis (if i am not mistaken).
- and the feature vector are introduced at the beginning but not reused in the experimental part, where they should be recalled and used.
- In the same vein: batch data are never clearly defined in the experiments. It should be clearly stated that they follow equation (1) (and if this is not the case, it should be explained).
- Section 3.3.2 on closed forms is hard to follow due to abrupt references to appendix.
- , in equation (13), is only implicitely defined and it does not directly match the in appendix C, which is not defined for .
- minor remarks on notations: -KL and (J) (for KL may be acceptable) not really defined while they appear in a central proposition; the tensor (?) over z notation in 3.3.3 not even defined in the appendix (and not in official iclr notations).
Even though the idea is appealing, the contribution itself seems limited, as it is mainly an aggregation of well-established works: the first contribution does not seem to be a real one, and one could almost argue that the second and third could be merged.
Questions for the authors
Could you report standard deviations, at least for table 1?
About table 2: "the near-OOD gain of g2 therefore comes from the directional term". First, "anisotropic second moment" is not used elsewhere but i suppose it means the third term of equation (13). The scores are equal to g2: maybe more conclusions can be drawn from these results. Did you try to employ this term only as a score for more experiments ? If you have time maybe a few more results can be of use so we can compare the directional term with g2 (or not if you provide a theoretical reason for not using it).
Could you state more clearly your contribution with respect to the works you cite in section 2 ? I understand space is limited in the paper but, fortunately, we have more room here.
6 comments
Q1: Could you report standard deviations, at least for table 1?
We added standard deviations across seeds to all entries in Tables 1 and 3.
Q2: About table 2: "the near-OOD gain of g2 therefore comes from the directional term". First, "anisotropic second moment" is not used elsewhere [...] The scores are equal to g2: maybe more conclusions can be drawn from these results. Did you try to employ this term only as a score for more experiments?
- Terminology in Table 2: We updated this table (now Table 3) to name each term explicitly by its statistic: mean shift , trace , and traceless shift (, the third term of Eq. (13), which "anisotropic second moment" referred to). We also unified the terminology throughout the paper.
- Directional term alone: We extended Table 3 to all 44 configurations. The directional term alone matches on near-OOD ( vs. ). We retain the full because (i) the directional term alone is blind to isotropic scale changes (), whereas responds to any first- or second-moment shift (Eq. (12)); and (ii) at low contamination outperforms the centered directional readout (; App. D.9).
- What this equality implies: (a) The near-OOD signal is a change in the shape of the batch covariance, not in its mean or overall scale: the directional term matches after centering the covariance and after also removing the mean direction ( and vs. for ; cross-fitted, 8 near-OOD configurations of Table 1; Table 4), and the radial term adds little (Table 3). (b) This signal is spread over many directions: near-OOD needs about 8 eigen-directions of to reach 90% of its normalized AUROC, whereas far-OOD saturates at one (Fig. 4). Together, these suggest that near-OOD images lie among the ID class clusters, where is high, but overrepresent some directions there. A reference reader cannot tell along which directions the batch departs from the reference.
Thank you.
Regarding your response on "W7 & Q3", you state in the first contribution: "A two-axis view of OOD readouts."
-
"Organizing readouts by estimand and resolution explains what each estimand can and cannot reveal" + response: "vs. Semi-supervised novelty detection (Blanchard et al.): Classical work targets..." → What did you really bring to Blanchard et al.? The polynomial analysis is not from you, if I'm not mistaken?
-
"Links batch-based OOD scoring to classical restricted polynomial readouts" + response: "vs. General density-ratio estimation (uLSIF, DDE): Kernel and neural estimators..." → What is the difference with Kanamori et al.? Is it not a degree-2 polynomial readout also?
- Rating
- 3/4
- Confidence
- 2/4
- Soundness
- 3/3
- Presentation
- 2/3
- Informativeness
- 2/3
Read review
Summary
The paper studies out-of-distribution detection using an unlabeled test batch and a reference set of normal samples. It argues that comparing the test distribution with the reference can reveal anomalies that appear typical under the reference alone. The authors develop simple polynomial scores based on differences in batch statistics, balancing expressiveness against estimation difficulty. Experiments show that a quadratic score using the batch mean and covariance performs well, with improvements on near-distribution anomalies largely explained by directional covariance changes. The method remains sensitive to batch size, anomaly prevalence, and shifts in otherwise normal data.
Strengths
-
This paper has a clear motivation. The paper explains why a sample can be highly probable under the ID distribution yet belong to an anomalous population. The mixture-model argument provides a principled motivation for using unlabeled batch information. The distinction between detecting a batch shift and ranking individual samples is also valuable.
-
The proposed method is simple, interpretable, and efficient. The degree-2 score requires only batch moments after reference whitening. Its decomposition into mean, radial, and directional components makes its behavior understandable. Leave-one-out scoring explicitly addresses query self-alignment, and the sufficient statistics permit efficient streaming updates. The experiment results also show the efficiency of the proposed method.
-
The finding of this paper is interesting. In particular, the experiments show that directional covariance changes account for much of the improvement in near-OOD detection, offering useful insight into the information provided by unlabeled test batches.
Weaknesses
-
The proposed method may be vulnerable to class imbalance within the ID distribution. Rare ID classes may be incorrectly flagged as OOD, particularly when their proportions in the test batch differ from those in the reference set. The authors should evaluate robustness to ID class imbalance and class-prior shifts, including false-positive rates for minority classes.
-
The advantage of using population-level information for individual-level detection needs clearer justification. Although batch statistics can reveal an overall distributional shift, identifying which individual samples are OOD requires finer discrimination. Why should maximizing a batch–reference contrast produce reliable individual rankings? The paper acknowledges that a positive population mean gap can coexist with poor AUROC, but does not establish conditions under which population-level evidence translates into accurate sample-level detection. Clarifying these conditions would strengthen the motivation for the proposed objective.
Questions for the authors
Please see the weaknesses.
2 comments
We thank the reviewer for highlighting the clarity of our motivation, the simplicity and efficiency of the degree-2 readout, and our empirical findings on directional covariance shifts.
W1: The proposed method may be vulnerable to class imbalance within the ID distribution. Rare ID classes may be incorrectly flagged as OOD, particularly when their proportions in the test batch differ from those in the reference set. The authors should evaluate robustness to ID class imbalance and class-prior shifts, including false-positive rates for minority classes.
Eq. (1) assumes that the ID part of the batch follows the reference , so a class-prior shift lies outside the model, as covariate shift does (Sec. 4.5). We measured its effect on the 18 configurations of Table 1 (, , , 10 seeds) with long-tailed ID classes (imbalance ratio ) in the reference, the batch, or both. FPR is the FPR at 95% OOD TPR on the stated third of ID classes, shown as balanced long-tailed.
| Setting | AUROC: / Mahalanobis++ / NN | FPR measured on | FPR | FPR Mahalanobis++ | FPR NN |
|---|---|---|---|---|---|
| Balanced | 0.931 / 0.828 / 0.801 | ||||
| Same long tail in ref & batch | 0.943 / 0.861 / 0.843 | rarest third (8 CIFAR configurations) | 0.287 0.381 | 0.631 0.845 | 0.599 0.819 |
| Long tail in reference only | 0.876 / 0.774 / 0.721 | rarest third in the reference | 0.302 0.527 | 0.515 0.761 | 0.558 0.812 |
| Long tail in batch only | 0.872 / 0.831 / 0.806 | most frequent third in the batch | 0.296 0.463 | 0.504 0.500 | 0.549 0.541 |
The same-long-tail FPR is over the 8 CIFAR configurations; at the rarest ImageNet-1K classes have no batch samples.
- Long tail in reference only: As the reviewer expected, flags classes that are rare in the reference more often (rare-class FPR ). Mahalanobis++ and NN degrade in the same way.
- Long tail in batch only: is the only detector whose FPR on the frequent classes rises (); on the ten ImageNet-1K configurations it is above Mahalanobis++ ( vs. ).
W2: The advantage of using population-level information for individual-level detection needs clearer justification. [...] Why should maximizing a batch–reference contrast produce reliable individual rankings? The paper [...] does not establish conditions under which population-level evidence translates into accurate sample-level detection.
The link from population-level deflection to individual-level ranking rests on two steps:
- Unrestricted optimum: Under , the posterior probability is strictly increasing in the density ratio (Eq. (2)). Without degree restrictions, maximizing deflection recovers up to scale (Sec. 3.3.1), which yields the Bayes-optimal individual ranking.
- Finite-degree projection : Because ROC depends only on score ordering, preserves the Bayes-optimal ranking whenever it is a strictly increasing function of . This holds when (Theorem 1(ii)), as well as for Gaussian mean shifts () and subspace covariance shifts (), where and match the Neyman–Pearson AUROC on synthetic data ( and ; App. D.8).
Outside these cases, ranking degrades with the residual of orthogonal to : positive deflection guarantees that OOD points receive a higher average score than ID points, though not pointwise ordering (counterexample in App. B.4). We added a summary of this argument right after Theorem 1.
Thank you for the detailed response, which has addressed most of my concerns. I will therefore maintain my positive rating of 3.
- Rating
- 2/4
- Confidence
- 4/4
- Soundness
- 1/3
- Presentation
- 3/3
- Informativeness
- 2/3
Read review
Summary
The authors investigates OOD detection based on an unlabelled test batch and design a polunomial approximation to the batch-to-reference desntiy ratios. They disign a practical implementation by leveraging the gap between the first and second moment uder a gaussian-based model.
Strengths
-
this paper is well written.
-
figures are informative.
-
experiemnts are conducted on a wide range of backbones
-
the motivation of this paper is appealing.
Weaknesses
-
While I agree that whitening can fix first and second moments; it can not necessarily make the third- and fourth-moment identities be the Gaussian polynomial Gram matrix. This makes eq. (13) theorectically unjustified, since it would differ from deflection-optimal quadratic readout for the reference distribution.
-
The authors only compare their method with a limited number of baselines, not to mentioning that the selected baselines are out-dataed. Why the authors only use SVHN and C10(C100) as OOD datasets for evaluating performance on C100 (C10) as ID datasets.
-
Just as explcitly acknowledged in Remark 1, the key results in this paper largely results from classical likelihood-ratio optimality, projection arguments, and Hermite expansions. It is unclear regarding the novelty of this paper.
-
The use of to explain practical viability of different degrees is theorectically under-supported.
Questions for the authors
see weakness.
1 comment
We thank the reviewer for the positive assessment of our paper's writing, figures, motivation, and backbone coverage, as well as the thoughtful questions below.
W1: While I agree that whitening can fix first and second moments; it can not necessarily make the third- and fourth-moment identities be the Gaussian polynomial Gram matrix. This makes eq. (13) theorectically unjustified, since it would differ from deflection-optimal quadratic readout for the reference distribution.
We agree that whitening does not make Gaussian (App. A.3). For a general whitened , the deflection-optimal quadratic readout uses a Gram matrix containing the third and fourth moments of , whereas in Eq. (13) uses the identity Gram matrix of the Gaussian basis. Thus, is a plug-in Gram surrogate for that avoids estimating noisy fourth-order reference moments in dimensions while retaining two key properties:
- Same detection support: Both and are driven by the same contrast vector and vanish under the exact same condition (). Whenever achieves positive deflection, does as well (Eq. (12)).
- Comparable finite-sample AUROC: A quadratic least-squares fit with the empirical reference Gram matrix and a ridge selected on held-out data yields a near-OOD AUROC of , compared to for (cross-fitted, 8 near-OOD configurations of Table 1). Weaker regularization, which is closer to , does not improve on ( to ; App. D.6).
We now state this surrogate interpretation explicitly in Sec. 3.3.2 and App. B.3; the empirical comparison is in Sec. 4.3 and App. D.6.
W2: The authors only compare their method with a limited number of baselines, not to mentioning that the selected baselines are out-dataed. Why the authors only use SVHN and C10(C100) as OOD datasets for evaluating performance on C100 (C10) as ID datasets.
The main comparison is run on the full OpenOOD v1.5 benchmark (44 configurations), covering CIFAR-10, CIFAR-100, ImageNet-200, and ImageNet-1K as ID datasets and all standard near- and far-OOD datasets (TinyImageNet, MNIST, Textures, Places365, SSB-hard, NINCO, iNaturalist, OpenImage-O), alongside recent baselines (Mahalanobis++, 2025) and test-time methods (RTL++, 2024; OODD, 2025; and the newly added POT, 2025, and AdaODD, 2026). In the submitted version, Table 1 showed a subset for space reasons and the full grid was summarized in the appendix. Across all 44 configurations, has mean AUROC on all OOD and on near-OOD, the highest among the methods that use no ID labels ( and for DDE, the next best). POT, which uses ID class labels at detection time, is slightly above on both ( and ), within one standard deviation, and also on far-OOD ( vs. ) and in FPR@95 ( vs. ; App. D.3).
We updated Sec. 4.1 and the Table 1 caption to highlight the full benchmark scope upfront, added a summary of all 16 methods in Table 2, and added complete per-configuration tables in App. D.3.
W3: Just as explcitly acknowledged in Remark 1, the key results in this paper largely results from classical likelihood-ratio optimality, projection arguments, and Hermite expansions. It is unclear regarding the novelty of this paper.
We agree that the mathematical building blocks are classical, and we do not claim a new optimality theorem. Our contribution lies in formulating label-free batch OOD detection through finite-degree density-ratio projections, yielding two new findings for OOD detection:
- A tuning-free closed-form detector (): Projecting onto degree-2 polynomials gives a closed-form readout requiring no hyperparameter tuning or iterative optimization.
- Where the near-OOD signal lives: Decomposing reveals that the near-OOD gain in evaluated encoders comes specifically from directional (traceless) covariance shifts (), rather than mean shifts or isotropic variance changes (Tables 3–4).
We revised Sec. 1 and Sec. 2 to state these points clearly.
W4: The use of to explain practical viability of different degrees is theorectically under-supported.
We agree that is a heuristic scaling rule rather than a formal sample-complexity bound (noted in Sec. 3.3.3 and App. B.5), used only as an intuitive scale for the degrees of freedom in a degree- shell. Empirically, fitted scaling exponents on synthetic data are for (App. D.8), and on real benchmarks (), where , the centered degree-3 readout improves on in only 1 of 18 configurations, by less than the seed variation (App. D.8).
Comments on the paper
1 comment
General Response
We thank the reviewers for their constructive feedback. Revisions in the manuscript are highlighted in blue (minor notation cleanups are left in black). Below is a summary of the main updates:
- OpenOOD v1.5 preprocessing (Sec. 4, Table 1, App. D.1, D.3): Re-extracted all features with the exact OpenOOD v1.5 test pipeline and recomputed all results; the main conclusions are unchanged. Stated the full 44-configuration scope upfront in Sec. 4.1 and the Table 1 caption.
- Non-Gaussian reference (Sec. 3.3.2, App. B.3): Stated that is a Gram surrogate for the deflection-optimal quadratic readout when the whitened reference is non-Gaussian, and how the two are related.
- Baselines and reporting (Sec. 4.2, Tables 1–3, App. D.2, D.3): Added POT and AdaODD, a summary of all 16 methods on the full grid (Table 2), seed standard deviations (Tables 1 and 3), and per-configuration tables (App. D.3). Among the methods that use no ID labels, has the highest mean AUROC (; next best DDE, ). POT, which uses ID class labels, is slightly above (), within one standard deviation.
- Positioning (Sec. 1, Sec. 2): Rewrote Contributions 1 and 3 and stated in Sec. 2 how our readouts differ from each line of related work.
From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.
Loading the discussion…
We thank the reviewer for the careful reading and constructive suggestions on presentation, notation, and experimental reporting.
We agree. Contribution 3 in Sec. 1 is now titled "A decomposition of g2 that locates its near-OOD gain" and states the finding as a result of analyzing g2. It no longer uses the term "covariance directions". It instead describes the directions along which the batch covariance departs from the reference, which correspond to the directional term of Eq. (13), the term used throughout Sec. 4.3 (Tables 3–4, Figure 4).
We updated Sec. 4.1 to state explicitly that: (1) the feature vector z=ϕ(x)∈Rd is the encoder's CLS token (d=768 for ViT-B/16, d=384 for DINOv2), and (2) each evaluation batch follows Eq. (1) by combining (1−π)n ID test samples from p with πn OOD samples from a (App. A.2).
We rewrote the opening of Sec. 3.3.2 so that reference whitening and the orthogonality of the degree-1 and degree-2 Hermite shells are explained in the main text before referring to App. B.3.
We fixed all of these notations:
We rewrote Contribution 1 in Sec. 1 to clarify what the two-axis formulation brings (linking batch OOD scoring to restricted polynomial readouts and separating batch detection from sample ranking). We keep Contributions 2 and 3 separate because Contribution 2 is methodological (the closed-form detector g2 with O(d2) streaming updates and leave-one-out scoring), whereas Contribution 3 is an empirical finding about representations enabled by decomposing g2.
We also revised Sec. 2 to contrast our work directly with each research thread: