Revisiting Logit Distributions for Reliable Out-of-Distribution Detection
Authors: Jiachen Liang
RuiBing Hou
Minyang Hu
Hong Chang
Shiguang Shan
Xilin Chen
Venue: NeurIPS 2025 poster ()
Keywords: Out-of-Distribution Detection
Logits Analysis
Open-set Recognition
Model Reliability
Primary area: general_machine_learning
TL;DR: We introduce LogitGap, a training-free and post-hoc OOD detector that achieves state-of-the-art performance for both vision-language and vision-only models.

Abstract: Out-of-distribution (OOD) detection is critical for ensuring the reliability of deep learning models in open-world applications. While post-hoc methods are favored for their efficiency and ease of deployment, existing approaches often underexploit the rich information embedded in the model’s logits space. In this paper, we propose LogitGap, a novel post-hoc OOD detection method that explicitly exploits the relationship between the maximum logit and the remaining logits to enhance the separability between in-distribution (ID) and OOD samples. To further improve its effectiveness, we refine LogitGap by focusing on a more compact and informative subset of the logit space. Specifically, we introduce a training-free strategy that automatically identifies the most informative logits for scoring. We provide both theoretical analysis and empirical evidence to validate the effectiveness of our approach. Extensive experiments on both vision-language and vision-only models demonstrate that LogitGap consistently achieves state-of-the-art performance across diverse OOD detection scenarios and benchmarks.

Revisiting Logit Distributions for Reliable Out-of-Distribution Detection
Jiachen Liang"
Ruibing Hou
Minyang Hul
Hong Chang 1.2
Shiguang Shan
Xilin Chen
State Key Laboratory of Al Safety, Institute of Computing Technology, CAS, China 2 University of Chinese Academy of Sciences (CAS), China
(jiachen.liang. minyang.hu| @vipl.cct.cccnn, (houruibing, changhong, sgshan, xlchen) @ict.ac.cn
Abstract
Out-of-distribution (OOD) detection is critical for ensuring the reliability of deep learning models in open-world applications. While post-hoc methods are favored for their efficiency and ease of deployment, existing approaches often underexploit the rich information embedded in the model's logits space. In this paper, we pro- pose LogitGap, a novel post-hoc OOD detection method that explicitly exploits the relationship between the maximum logit and the remaining logits to enhance the separability between in-distribution (ID) and OOD samples. To further improve its effectiveness, we refine LogitGap by focusing subset the logit space. Specifically, we introduce a training-free strategy that automatically identifies the most informative logits for scoring. We provide both theoretical analysis and empirical evidence to validate the effectiveness of our approach. Extensive experiments on both vision vision-language and vision-only mod- els demonstrate that LogitGap consistently achieves state-of-the-an performance across diverse OOD detection scenarios and benchmarks. Code available https:// // / thub. com Himm/ITT-LJ -ICT----LLLLo Latlc//Loittaapp
more compact and informative
Introduction
Deep learning models have demonstrated remarkable success across various computer vision tasks, typically under the closed-set assumption. However, this assumption often fails to hold in real-world applications such as autonomous driving, medical imaging, and access control systems. In open-world world scenarios, deployed models are inevitably exposed to out-of-distribution (OOD) samples, which can result in unreliable predictions, thereby introducing significant risks to the safety and reliability of the system. To mitigate these risks, OOD detection has been proposed to detect and reject such OOD inputs before making decisions.
In recent years, the post-hoc OOD detection methods have attracted significant attention. These methods directly operate on pre-trained models without modifying their parameters [30, 14, 59, 25, 29, 45, 17], offering high deployment flexibility and computational efficiency. A core problem for the post-hoc methods is how design scoring function that effectively maximize the separability between ID and OOD samples. Two representative scoring functions are Maximum Logit (MaxLogit) [14] and Maximum Concept Matching (MCM²(33) MaxLogit simply uses the largest logit value as the OOD score, which completely disregards information from the remaining logits. In contrast,
"Corresponding author
"Although MCM [33] and Max Softmax Prohablity (MSP [17]) target different objectives, their methods for computing OOD scores are equivalent. Hence, we analyze only one in detail.
39th Conference on Neural Information Processing Systems (NcurIPS 2025).

---

(a) MaxLogit
(b) MCM
(c) LogitGap
Figure 1: OOD distributions for ID and OOD samples across scoring functions. The x-axis shows predicted class indices. Dots represent mean scores per class; vertical lines indicate score ranges. Gray shading marks overlap regions of ID) and OOD scores. Results are reported using CLIP ViT-B/16 model on ImageNet-20 (ID) and ImageNet-10 (OOD).
MCM applies softmax function into the logits and then takes the maximum softmax probability as the OOD score. By applying a softmax function, MCM significantly reducing the overlap between the score distributions of ID and OOD samples (Figure 1). However, the softmax function used in MCM ignores the absolute magnitudes of original logits, resulting in information loss. Consequently, different logit patterns may collapse into similar probability distributions, limiting the effectiveness of OOD detection. A natural question arises: How can we more effectively leverage the discriminative information embedded in non-maximum logits to enhance ID>OOD separability?
To answer the above question, we first systematically examine the logit distributions of and OOD samples. We observe a consistent phenomenon: the relationship between the maximum logit and the remaining logits displays fundamentally different characteristics for ID and OOD data. As shown in Figure 2. ID samples generally have higher maximum logits accompanied by lower non-maximum logits compared to OOD samples. This results pronounced "logit gap". defined as the numerical difference between the maximum and the remaining logits, which is consistently and significantly larger for ID samples than for OOD samples. This observed pattern suggests that the relative logit gap naturally serve discriminative criteria for effective OOD detection.
Motivated by this observation, we propose LogitGap, novel post-hoc OOD detection approach that effectively leverages the logit-gap to distinguish between II) and OOD samples. By explicitly leveraging the entire logit space, our proposed method significantly enhances the separability between ID and OOD samples (as shown in Figure 1). To further improve its effectivvness, we refine LogitGap by focusing on a more compact and informative subset of the logit space. This improvement is inspired by our empirical observation: the tail region (logits from least likely classes) exhibits substantial overlap between ID and OOD samples, which brings irrelevant and noisy signal. To mitigate this issue, we constrain LogitGap's computation to the top-N logits, naturally excluding the noisy tail logits from the OOD score. To balance information retention (larger NN and noise suppression (smaller N), propose simple yet effective strategy for selecting N: choose the value that maximizes the difference between the mean top-N logits of ID and OOD samples, using only a small number of ID samples.
conduct experiments across diverse OOD scenarios to evaluate the effectiveness of our LogitGap method. Results show that LogitGap outperforms existing OOD scoring functions in both zero-shot and few-shot OOD detection tasks based on the CLIP model. Furthermore, when combined with training-based OOD detection methods, LogitGap brings notable performance gains, highlighting its complementary nature. To assess the generality of our approach, we also evaluate it under traditional OOD settings, where models are trained from scratch using cross-entropy loss on ID data. Across all scenarios, LogitGap consistently achieves significant performance gains, validating its versatility and robustness in various OOD detection scenarios.
Our main contributions can be summarized as follows:
We propose a novel post-hoc OOD detection method for a pre- are-trained model, which leverages the information from entire logit space to enhance ID-OOD separability.
We analyze the limitations of existing OOD scoring methods and theoretically derive their relationship to our LogitGap method.
We conduct experiments to demonstrate the versatility and effectiveness of proposed Logit- Gap method in various OOD scenarios.

---

2 Related Work
OOD Detection for Models Trained with Cross-Entropy Loss. OOD detection for classification models trained with cross-entropy loss typically falls into two categories. The first involves training- time strategies that endow models with OOD awareness, often requiring access to training data
[20, 11, 18]. For example, VOS [11] synthesizes virtual outliers, LogitNorm [52] applies logit normalization, and MOS [22] partitions the class space hierarchically. Other approaches leverage auxiliary OOD samples, including OE [18], which encourages flat predictions, MCD [56], which amplifies entropy discrepancies, UDG [53], which clusters out mixed ID data, and MixOE [57]. which mixes ID and OOD data to expand coverage. A key challenge for these methods lies in selecting appropriate auxiliary data while mitigating the risk of overfitting. Another major line of work focuses on post-hoc methods, which are training-free and computationally efficient. These approaches can be broadly categorized into oogits-based and feature- based methods. Logits- bbaeed approaches derive OOD scores from model outputs, such as MaxLogit [14], ODIN [27], Energy [30], GradNorm [21], and MaxCosine [59]. In contrast, beasure-based methods analyze internal representations, including Mahalanobis [25], KNN [45], FDBD [28], ViM [50].
OOD Detection for Contrastive Learning Pretrained Models. For contrastive learning models, MCM [33] extends MSP [17] to vision-languee models, while GL-MCM [35] incorporates local feature cues to enhance detection performance. Recent works have increasingly focused on teaching models to recognize "what an input is not". For example, CLIPN [51] fine-tunes CLIP to generate negative prompts corresponding to absent concepts. With the rise of prompt engineering, many approaches improve OOD detection by fine-tuning prompts with few ID samples. For example, LoCoOp [34] builds on CoOp's 's [62] by applying OOD regularization through local OOD features. Approaches such as LSN [37] and NegPrompt jointly learn positive and negative prompts to better capture OOD characteristics. ID-like [1] introduces prompts aligned with ID-like regions near the OOD boundary to refine detection through targeted fine-tuning. Additionally, some Caaed approaches leverage external concept vocabularies [23, 4] or language models [3] to map OOD) samples to auxiliary semantic categories. but such methods are generally constrained to semantic- shift scenarios. While CLiP-based OOD detection methods have demonstrated strong performance, most depend on additional data or external models, limiting their scalability and general applicability. In this work, we propose lightweight, post-hoc OOD method for pre-trained models, which does not require additional supervision.
Preliminary
3.1 Problem Setting
We study the zero-shot and few-shot OOD detection problem with a pre-trained model f. Let Vin denote the set of known classes (in-distribution, ID) for a given classification task. Given a test sample a drawn from the input space X, if its true label y & Vin. then æ is considered as an OOD sample. The goal of zero-shot OOD detection is to identify samples that do not belong to any of known ID classes, without requiring additional training or exposure to OOD data during model development. Similarly, few-shot OOD detection aims to achieve the same goal, but with access to small number of training samples from the ID class set Vin.
Formally, in the zero-shot and few-shot OOD problem, the decision function D X + (ID, OOD) is typically constructed as:
ID, D (z) = OOD, if S <
(a;
where S X' + IR is a scoring function based on pre-trained model f. which assigns a scalar confidence score to each input sample. The decision threshold À establishes the decision boundary: samples satisfying S (x) < À are identified as OOD, while those with S (z) À are considered ID.
3.2 OOD Detection Scoring Function
The design of the scoring function crucial, as it directly determines the effectiveness of OOD detection. In this subsection, we revisit the design principles of existing logit-based scoring functions,
3

---

with a focus on two representative upproaches: Maximum Logit (MaxLogit) [14] and Maximum Concept Matching (MCM) [33]. The most straightforward approach, MaxLogit [14], uses the maximum logit value as the confidence score. Formally, given K known classes (i.e., [Diml = K),
for an input sample æ, the pre-trained model produces a logit vector as 2 (a:; Ven) E RRK The OOD score by MaxLogit is then calculated as:
MaaxLogit (æ;; J) max =k:
(2)
where Zi denotes the predicted logit for class k. However, MaxLogit focus solely on the most confident prediction, disregarding potentially useful information from other classes. A more widely used scoring function is MCM [33], which applies softmax normalization to the logits and takes the maximum probability the OOD score:
ea/T
SMOM (z; = max
(3)
ΣX e5/T
where r is a temperature scaling parameter. Unlike MaxLogit, MCM leverages the full logit distribu- tion through the denominator of the softmax operation. As result, MCM generally achieves superior separability between ID and OOD samples compared to MaxLogit.
4
Method
4.1 OOD score: LogitGap
We observe an interesting phenomenon in real-world data: While the mean logit values of ID and OOD samples are often similar, their logit distributions exhibit systematically distinct patterns, shown in Figure Specifically, ID samples (red line in Figure 2) tend to produce sharper, more peaked logit distributions, typically with one dominant logit value corre- sponding to the predicted class. In contrast, OOD samples often yield flatter, more uniform logit distributions, with less pronounced maxima and elevated non- mox-mmm logits. This is quantitatively reflected as: (i) Higher maximum logit values for ID samples compared to OOD samples; (ii) Higher non-predicted class logits in OOD samples relative to ID samples.
201
260
Figure 2: Descending-sorted logits on CLIP ViT-B/16 with ImageNet100 (ID) and iNaturalist (OOD).
Building upon these observations, we propose simple yet effective OOD scoring function, call LogitGap, which exploits the inherent distributional differences between ID and OOD logits. The core idea is to quantify the average gap between the maximum logit and the remaining logits tattss-ass measure that naturally amplifies the contrast between ID and OOD samples. This formulation effectively captures the distinctive peakedness ID logit predictions, while highlighting the relative flatness of OOD logit distributions, thereby enhancing ID-OOD separability.
Formally, given logit vector predicted for test sample æ, we first sort its elements in descending order to obtain xz, where z denotes the n-th largest logit. The LogitGap score is then defined as:
SLogitGap (z; f)
1
Σ
(2 21)
The main difference between MCM [33] and our proposed LogitGap lies in how they utilize non- maximum class information. MCM implicitly incorporates this information through the normalization process in the softmax denominator, while LogitGap explicitly quantifies the average gap between the maximum logit and all other logits. This explicit formulation allows for more direct utilization of the discriminative patterns observed in logit distributions. To establish a theoretical connection between MCM and LogitGap, we present the following analysis.
Theorem 4.1. Given a K K-way classification task, let the predicted logit vector for sample a be [21, ......, 2g]. Let z' [24, 22..., ... 2xg] denote the sorted logits in descending order, such

---

that 2f maxk Then, for the temperature scaling parameter used in the softmax function, if T > 2(K 1), we have
Gap (AL) S FPRMCM (T, AMCM)
where FPRLogiGap (At) the false positive rate based on LogitGap with threshold X Similarly, FPR (T, AMCM) is the false positive rate based on MCM with temperature and threshold AисM-
For clarity, we provide a brief proof sketch below (complete proof provided in Appendix A).
proof sketch. False Positive Rate (FPR) measures the likelihood of an ID sample being misclassified as OOD. lower FPR indicates better OOD detection performance. Let Q₂ denotes the out-of- distribution PaOOOD- By definition, we express the FPR of MCM, denoted as FPRMCM(T, AMCM). in the following:
ehit
FPRMCM AMCM) Qx
AMCM
(5)
Σ
2===
Similarly, the FPR of LogitGap can be written as
E (3 KK
2/7)
A
F PPPooggtGap (T, Ar.) = Qa
(6)
By introducing intermediate OOD score function, LogitGap with softmax Kogittappsoftmaxx we establish connection between MCM and LogitGap. We define it as Maggitap_softtman (a:; f)
1E -//1 Accordingly, we express the FPR of LogitGap_softtax softmax as
KEK
[E -eily ALM)
softmmx FP PPRLogt Gap softuma (T, \LM) Q
K KE=ze E3/T
where AMCM ALM K
Then, we aim to demonstrate the performance of LogitGap is guaranteed to surpass that of MCM, which is equal to finding the conditions under which the inequality holds: FPR PaogttGap (T, λr.) < FPRMMM (r, AMCM). By combining the results from (5) (q) we can derive that the inequality holds with the condition of 2(K- - 1).
Theorem 4.1 demonstrates that when the temperature scaling parameter exceeds certain threshold, the OOD detection performance of LogitGap is guaranteed to surpass that of MCM [33]. This result stems from fundamental differences in how the two methods process logit information: (i) Information Preservation. MCM operates on boftmax-normalizae
probabilities, which inherently compress logit magnitudes. Differently, LogitGap directly exploits the logit margins, preserving richer discriminative cues. (ii) Temperature Sensitivity. The performance gap increases with higher 7: for MCM: higher temperatures exacerbate information loss by overly dispersing the probability mass; For LogitGap, the margin-based formulation remains robust regardless of T.
4.2 Logits Selection for Focused Scoring
While LogitGap utilize the complete set of K predicted logits, we identify critical limitation in K-way classification: certain classes consistently yield negligible activations, particularly those that semantically or visually unrelated to the input. These inactive logits provide limited discriminative information and thus contribute little to OOD detection. The issue becomes more pronounced as K increases, since larger proportion of irrelevant logits is introduced. These irrelevant logits add noise, reducing the clarity of the distributional differences between ID and OOD samples.
By eliminating redundant tail information, the structural differences between ID and OOD prediction distributions become more pronounced and easier to exploit. To achieve this, we propose narrowing the focus to more compact and informative subset of the logit space. Formally, we sort the predicted
5

---

logits in descending order and select the top N (out of K) logits, resulting in reduced prediction vector. We then upply the LogitGap scoring function to this truncated logit vector
topp (æ:
Σ (=i-z) 1=2
(8)
N
How to Determine the Hyperparameter N. The effectiveness of LogitGap largely depends on the choice of the hyperparameter N, which controls the number of top logits retained for OOD scoring. An appropriate selection of N strikes a balance between capturing informative signals and avoiding noisy, uninformative logits. Formally, given the sorted logits z', the LogitGap-topN score can be equivalently reformulated as:
SLogUtGap-topN (æ:
1 N- N-1
1 N N
1
N
N
where øyy denotes the mean of the logits ranked from second to the N-th largest. Then, for OOD samples drawn from POOD (ax) and ID samples drawn from PID (æ:), our objective to identify the optimal value of N that maximizes the score discrepancy between them. This can be expressed as:
arg max PEn Gapp (a:) Ea-Poon GapogitGap-topN (a:)
arg max (Po [2] E'y] POwD [2] xxl)
N
= arg max (E [<1] POn-PoD [=1] + Bo PooD [=N]] Em PID (=x))
N
arg max (E
[xv] EI-PIo [zw)),,
(10)
Equation (10) provides criterion for selecting the hyperparameter N. However, in practical scenarios, it is often challenging to obtain authentic OOD samples. To address this, assume access to small ID validation set (containing no more than 100 samples) and simulate potential OOD data by applying interpolation-but based transformations to the ID features and injecting random noise. Based on these synthesized samples, we can estimate an appropriate value for N through Equation (10).
Experiments
5.1
Experimental Settings
Datasets. We evaluate the effectiveness of LogitGap across multiple OOD detection benchmarks.
Specifically, we use ImageNet [7] or ImageNet- 100 as ID datasets, while NINCO [2], ImageNet-OOD [55], and ImageNer-O) [19] are used as OOD datasets. Each OOD dataset contains categories that disjoint from those in the corresponding ID dataset. Following MCM [33], we also construct more challenging OOD detection task by alternately using ImageNet- 10 and ImageNet-20 as the ID and OOD datasets. This setting leverages semantic similarity within the label space to increase task difficulty, providing a more rigorous evaluation of OOD separability.
Comparison Methods. We adopt CLIP [39] with VIT-B/16 [10] backbone as the pre-trained model for shot OOD detection. Our evaluation encompasses both zero-shot and few-shot settings. For the few-shot OOD detection setting, randomly select one (one-shot) or four (four- shot) samples from each ID class and use these limited samples to fine-tune CLIP. To provide a comprehensive comparison, we benchmark against several representative post-hoc OOD detection methods, including MCM [33]. MaxLogit [14], Energy [30] and GL-MCM [35], as well as an evaluate two few-shot OOD approaches: CoOp [62] and ID-Like [1]. Specifically, CoOp [62] fine-tunes prompts using limited labeled samples, serving as simple few-shot baseline. ID-Like [1] jointly optimizes ID-like prompts and synthesizes outliers from semantically related ID data, thereby improving detection of semantically similar OOD samples. We compare these methods against two variants of our approach: LogitGap, which uses fixed value of set to 20% of the total number of classes, and LogitGap*, where is adaptively determined using ID validation set along with synthetic OOD data.
enhancing method TAG [31]. Additionally,
Evaluation Metrics. We use three standard metrics commonly used in OOD detection literature: (1) False Positive Rate (FPR95): Measures the probability that an OOD sample is misclassified as ID

---

Table 1: OOD Detection performance CLIP ViT-B/16 under zero-shot and few-shot settings. Results
reported with ImageNet as the ID dataset in semantic shift scenario.
OOD Dataset
AVG
NINCO
ImageNet-O
ImageNetOOD
Method
FPR95 AUROC
HPR95 AUROCT
AUPR
+. AUROC
HPRU5
AUROCT AUPR 1
Zero shal
Energy [30]
84.11
72.04
95.65
81.60
75.58
98.66
79.12
76.77
83.96
81.61
74.8
92.76
+TAG [31]
83.11
71.15
95 95.46
79.65
77.10
98.79
78.34
78.03
85.81
80.37
75.43
93.35
[33]
73.59
75.85
78.33
78.83
+TAG [31]
81.63
71.33
95.41
77.60
79.95
98.97
82.99
78.79
86.42
80.74
76.69
93.6
MaxLogit [14]
79.41
74.35
96.03
77.15
77.85
98.79
75.85
78.67
85.16
77.47
76.96
93.33
+TAG [31]
77.70
73.92
95.95
74,50
79.48
98.92
75.17
80.07
87.01
75.79
77.82
93.96
GL-MCM
74.38
76.03
96.26
72.35
79.50
98.88
79.16
77.31
83.67
75.30
74.74
86.23
LogitGap
76.83
76.43
96.37
72.35
81.32
99.03
76.37
79.95
86.06
75.18
79.23
93.82
LogitGap*
77.42
76.51
96.38
71.95
81.45
99.03
75.40
80.27
86.21
74.92
79.41
93.87
One-shot
CoOp [62]
84.01
68.83
94.91
75.55
78.63
98.84
82.25
76.88
84.20
80.60
74.78
92.65
+LLogitGap*
82.85
73.57
95.91
74.85
79.40
98,88
78.31
78.09
84.55
78.67
77.02
93.11
ID-Like [1]
73.02
75.83
95 86
80.95
69.81
98.09
83.23
68.57
75.22
79.07
71.40
89.72
+LogitGap*
68.78
80.90
71.20
82.40
Four
CoDp [62]
81.46
70.16
95.14
75.40
79.80
98.93
80.40
78.56
85.56
79.09
16
93.21
+LogitGap*
80.69
73.97
95.95
72.70
81.10
99.01
76.07
80.16
86.42
76.49
78.41
93.79
ID-Like [1]
71.79
95.01
82.50
97.92
62.40
70.25
+LogitCupp*
77.51
75.39
95.91
78.10
75.29
98.57
82.65
72.88
79.85
79.42
74.52
91.44
when the true positive rate of ID samples fixed at 95%. (2) Area Under the Receiver Operating Characteristic Curve (AUROC), and (3) Area Under the DoccisionRRecall Curve (AUPR).
5.2 Results
Zero-Shot OOD Detection. We first conduct comprehensive evaluation of various methods in the zero-shot OOD detection setting. Our experimental setup utilizes ImageNet and ImageNet- 100 as ID) datasets, comparing multiple OOD scoring functions against our proposed LogitGap approach. As shown in Table and Table 2, both LogitGap and its adaptive variant LogitGap* achieve superior performance compared to existing methods. Specifically, on ImageNet as ID dataset, LogitGap reduces FPR95 by 3.65% compared to MCM [33]. On ImageNet- 100, the improvement reaches 5.78% These significant performance gains highlight the effectiveness of our logit-gap based scoring approach. Furthermore, LogitGap* typically provides additional improvements over the fixed- perrmeereeterr LogitGap. validating the advantage of our adaptive parameter selection strategy
Few-Shot OOD Detection. further investigate the integration of LogitGap with several recent few-shot OOD detection approaches, including CoOp [62] and ID>-Like [1]. Specifically, CoOp [62] enhances in-distribution classification by prompt tuning, and ID-L.ike [1] extends this framework by incorporating negative prompts to enhance OOD detection. Following [1], we conduct rigorous experiments under both one-shot and four-shot finetuning configurations. The results are summarized in Table 1 and Table 2. As shown, LogitGap* consistently enhances the performance of both baseline methods across all evaluation metrics. For instance, using ImageNet as ID dataset, integrating LogitGap with ID-Like [1] improves FPR95 and AUROC by 7.39% and 7.08% under the 1-shot setting, respectively (Table 1). These significant performance gains demonstrate that LogitGap can serve effective complementary module to existing OOD detection frameworks, effectively amplifying their OOD detection capabilities.
Hard OOD Detection. To thoroughly evaluate the robustness of LogitGap, we further conduct specialized experiments focusing on two particularly challenging categories of hard OOD samples: Semantically Hard OOD Detection and Covariate Shifts OOD Detection.
1. Semantically Hard OOD Detection. Prior work [33] has demonstrated that OOD detection becomes particularly challenging when OOD samples exhibit semantic similarity ID data. To evaluate this difficult scenario, we adopt the experimental setup from MCM [33], alternately
IIn Table 2, the performances of LogitGap and LogitGap* are identical because the parameter search result equal to 20% of the number of categories.
7

---

Table 2: OOD Detection performance CLIP ViT-B/16 under zero-shot and few-shot settings. Results
reported with ImageNet-1006 as the ID dataset in the semantic shift scenario.
OOD Dataset ImageNet-O
AVG
NINCO
ImageNetOOD
Method FPR95
AUROC
AUROCT AUPR + AUROC
FPRU5
AUPR 1
Zero shal
Energy
52.08
88.97
88.36
54.05
95.29
51.25
89.44
68.42
52.46
89.14 14
84,02
MCM [53]
50.03
89.82
89.28
48.55
90.93
96.28
51.25
90.29
70.17
49.94
90.35
85.24
MaxLogit [14]
47.95
95.74
70.00
46.68
Logit
42.62
91.08
90.55
43.65
92,02
96.74
46.21
91.21
71.59
44.16
91.44
86.29
LogitGap*
42.62
91.08
90.55
43.65
92.02
96.74
46.21
91.21
71.59
44.16
91.44
86.29
One-shot
CoOp
89,30
52.85
95.55
87.06
60.96
57.89
88.66
+LogitCupp*
51.28
90.64
90.87
50.75
90.32
95.93
60.57
87.77
62.12
54,20
89.58
82.97
ID-Like [1]
58.56
85.76
83.65
61.80
84.34
92.36
75.00
79.93
44.65
65.12
83.34
73.55
+LogitCapp* 39.93
91.44
90.70
40.25
90.65
95.48
45.73
89,89
66.06
41.97
90.66
84.08
Four-shot
CoOp [621
60.43
83.49
83.68
51.15
90.05
95.81
59.56
88.39
64.25
57.05
87.98
81.25
+LogitGapp*
$2.84
87.67
86.02
47.05
91.14
96.30
53.49
89.72
66.91
51.13
89.51
83.08
ID-Like [1]
46.65
90.74
90.14
58.25
86.51
93.84
71.82
81 22
47.06
58.91
86.16
77.01
+ap 31.81
93.44
92.92
44.80
90.44
95.72
54.68
88.57
65.50
43.76
90.82
84.71
Table 3: OOD Detection performance CLIP ViT-B/16 in the semantically hard scenario. ImageNet-20": ImageNet-10 IDD and ImageNet-20 OOD.
"ImageNet-10
ImugeNett- Net-22
ImageNNet221 20 ImugeNet-
Method
FPR95 1
AUROC
AUPR
FPR95 1
AUROC
AUPR
Energy [30]
8.70
98.45
97.41
20.80
96.72
98.58
MCM [33]
MaxLogit [14]
8.40
98.54
97.55
20.20
97.25
98.79
LogitGap
3.80
99.05
98.52
14.00
98.14
99.15
LogitGup*
3,00
99.10
98.60
14.20
98.15
99.15
using ImageNet-Iee 10 and ImageNet-20 as ID and OOD datasets. As shown in Table 3, LogitGap demonstrates superior performance across all evaluation metrics compared existing methods. Specifically, when detecting ImageNet-20 as OOD against ImageNet- 10 ID, LogitGap reduces FPR95 by 3.40% compared to MCM [33]. In the reverse configuration (ImageNet-20 ImageNet- 10 as OOD), the improvement reaches 8.40%. These significant margins highlight LogitGap's enhanced capability distinguish semantically related distributions, addressing key challenge in real-world OOD detection scenarios.
vs.
2. Covariate Shifts OOD Detection. While CLIP exhibits strong generalization, its performance degrades significantly under covariate shifts. For instance, fine-tuning CLIP ImageNet leads to notable drops on covariate-shifted variants like ImageNet-Sketdd [49] and ImageNet-A [19], where the visual appearance of test samples significantly differs from that of ImageNet [62]. To assess LogitGap under hard OOD conditions, we consider a covariate shift setting. Specifically, construct ID data using limited samples (one-shot or four-shot) from ImageNet, while treating ImageNet-R R [16], ImageNet-A. A, and ImageNet-Sken Sketch as OOD datasets. LogitGap is integrated into several recent sew-shot OOD detection methods. The results are summarized Table
From Table 4, we observe that: (1) Increasing ID training samples does not consistently enhance OOD detection performance in some few-shot OOD methods. For instance, ID-like [1] shows higher FPR95 in 4-shot versus 1-shot training. We hypothesize that this phenomenon arises from the strong generalization capability of fine-tuned CL.P models: while aiding IDD classification, it may also lead to overconfident prediction, thereby misclassifying OOD samples as incorrect ID classes and ultimately impairing OOD detection. (2) The proposed LogitGap method consistently enhances OOD detection performance across various covariate shift scenarios and different few- shot OOD methods. For instance, LogitGap reduces FPR95 by 2.20% (1 (hoth and 1.17% (4-shot) for ID-Like [1], underscoring its effectiveness under varying few-shot conditions.

---

Table 4: OOD Detection performance CLIP ViT-B/16 under few-shot setting. Results reported with
ImageNet as dataset the covariate shift scenario.
OOD Dataset ImageNet-A
AVG
ImageNett R
ImageNet Sketch
Method
FPR95 AUROCT
FPRUS AUROC AUPR
+ AUROC
FPR95 AUROCT AUPR f
One shot
CoOp
80.18
72.44
91.54
77.75
77.40
95.65
85.53
67.21
67.06
81.15
72.35
84.75
+LogitGap*
79.97
71.14
90.81
75.72
79.77
96.25
82.81
68.37
67.00
79.50
73.09
84.09
LD-Lake []]
75.51
92.61
45.67
75.31
75.32
79.82
+LogitGup*
76.11
77.28
93.20
43,36
89.99
98.14
77.43
76.06
76.42
65.63
81.11
89.25
Four-shot
CoOp [62]
78.38
73.53
92.02
74.87
79.20
96.06
84.68
08.54
69.06
79.31
73.76
85.71
+LogitGap* 79.59
71.94
74.20
96.45
82.68
69.23
68.9 68.91
78.82
73,93
ID-Like []]
85.69
71.93
91.39
61.27
84.80
97.06
87.07
67.45
67.47
78.01
74.73
85.31
+LogitGapp 84.45
71.16
91.03
59.13
86.31
97.44
86.95
66.80
67.47
76.84
74.76
85.31
5.3 Further Discussion
Influence of the Hyperparameter N on LogitGap Performance. We examine the impact of the hyperparameter N on the performance of the LogitGap method. We conduct experiments by utilizing ImageNet- 100 the ID dataset in the semantic shift senario. the FPR95 performance on all three OOD datasets degrades when N is either too small or too large. This trend can be attributed to the trade-off in the representation capacity of the logits space. When N is too small, the logits space is overly compact and lacks sufficient discriminative information, thereby limiting the effectiveness of LogitGap. In contrast, an excessively large N introduces substantial amount of tail information, where the distinction between ID and OOD samples becomes less pronounced. This weakens the discrim- inative signal and reduces overall performance. Importantly, we find that LogitGap exhibits relatively stable and consis- tently strong performance when N is set between 20% and 50% of the total number of classes. This observation suggests that a moderately compact logits space provides a favorable balance between retaining information and suppressing noise, N real-world OOD detection scenarios.
As illustrated in Figure
Figure 3: Variation of FPR9S perfor- mance with increasing N. Results reported on CLIP VIT-B/16 with ImageNet- 100 as the ID dataset in se- mantic shift senario.
offering robust choice for selecting
Logit Distribution Differences Between ID and OOD Data. The design of LogitGap is motivated by the obser- vation that the logit distributions of ID and OOD samples exhibit distinct patterns: ID samples tend to have higher maximum logit, whereas OOD samples display higher log- its among the non-predicted classes. To verify the gener- ality of this phenomenon, we analyze the logit distribution statistics using ImageNet as the II) dataset on CLIP ViT- L/14. Specifically, 2/ denotes the average maximum logit, while žny represents the average logit over all non non-predicted classes. As shown in Figure 4, ID samples consistently show larger zf and smaller z than OOD samples, which confirms the broad consistency of this observation.
Figure 4: Logit Statistics on VIT-L/14 with ImageNet as ID. 2 and Σ denote the aver- age maximum logit and the average logit of non-predicted classes, respectively.
Different Variants of LogitGap. Motivated by the distinct logit distribution patterns of ID and OOD samples, we design LogitGap, which subtracts the average of non maximax logits from the maximum logit. Since ID samples usually have higher maximum and lower remaining logits, this formulation effectively enhances ID-OOD separation. In addition, we introduce three variants. LogitGap_exp. DogitGap_square and LogitGap sqrr apply exponential, square, square root trans- formations, respectively, to further transform score differences. As shown in Table 5, these variants perform comparably to the original LogitGap, suggesting that different nonlinear transformations can achieve similarly effective discrimination.

---

Table S: Ablation study on different variants of LogitGap. Results reported CLIP ViT-B/16 with ImageNet as the dataset zero-shot setting.
OOD Datasel ImageNet
NINCO
ImageNelOOD
AVG
Metbod
HPR95
AUROCT AUPR 1 HPR95
AUROC 1 AUPR HPR95 4 AUROC AUPR
FPR95
AUROCT AUPR
LogiiGap
77.42
76.51
96.38
71.95
81.45
99.03
75.40
80.27
86.21
74.92
79.41
93.87
LogitGap_eyy
77.15
76.67
96.42
71.40
81.54
99.04
74.33
80.55
86.51
74.48
79.59
93.99
LogitGap_squan squurr
76.81
76,80
96.45
71.25
81.53
99.04
74.17
80.97
86.95
74.08
79.77
94,15
LogitGapp_sgg sqrtt
77.15
71.50
81.58
99.04
80.36
74.70
93.91
Table 6: OOD Detection performance on ResNet-50 using CIFAR- 10 as the ID dataset.
Near OOD
Far OOD
AVG
CIFARIOO
TIN
MNIST FPR95
SVIIN
TEXTURE
PLACES365
Method
FPR95 AUROC FPR95
AUROC
AUROC
FPR95
AUROC
FPR95 AUROC
FPR95 AUROC FPR95 1 AUROC 1
MSP
53,10
87.19
43.25
88.87
23.63
92.63
25,80
91.46
34.96
89.89
42.26
88.92
37.17
89.83
MaxLogit [14]
66.60
86.31
56.06
88.72
25.06
94.15
35.09
91.69
51.71
89.41
54.84
89.14
48.23
89.90
Energy [30]
66.59
86.36
56.08
88.8
24.99
94.32
35.15
91.78
51.84
89.47
54.86
89.25
48.25
90.00
ODIN [27]
77.04
82.18
75.32
83.55
23.81
95,24
68.61
84.58
67.74
86.94
70.35
85.07
63.81
86.26
GEN [32]
58.76
87.21
48.58
23.00
28.14
91.97
40.72
90.14
41.04
Mahalanohis [25]
52.81
83.59
47.01
84.81
27.30
90.10
25.95
91.19
27.92
92.69
47.66
84,90
38.11
87.88
ReAct [44]
67.40
85,93
59.71
33.76
92.81
50.23
89.12
51.40
89.38
44.21
90.35
51.12
89.31
SHE [58]
80.99
80.31
78.27
82.76
42.23
90.43
62.75
86.37
84.59
81.57
76.35
82.89
70.86
84.06
NCI |29]
$2.46
87.84
42.92
89.50
28.
92.08
31.70
90.67
27.59
91.97
35.65
90.36
36.54
90.40
LogitGap
49.17
88.01
39.91
89.70
22.56
93.44
25.41
92.10
33,00
90.73
39.38
89.74
34,91
90.62
OF.[18] [18]
35.84
90.81
2.50
25.89
99.69
98.01
13.48
97.14
14.90
96.92
+LogitGap
35.18
91.18
2.81
99.21
24.96
91.52
1.18
99.65
9.76
98.10
13.20
97.18
14.52
96.14
Mix0E|57]
65.58
87.01
46.79
90.13
36.89
91.79
15.56
94.48
33.40
92.00
38.87
91.18
39.52
91.10
+LogilGap
$2.30
88,22
35.34
90.81
28.04
92.26
15.54
94.46
25.80
92.45
30.38
91.53
31.23
91.62
Effectiveness on Traditional OOD Detection. To rigorously assess the generalizability of Log- itGap, we extend our evaluation to traditional OOD detection setting. Following the OpenOOD protocol [54]. we use CIFAR-10 [24] as ID dataset and adopt the standard OpenOOD benchmark splits for OOD evaluation. The OOD benchmarks include both near-OOD datasets: CIFAR- 100, Tiny ImageNet, and far-OOD datasets: MNIST [8], SVHN [36], Texture [5], and Places365 [61]. In this setup, we employ ResNet-50 [13] backbone trained from scratch ID data using cross-entropy
loss. We compare LogitGap against a comprehensive suite of baselines: (i) Logit-based post-hoc
methods: MSP [17], MaxLogit [14], ODIN [27], Energy [30], GEN [32]; (ii) Internal network
statistics-base based methods: Mahalanobis [25], ReAct [44], NCI [29], SHE [58]; (ii) triiing-based methods with auxiliary data: Outlier Exposure (OE) [18], MixOE [57].
As shown in Table 6, LogitGap consistently outperforms all baselines across benchmarks. We observe
that: (1) Compared to the logit-based method MSP [17], LogitGap reduces FPR95 by 2.26%. (2) Unlike NCI [29], which relies on the relationship between features and classifier weights, LogitGap is fully end-to-end without extra feature extraction. (3) When combined with auxiliary-dad data methods such as OE [18] and MixOE [57], LogitGap further improves their baselines - achieving a notable 8.29 8.29% FPR95 reduction MixOE. These results demonstrate the strong generalization capability of LogitGap across diverse OOD detection paradigms in the traditional setting.
6 Conclusion
In this work, we revisit the OOD detection problem from the perspective of logits space and reveal key limitations of existing logits-based scoring methods. To overcome these challenges, we propose LogitGap, simple yet effective approach that enhances ID-OOD separability by explicitly leveraging the gap between the maximum logit and the remaining logits. Furthermore, we develop a lightweight, data-efficient strategy to automatically determine the optimal subset size for scoring. Extensive experiments show that LogitGap consistently outperforms existing methods across both traditional vision architectures and pre-tree tre-trrined vision-languagg models, while maintaining ease of deployment.
Limitations and Broader Impact. While LogitGap demonstrates strong performance in visual classification tasks, its current design is primarily tailored to visual models. In future work, we plan to extend LogitGap to other modalities, such as text or speech, to enable robust OOD detection across broader range of input types.
10

---

Acknowledgments
This work is partially supported by National Science and Technology Major Project 20212D011190) and National Natural Science Foundation of China 62376259, 62576334, 62306301.
References
[1] Yichen Bai, Zongbo Han, Changqing Zhang, Bing Cao, Xiaoheng Jiang, and Qinghua Hu. Id-like prompt learning for few-shot autto--distribution detection. In CVPR, 2024.
[2] Julian Bitterwolf, Maximilian Müller, and Matthias Hein. In or out? fixing imagenet out-of- distribution detection evaluation. In ICML., 2023.
[3] Chentao Cao, Zhun Zhong, Zhanke Zhou, Yang Liu, Tongliang Liu, and Bo Han. Envisioning outlier exposure by large language models for out-of-distribution detection. In ICML., 2024.
[4] Mengyuan Chen, Junyu Gao, and Changsheng Xu. Conjugated semantic pool improves ood detection with pre-trained vision-language models. In NeurlPS, 2024.
[5] Mircea Cimpoi, Subhransu Maji, Iasonas Kokkinos, Sammy Mohamed, and Andrea Vedaldi. Describing textures the wild. In CVPR, 2014.
[6] Aron Culotta and Andrew McCallum. Reducing labeling effort for structured prediction tasks. In AAAI, 2005.
[7] Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In CVPR, 2009.
[8] Li Deng. The mnist database of handwritten digit images for machine learning research [best of the web]. IEEE signal processing magazine, 29(6):141-142. 2012.
[9] Andrija Djurisie, Nebojsa Bozanic, Arjun Ashok, and Rosanne Liu. Extremely simple activation shaping for out-of-distribution detection. In ICLR, 2023.
[10] Alexey Dosovitskiy, Lucas Beyer. Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani. Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. An image is worth 16x 16 words: Transformers for image recognition at scale. In ICLR, 2021.
[11] Xuefeng Du, Zhaoning Wang. Mu Cai, and Yixuan Li. Vos: Learning what you don't 't know by virtual outlier synthesis. In ICLR, 2022.
[12] Benjamin Elizalde, Soham Deshmukh, Mahmoud Al Ismail, and Huaming Wang. Clap learning audio concepts from natural language supervision. In ICASSP, 2023.
[13] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016.
[14] Dan Hendrycks, Steven Basart, Mantas Mazeika, Mohammadreza Mostajabi, Jacob Steinhardt, and Dawn Song. Scaling out-of-distribution detection for real-world settings. In ICML, 2022.
[15] Dan Hendrycks, Steven Basart, Mantas Mazeika, Andy Zou, Joe Kwon, Mohammadreza Mostajabi, Jacob Steinhardt, and Dawn Song. Scaling dutto--distributiin detection for real- world settings. In ICML, 2022.
[16] Dan Hendrycks, Steven Basart, Norman Mu, Saurav Kadavath, Frank Wang, Evan Dorundo, Rahul Desai, Tyler Zhu, Samyak Parajuli, Mike Guo, et al. The many faces of robustness: A critical analysis of out-of-distribution generalization. In CVPR, 2021.
[17] Dan Hendryeks and Kevin Gimpel. A baseline for detecting misclassified and out-of-distriiutiio examples neural networks. In ICLR, 2017.
[18] Dan Hendrycks, Mantas Mazeika, and Thomas Dietterich. Deep anomaly detection with outlier exposure. In ICLR, 2019.

---

[19] Dan Hendrycks, Kevin Zhao, Steven Basart, Jacob Steinhardt, and Dawn Song. Natural adversarial examples. In CVPR, 2021.
[20] Yen-Chang Hsu, Yilin Shen, Hongxia Jin, and Zsolt Kira. Generalized odin: Detecting out-of-
distribution image without learning from -fttt---iittitttionn data. In CVPR, 2020.
[21] Rui Huang, Andrew Geng, and Yixuan Li. On the importance of gradients for detecting distributional shifts in the wild. In NeurIPS, 2021.
[22] Rui Huang and Yixuan Li. Mos: Towards scaling out-of uutoo--distribttion detection for large semantic space. In CVPR, 2021.
[23] Xue Jiang, Feng Liu, Zhen Fang, Hong Chen, Tongliang Liu, Feng Zheng, and Bo Han. Negative label guided ood detection with pretrained vision- vision-language models. In ICLR, 2024.
[24] A. Krizhevsky and G. Hinton. Learning multiple layers of features from tiny images. Handbook of Systemic Autoimmune Diseases, 1(4), 2009.
[25] Kimin Lee, Kibok Lee, Honglak Lee, and Jinwoo Shin. simple unified framework for detecting out-of-distribution samples and adversarial attacks. In NeurIPS, 2018
[26] Tianqi Li, Guansong Pang, Xiao Bai, Wenjun Miao, and Jin Zheng. Learning transferable negative prompts for out-of-distribution detection. CVPR, 2024.
[27] Shiyu Liang, Yixuan Li, and Rayadurgam Srikant. Enhancing the reliability of out-of- distribution image detection in neural networks. In ICLR, 2018.
[28] Litian Liu and Yao Qin. Fast decision boundary based out-of-distribution detector. In ICML, 2024.
[29] Litian Liu and Yao Qin. Detecting out-of-distribution through the lens of neural collapse. In CVPR, 2025.
[30] Weitang Liu, Xiaoyun Wang, John D Owens, and Yixuan Li. Energy- based diit---dittiitttion detection. In NeurlPS, 2020.
[31] Xixi Liu and Zach Christopher. TAG: Text prompt augmentation for zero-shot out-of-distribution detection. ECCV, 2024.
[32] Xixi Liu, Yaroslava Lochman, and Zach Christopher. Gen: Pushing the limits of softmax-basee out-of-distribution detection. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2023.
[33] Yifei Ming, Ziyang Cai, Jiuxiang Gu, Yiyou Sun, Wei Li, and Yixuan Li. Delving into out-of-distribution detection with vision-language representations. In NeurlPS, 2022.
[34] Atsuyuki Miyai, Qing Yu, Go Irie, and Kiyoharu Aizawa. Locoop: Few-shot -ustr--disttibutiin detection via prompt learning. In NeurIPS, 2023.
[35] Atsuyuki Miyai, Qing Yu, Go Irie, and Kiyoharu Aizawa. Gl-mem: Global and local maximum concept matching for zero-shot out-of-distributioo detection. International Journal of Computer Vision, pages 1-11, 2025.
[36] Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Baolin Wu, Andrew Y Ng, et al. Reading digits in natural images with unsupervised feature learning. In NeurIPS Workshop, 2011.
[37] Jun Nie, Yonggang Zhang, Zhen Fang, Tongliang Liu, Bo Han, and Xinmei Tian. Out-of- distribution detection with negative prompts. ICLR, 2023.
[38] Karol J. Piczak. ESC: Dataset for Environmental Sound Classification. In ACM Multimedia, 2015.
[39] Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, et al. Learning transferable visual models from natural language supervision. In ICML, 2021.
12

---

[40] Sudarshan Regmi. Going beyond conventional ood detection. arXiv preprint arXh::2411.10794 2024.
[41] Tal Ridnik, Emanuel Ben-Baruch, Asaf Noy, and Lihi Zelnik-Manor. Imagenet-21k pretraining for the masses. In NeurIPS, 2021.
[42] Dan Roth and Kevin Small. Margin-based active learning for structured output spaces. In Proceedings of the 17th European Conference on Machine Learning, 2006.
[43] Burr Settles and Mark Craven. An analysis of active learning strategies for sequence labeling tasks. In EMNLP, 2008.
[44] Yiyou Sun, Chuan Guo, and Yixuan Li. React: Out-of-distribution detection with rectified activations. In NeurlPS, 2021.
[45] Yiyou Sun, Yifei Ming, Xiaojin Zhu, and Yixuan Li. Out-of-distribution detection with deep nearest neighbors. In ICML, 2022.
[46] Antonio Torralba, Rob Fergus, and William T Freeman. 80 million tiny images: large data set for nonparametric object and scene recognition. 7PAMI, 2008.
[47] Grant Van Horn, Oisin Mac Aodha, Yang Song, Yin Cui, Chen Sun, Alex Shepard, Hartwig Adam, Pietro Perona, and Serge Belongie. The inaturalist species classification and detection dataset. CVPR, 2018.
[48] Sagar Vaze, Kai Han, Andrea Vedaldi, and Andrew Zisserman. Open-set recognition: a good closed-set classifier all you need? In ICLR, 2022.
[49] Haohan Wang, Songwei Ge, Zachary Lipton, and Eric P Xing. Learning robust global represen- tations by penalizing local predictive power. In NeurIPS, 2019.
[50] Haoqi Wang, Zhizhong Li, Litong Feng, and Wayne Zhang. Vim: Out-of-distribution with virtual-logit matching. In CVPR, 2022.
[51] Hualiang Wang, Yi Li, Huifeng Yao, and X. Li. Clipn for zero-shot ood detection: Teaching CLIP to say In ICCV, 2023.
[52] Hongxin Wei, Renchunzi Xie, Hao Cheng, Lei Feng, Bo An, and Yixuan Li. Mitigating neural network overconfidence with logit normalization. In ICMI, 2022.
[53] Jingkang Yang. Haoqi Wang. Litong Feng, Xiaopeng Yan, Huabin Zheng, Wayne Zhang, and Ziwei Liu. Semantically coherent -istr--disttibution detection. In ICCV, 2021.
[54] Jingkang Yang, Pengyun Wang, Dejian Zou, Zitang Zhou, Kunyuan Ding, Wenxuan Peng. Haoqi Wang, Guangyao Chen, Bo Li, Yiyou Sun, et al. Openood: Benchmarking generalized out-of-distribution detection. In NewrIPS, 2022.
[55] William Yang, Byron Zhang, and Olga Russakovsky. Imagenet-ood: Deciphering modern out-of-distribution detection algorithms. In ICLR, 2024.
[56] Qing Yu and Kiyoharu Aizawa. Unsupervised out-of-distribution detection by maximum classifier discrepancy. In ICCV, 2019.
[57] Jingyang Zhang, Nathan Inkawhich, Randolph Linderman, Yiran Chen, and Hai Li. Mixture outlier exposure: Towards 2023.
detection in fine-grained environments. In WACV,
[58] Jinsong Zhang, Qiang Fu, Xu Chen, Lun Du, Zelin Li, Gang Wang. Shi Han, Dongmei Zhang, et al. Out-of--iitribution detection based on in-distribution data patterns memorization with modern hopfield energy. In ICLR, 2023.
[59] Zihan Zhang and Xiang Xiang. Decoupling maxlogit for out-of-distribution detection. In CVPR, pages 1388-3397, 2023.
13

---

[60] Zihan Zhang and Xiang Xiang, Decoupling maxlogit for out-of-distribution detection. In CVPR, 2023.
[61] Bolei Zhou, Agata Lapedriza, Aditya Khosla, Aude Oliva, and Antonio Torralba. Places: A 10 million image database for scene recognition. IEEE Transactions on Puttern Analysis and Machine Intelligence, 2017.
[62] Kaiyang Zhou, Jingkang Yang, Chen Change Loy, and Ziwei Liu. Learning to prompt for vision-language models. International Journal of Computer Vision, 130:2337-2348, 2022.
14

---

NeurIPS Paper Checklist
1. Claims
Do the main claims made in the abstract and introduction accurately reflect the paper's contributions and scope?
Question:
Answer: [Yes]
Justification:
A summary of the paper's contributions is provided at conclusion.
Guidelines:
The answer NA means that the abstract and introduction do not include the claims made in the paper.
The abstract and/or introduction should clearly state the claims made, including the contributions made in the paper and important assumptions and limitations. A No or
NA answer to this question will not perceived well by the reviewers.
The claims made should match theoretical and experimental results, and reflect how much the results be expected to generalize other settings.
is fine include aspirational goals as motivation as long is clear that these goals are not attained by the paper.
2. Limitations
Question: Does the paper discuss the limitations of the work performed by the authors?
Answer: [Yes]
Justification:
See Limitations in Section
Guidelines:
The answer NA means that the paper has no limitation while the answer No means that the paper has limitations, but those not discussed in the paper.
The authors are encouraged to create separate "Limitations" section in their paper.
The paper should point out any strong assumptions and how robust the results are to violations of these assumptions (e.g., independence assumptions, noiseless settings, model well-specification. asymptotic approximations only holding locally). The authors should reflect how these assumptions might be violated in practice and what the implications would be.
The authors should reflect on the scope of the claims made, e.g., if the approach was only tested on few datasets or with few runs. In general, empirical results often depend on implicit assumptions, which should be articulated.
The authors should reflect the factors that influence the performance of the approach. For example, facial recognition algorithm may perform poorly when image resolution low images are taken in low lighting. Or speech-to-text system might be used reliably to provide closed captions for online lectures because it fails to handle technical jargon.
The authors should discuss the computational efficiency of the proposed algorithms and how they scale with dataset size.
If applicable, the authors should discuss possible limitations of their approach address problems of privacy and faimess.
While the authors might fear that complete honesty about limitations might be used by reviewers as grounds for rejection, a worse outcome might be that reviewers discover limitations that aren't 't acknowledged in the paper. The authors should use their best judgment and recognize that individual actions in favor of transparency play an impor- tant role in developing norms that preserve the integrity of the community. Reviewers will be specifically instructed to not penalize honesty concerning limitations.
3. Theory assumptions and proofs
Question:
For each theoretical result, does the paper provide the full set of assumptions and complete (and correct) proof?
Answer: [Yes]
15

---

Justification:
The proof is provided in Appendix A.
Guidelines:
The answer NA means that the paper does not include theoretical results.
All the theorems, formulas, and proofs in the paper should be numbered and cross- referenced.
All assumptions should be clearly stated referenced in the statement of any theorems.
The proofs can either appear in the main paper or the supplemental material, but they appear in the supplemental material, the authors are encouraged to provide short proof sketch provide intuition.
Inversely, any informal proof provided in the core of the paper should complemented by formal proofs provided in appendix or supplemental material.
Theorems and Lemmas that the proof relies upon should be properly referenced.
4. Experimental result reproducibility
Question: Does the paper fully disclose all the information needed to reproduce the main ex- perimental results of the paper to the extent that affects the main claims and/or conclusions of the paper (regardless whether the code and data are provided or not)?
Answer: [Yes]
Justification: See Section 5.2, and supplemental material for implementation details.
Guidelines:
The answer NA means that the paper does not include experiments.
If the paper includes experiments, a No answer to this question will not be perceived well by the reviewers: Making the paper reproducible is important, regardless of whether the code and data are provided or not.
If the contribution is dataset and/or model, the authors should describe the steps taken to make their results reproducible or verifiable.
Depending on the contribution, reproducibility can be accomplished in various ways. For example, if the contribution is a novel architecture, describing the architecture fully might suffice, or if the contribution is a specific model and empirical evaluation, it may be necessary to either make possible for others to replicate the model with the same dataset, or provide access to the model. In general. releasing code and data is often one good way accomplish this, but reproducibility can also be provided via detailed instructions for how to replicate the results, access to a hosted model (e.g.. in the case of large language model), releasing of a model checkpoint, or other means that are appropriate to the research performed.
While NeurIPS does not require releasing code, the conference does require all submis- sions to provide some reasonable avenue for reproducibility, which may depend on the nature of the contribution. For example
(a) the contribution is primarily a new algorithm, the paper should make clear how to reproduce that algorithm.
(b) the contribution is primarily a new model architecture, the paper should describe the architccture clearly and fully.
(c) If the contribution is new model (e.g., a large language model), then there should either way to access this model for reproducing the results or way to reproduce the model (e.g., with an open-source dataset instructions for how to construct the dataset).
(d) We recognize that reproducibility may be tricky in some cases, in which case authors are welcome to describe the particular way they provide for reprodueibility. the case of closed-source models, may be that access to the model is limited in some way (e.g., to registered users), but it should be possible for other researchers have some path to reproducing or verifying the results.
5. Open access to data and code
Question: Does the paper provide open access to the data and code, with sufficient instruc- tions to faithfully reproduce the main experimental results, as described in supplemental material?
16

---

Answer: [Yes]
Justification: See wttptttbbbbccc//TT-LL////ooooo/.
Guidelines:
The answer NA means that paper does not include experiments requiring code.
Please see the NeurlPS code and data submission guidelines (https://nips.. cc/
for more details.
While we encourage the release of code and data, we understand that this might not be possible, so "No" an acceptable answer. Papers cannot be rejected simply for not including code, unless this is central to the contribution (e.g., for new open-source benchmark).
The instructions should contain the exact command and environment needed to run to reproduce the results. See the NeurIPS code and data submission guidelines (https:
/ //nips. wttpccccpppccccceeececccccccccct /ttpa//gggiieee/eeeuuuuiiiiiiiii /CodeSubmic ssionnollll onPolicy))) for more details.
The authors should provide instructions on data access and preparation, including how access the raw data, preprocessed data, intermediate data, and generated data, etc.
The authors should provide scripts to reproduce all experimental results for the new proposed method and baselines. If only subset of experiments are reproducible, they should state which ones are omitted from the script and why.
At submission time, to preserve anonymity, the authors should release anonymized versions (if applicable).
Providing as much information possible in supplemental material (appended to the paper) recommended, but including URLs to data and code permitted.
6. Experimental setting/details
Question: Does the paper specify all the training and test details (e.g., data splits, hyper- parameters, how they were chosen, type of optimizer, etc.) necessary to understand the results?
Answer: [Yes]
Justification:
See Section 5.1, 5.2, 5.3 and supplemental material for implementation details.
Guidelines:
The answer NA means that the paper does not include experiments.
The experimental setting should be presented in the core of the paper to level of detail that is necessary to appreciate the results and make sense of them.
The full details can be provided either with the code, in appendix, or as supplemental material.
7. Experiment statistical significance
Question: Does the paper report error bars suitably and correctly defined or other appropriate information about the statistical significance of the experiments?
Answer: [NA]
Justification: Not Applicable.
Guidelines:
The answer NA means that the paper does not include experiments.
The authors should answer "Yes" if the results are accompanied by error bars, confi- dence intervals, statistical significance tests, at least for the experiments that support main claims of the paper.
The factors of variability that the error bars are capturing should be clearly stated (for example, train/test split, initialization, random drawing of some parameter, overall run with given experimental conditions).
The method for calculating the error bars should be explained (closed form formula, call a library function, bootstrap, etc.)
The assumptions made should be given (e.g.. Normally distributed errors).
should be clear whether the error bar is the standard deviation the standard error of the mean.
17

---

It is OK to report 1-sigma error bars, but one should state it. The authors should preferably report a 2-sigma error bar than state that they have 96% CI, if the hypothesis of Normality of enrors is not verified.
For asymmetric distributions, the authors should be careful to show in tables or figures symmetric error bars that would yield results that are out of range (e.g. negative eтror rates).
If error bars are reported in tables or plots, The authors should explain in the text how they were calculated and reference the corresponding figures or tables in the text.
8. Experiments compute resources
For each experiment, does the paper provide sufficient information on the com- puter resources (type of compute workers, memory, time of exccution) needed to reproduce the experiments?
Question:
Answer: [Yes]
Justification: See Appendix C.
Guidelines:
The answer NA means that the paper does include experiments.
The paper should indicate the type of compute workers CPU or GPU, internal cluster, cloud provider, including relevant memory and storage.
The paper should provide the amount compute required for each of the individual experimental runs well estimate the total compute.
The paper should disclose whether the full research project required more compute than the experiments reported in the paper (e.g., preliminary failed experiments that didn't make into the paper).
9. Code of ethics
Question: Does the research conducted in the paper conform, in every respect, with the NeurIPS Code of Ethics https: htt////eerr..p.eeeeee cc cc/public//eeeeccccccccccec www.ehhiiiiieeeeeeeeeeeeeeeeeeee
Answer: [Yes]
Justification: The research conducted in the paper conform, in every respect, with the NeurlPS Code of Ethics.
Guidelines:
The answer NA means that the authors have not reviewed the NeurlPS Code of Ethics.
If the authors answer No, they should explain the special cireumstances that require deviation from the Code of Ethics.
The authors should make to preserve anonymity (e.g.. if there is special consid- cration due to laws or regulations their jurisdiction..
10. Broader impacts
Question: Does the paper discuss both potential positive societal impacts and negative societal impacts of the work performed?
Answer: [Yes]
Justification:
See Section
Guidelines:
The answer NA means that there is no societal impact of the work performed.
If the authors answer NA or No, they should explain why their work has no societal impact why the paper does not address societal impact.
Examples of negative societal impacts include potential malicious or unintended uses (e.g., disinformation, generating fake profiles, surveillance), fairness considerations (e.g., deployment of technologies that could make decisions that unfairly impact specific groups), privacy considerations, and security considerations.
18

---

The conference expects that many papers will be foundational research and not tied particular applications, let alone deployments. However, if there is direct path to any negative applications, the authors should point it out. For example, it is legitimate to point out that an improvement in the quality of generative models could be used to generate deepfakes for disinformation. On the other hand, it is not needed to point out that a generic algorithm for optimizing neural networks could enable people to train models that generate Deepfakes faster.
The authors should consider possible harms that could arise when the technology is being used as intended and functioning correctly, harms that could arise when the technology being used intended but gives incorrect results, and harms following from (intentional or unintentional) misuse of the technology.
If there negative societal impacts, the authors could also discuss possible mitigation strategies (e.g., gated release of models, providing defenses in addition to attacks, mechanisms for monitoring misuse, mechanisms monitor how system learns from feedback over time, improving the efficiency and accessibility of MI..
11. Safeguards
Does the paper describe safeguards that have been put in place for responsible release of data models that have high risk for misuse (e.g., pretrained language models, image generators, or scraped datasets)?
Question:
Answer: [NA]
Justification: Not Applicable.
Guidelines:
The answer NA means that the paper poses such risks.
Released models that have high risk for misuse or dual-use should be released with necessary safeguards to allow for controlled use of the model, for example by requiring that users adhere usage guidelines or restrictions to access the model or implementing safety filters.
Datasets that have been scraped from the Internet could pose safety risks. The authors should describe how they avoided releasing unsafe images.
We recognize that providing effective safeguards is challenging, and many papers do not require this, but we encourage authors to take this into account and make best faith effort.
12. Lieenses for existing assets
Question: Are the creators or original owners of assets (e.g., code, data, models), used in the paper. properly credited and are the license and terms of use explicitly mentioned and properly respected?
Answer: [Yes]
Justification: See References.
Guidelines:
The answer NA means that the paper does existing assets.
The authors should cite the original paper that produced the code package or dataset.
The authors should state which version of the asset is used and, if possible, include URL.
The name of the license (c.g., CC-BY 4.0) should be included for each asset.
For scraped data from a particular source (c.g., website), the copyright and terms of service of that source should be provided.
If assets are released, the license, copyright information, and terms of use in the package should be provided. For popular datasets, paperswi thcode. com com/dataseta has curated licenses for some datasets. Their licensing guide can help determine the license of dataset.
For existing datasets that are re-packaged, both the original license and the license of the derived asset (if it has changed) should be provided.
19

---

If this information is not available online, the authors are encouraged to reach out to the asset's creators.
13. New assets
Question: Are new assets introduced in the paper well documented and is the documentation provided alongside the assets?
Answer: [NA]
Justification: Not Applicable.
Guidelines:
The answer NA means that the paper does not release new assets.
Researchers should communicate the details of the dataset/code/mmoel as part of their submissions via structured templates. This includes details about training, license, limitations, etc.
The paper should discuss whether and how consent obtained from people whose asset is used.
At submission time, remember to anonymize your assets (if applicable). You can either create an anonymized URL or include an anonymized zip file.
14. Crowdsoureing and research with human subjects
Question: For crowdsourcing experiments and research with human subjects, does the paper include the full text of instructions given to participants and screenshots, if applicable, as well details about compensation (if any)?
Answer: [NA]
Justification: Not Applicable.
Guidelines:
The answer NA means that the paper does not involve crowdsoureing nor research with human subjects.
Including this information in the supplemental material is fine, but if the main contribu- tion of the paper involves human subjects, then as much detail as possible should be included the main paper.
According the NeurIPS Code of Ethics, workers involved in data collection, curation, or other labor should be paid at least the minimum wage in the country of the data collector.
15. Institutional review board (IRB) approvals or equivalent for research with human subjects
Question:
Does the paper describe potential risks incurred by study participants, whether such risks were disclosed to the subjects, and whether Institutional Review Board (IRB) approvals (or an equivalent approval/review based on the requirements of your country or institution) were obtained?
Answer: [NA]
Justification: Not Applicable.
Guidelines:
The answer NA means that the paper does not involve crowdsourcing nor research with human subjects.
Depending the country in which research is conducted, IRB approval (or equivalent) may be required for any human subjects research. If you obtained IRB approval, you should clearly state this in the paper.
We recognize that the procedures for this may vary significantly between institutions and locations, and expect authors to adhere to the NeurlPS Code of Ethics and the guidelines for their institution.
For initial submissions, do not include any information that would break anonymity (if applicable), such the institution conducting the review.
16. Declaration of LLM usage
20

---

Question: Does the paper describe the usage of LLMs if it is important, original, or non-standard component of the core methods this research? Note that if the LLM used only for writing, editing, or formatting purposes and does not impact the core methodology, scientific rigorousness, or originality of the research, declaration is not required.
Answer: [No]
Justification: We only use LLM for writing.
Guidelines:
The answer NA means that the core method development in this research does not involve LLMs any important, original, non-standard components.
Please refer to our LLM policy (https 220 for what should or should not be described.
21

---

A Theoretical Analysis: LogitsGap vs Softmax Scaling
In this section, we provide the proof of Theorem 4.1 from Section 4, which offers detailed analysis of the relationship between LogitGap and MCM [33]. We first introduce the necessary notation and definitions.
Notations. Formally, in the out-of-distrbuution problem, the decision function D OOD) typically constructed as:
ID: if i 1
D ((x) = OOD, if ( < X
(11)
where S X' +
is a scoring function based on pre-trained model f. which assigns a scalar confidence score to each input sample. The decision threshold À establishes the decision boundary: samples satisfying S (x)
are identified as OOD, while those with S (a:) are considered ID)
We present the OOD scoring functions for LogitGap and MCM. Given logit vector z predicted for a test sample æ, we sort its elements in descending order obtain z'. LogitGap exploits the inherent distributional differences between ID and OOD logits
K Σ
LLgttGap (x:f) = K
(11
24))
(12)
j=1
where z/ denotes the j-th largest logit.
MCM [33] applies softmax normalization to the logits and takes the maximum probability as the OOD score:
ea//T
SMOM (æ; f) = max
(13)
Ej=1
where 7 a temperature scaling parameter.
Furthermore, we give the OOD decision function based on the corresponding score:
LogitGpp (x; f) 2 ALogitGap
DaagitGap (x) = (OOD, if LogitGap (x; f) < ALoittGap
(14)
ID, if SMCM f) 2 AMOM
DMCM (x)
(15)
OOD, if SMCM((;; AMCM
Remarks. By convention, ALggitGap and AMCM are typically chosen such that the true positive rate is at 95%. For brevity, we will use Åτ. to denote AoogitGap throughout the rest of this paper.
Theorem A.1. Given K-way classification task, let the predicted logit vector for sample æ be [21, :2;...; 2K). Let z' #2,..,,,,, zxk denote the sorted logits in descending order, such that max Zk. Then, for the temperature scaling parameter used in the softmax function, if 2(K 1), have
FPRL.gitGaap (At.) I FPRMMM (T, AMMM))
where FPRLogitaap (AL) is the false positive rate based LogitGap with threshold XL- Similarly, FPRMCM (T, AMCM) the false positive rate based on MCM with temperature T and threshold AMOM-
Proof. Let Q. denotes the out-of-distributiin Pzioon- By definition, we express the false positive rate MCM, denoted as FPRMCM(T,, AmCM), the following:
FPRMMM[T, AMCM) = Qu (SMCM(æ; > AMOM)
eilT
= Q.e
AMCM
(16)
Σ 5/T
*For ease of derivation, we adopt Equation 12 in place SLoghtGap (x: = Rt Ex (2) 2/), without affecting performance.
22

---

Next, we introduce a intermediate OOD score function, LogitGap with softmax (LogitGap softmax ( bridge the MCM and our LogitGap. We define the score function of LogitGap LogitGap_softmal softmax as
SLogittaa_ssottmax/ softmax (z; f) ΣK Le,le-// -0401 Therefore, the false positive rate of Logitaap_softmax
K EE
can be expressed as
Cap_ssgttaapssttttaaa (T, ALM) Qu SLogitGap.softmass (x; >
ALM)
Σ 1e-/7
-e//TT]
ALM
K EØ= E5/TT
Qu
Σ E 1//T
K
ALM
e//T
1
Q2
ALM
+
(17)
E e3//T
K
Combining (q6( and (q.(1 we have AMOM = ALM + K. Similarly, we can express the false positive rate of LogitGap as
FPRtagitGap (AL.) = Qn (St.ggitaap (æ:; f) > Ar.)
2j=1 (2f
K
-x-) 2/))
= Qx
> X1.
K
Ej=1 (z' -2-) z2))
k
Qs
dL
K
Since the outputs of CLIP are bounded within
[-1,1] 3, it follows that
Σ
( z/) 2(K 1).
==1
Furthermore, we have
> 2==1 (3( 2z4)
FPRLoginGapp Qr
AL
T K
2(K - 1)
$ SQ
> * AL.
T*K K
2(K - 1)
1
Q
K 7 * AL
T
2(K -1)
ctil
SQ.
Σ E)=1 6//1 xx *>
E//T
A1
Qx
(18)
Σ c//T
-1K-1)
Next, for ÀLM and ' consider two cases: (1) ALM
:2) ALM
For the case (1), with the assumption ÄLM S AL.
we have
c/ilT
+ ALM
FPRLogitGap (AL)5O,
(19)
K E e3/7
2(K 1)
$ Forr non-CLIP models, assuming the output range is |- A,, A), we similarly obtain Σ 2A(K 1)
(2)
2/) S
23

---

By comparing (q,(1 and (19), we can derive that FPRLogitGapPAL S (PRMCM AMCM), if the following condition holds:
T ALM
AMCM-
(20)
2(K 1)
Note that, ALM AMCM
Combining this equation with (q.( have
AMCM
2(K 1)
2(K 1)
(21)
ALM
For the case (2). by directly comparing (q.(1 and (18) we can derive that FPR Gap FPR AMMM), if the following condition holds:
S
AMCM-
(22)
2
In the case (2), we have ALM
d With this inequation, (q.(22) can rewitten
T ALM
AL
2 AMCM-
(23)
2(K 1)
2(K11
Note that (2.) is the same as (21, thus we can derive the same conclusion.
24

---

B Analysis: Logits Distribution Differences Between ID and OOD Samples
B.1 Motivation Example
To illustrate a key limitation of the softmax-based scoring function MCM [33], we present two examples where logir distributions differ significantly yet yield nearly identical MCM scores. This reveals how the softmax operation can suppress informative structural differences in the logit space, which are often critical for distinguishing ID and OOD samples. Consider 3-way classification problem with two test samples, x² and x², whose corresponding logit vectors are 21 = [0.5596, -0. 0.9808, -0.9808] and x² = [0.9783. -0.6311, -0.4976), respectively. Despite the significant difference in magnitude and sharpness (z² exhibits much more confident prediction), the maximum softmax probability for both is identical: softmax (z*) [0.70, 0.15, 0.15] and softmax (=²)
0.14,0.0
This arises because softmax normalizes logits into a probability distribution, preserving their relative ordering while discarding absolute magnitudes. As result, distinct logit patterns can be mapped to probability vectors with similar maximum values, thereby limiting the discriminative power of softmax- based OOD detection. This issue is further exacerbated by temperature scaling > 1, which flattens the softmax distribution and amplifies information loss. This observation naturally raise a key question: How can we more effectively leverage the discriminative information embedded in non-maximum logits to enhance ID-OOD separability?
B.2 Motivation Evidence
We observe an interesting phenomenon: the relationship be- tween the maximum logit and the remaining logits differs notably between in-distribution (ID) and out-of-distribution (OOD) samples. As shown in Figure 5, ID samples tend have a larger maximum logit value than OOD samples. Conversely, for the non-maximum logits, OOD samples typically exhibit higher values than ID samples.
212-
31.-
To verify the generality of this phenomenon, we conduct experi- ments across various ID/OOD datasets and model architectures in Table 7. Specifically, we report the average maximum logit, and the average logit of non-predicted classes, using ResNet-50, ViT-B/16, and ViT-L/14 as backbone models.
Figure 5: Descending-sortee logits CLIP ViT-B/16 with ImageNet100 (ID) and iNaturalist (OOD).
B.3 Theoretical Analysis
Our theoretical motivation stems from the observed distinction logit patterns between ID and OOD samples: (i) Higher maximum logit values for ID samples; (ii) Higher non-predicted class logits in OOD samples. This indicates that the gap between the maximum logit and the remaining logits generally wider for ID samples than for OOD samples.
To understand the rationale behind this, we provide simple analysis from the theoretical perspective.
Theorem B.I. In binary classification problem, given well-trained feature extractor & and classifier W, we assume that the feature distribution of ID samples for class i follows Gaussian distribution, δ G(IDI ly 0) N(p, E,) and Φ(ÆID)) ly = 1) N(n,, Ez). We further assume that the features of OOD samples can be modeled as an interpolation of two ID feature distribution
with a Gaussian noise, i.e. Le.((ZOOD) = a (N(,, E,) + (1 ()) (po, Σn) + B (O E). Let 12 2P] denotes the predicted logit vector for ID sample ÆTD, 20O [=OOD 2OOD
IID
denotes the predicted logit vector for OOD sample FOOD. If the ID sample aTD belongs to class i, we have
(24)
Proof. If the ID sample and belongs to class i, we have
E| = LT = wP_1
(25)
25

---

Table Logit distribution differences between ID OOD data. zf and g'y denote the maximum logit and the average logit across non-predicted classes, respectively.
z1
N
CIFAR-IO (ID)
9.02
-0.12
CIFAR-100
7.69
0.40
TIN
7.19
0.57
Textures
5.54
0.85
SVHN
5.51
0.84
(a) Logit distribution ResNet-50 using CIFAR-I0 ID dataset.
z1
F'
ImageNet (ID)
30.82
17.32
iNaruralist
26.48
17.89
SUN
26.71
17.90
Textures
28.72
18.94
(b) Logit distribution on CLIP V/T- using ImageNct as dataset.
2
Z'N
ImageNet (ID)
25.76
11.19
iNaturalist
20.72
11.65
Textures
23.85
13.18
ImageNet-O
21.14
12.16
(c) Logit distribution on CLIP VIT-L/14 using ImageNet as ID dataset.
Similarly, we have
E 2 000
=[[_E[o(ZOOD))
(26)
Assuming the features of FOOD be denoted the interpolation of two ID feature distribution with random Gaussian noise, (ee.((OOD)) = a NN4,, En) + (1 - a) WW En) + N E), have
B|zPoP1 wi B ((
( 1n + a)) a...)) -a 11 + (1 a) w i
(27)
We assume that the classifier W is well trained, thus w < wh Then, we have
w W 1 + a a/wpf=1100
(28)
Therefore, have
E < 00D1
(29)
26

---

C Experimental Details
C.1
Implementation Details
We run all OOD detection experiments NVIDIA GeForce RTX-4090Ti GPUs with Pytorch 2.3.1. For CLIP-based OOD detection, we adopt the pre-trained ViT-B/16 [1 [10] model from CLIP [39]. For
conventional OOD detection task using CIFAR-10 10 [24] as ID dataset, we use ResNet-50 [13] model
pre-trained on the CIFAR- 10 training set as the backbone.
C.2 Datasets
ImageNet-IWe ImageNet-20, ImageNet100 [33] creates ImageNet- that mimics the class distri- bution of CIFAR-10 10 [24] but with high-resolution images. For semantically hard OOD evaluation with realistic datasets, [33] curates ImageNet-20, which consists of 20 classes semantically similar to ImageNet- 10 (e.g.. dog (ID) wolf (OOD)). ImageNet- 100 is created by randomly sample 100 classes from ImageNet-Ik- [7].
100
NINCO The NINCO [2] main dataset comprises 64 OOD classes with total of 5,879 samples. These classes were carefully selected to ensure no categorical overlap with any of the ImageNet-IK [7] classes. Additionally, each sample was manually inspected by the authors to confirm the absence of ID objects, making NINCO reliable benchmark for evaluating oul-of-distribution detection on ImageNet- IK.
ImageNetOOD ImageNet-OOD [55] is clean, manually curated, and diverse dataset containing 31,807 images from 637 classes, designed for evaluating semantic shift detection using ImageNet- [7] as the in-distribution (ID) dataset. To minimize covariate shifts, images are sourced directly from ImageNet-22 [41], with human verification ensuring the removal of any ID contamination from ImageNet-I The dataset also addresses multiple sources of semantic ambiguity caused by inaccurate hierarchical relationships in ImageNet labels and eliminates visually ambiguous images stemming from inconsistencies in ImageNet's data curation process.
ImageNet-O ImageNet-O) is a dataset containing image concepts absent from ImageNet-IK [7]. specifically designed evaluate the robustness of ImageNet models. These nut-of-distribution (OOD) images consistently cause models to misclassify them as high-confidence in-distribution examples. As the first anomaly and OOD dataset tailored for testing ImageNet- IK models, ImageNet-O provides a valuable benchmark for assessing OOD detection performance under label distribution shifts.
ImageNet-A ImageNet-A [19] contains images sampled from a distribution distinct from the standard ImageNet-1k 1k [7] training distribution. Although its examples belong to existing ImageNet- Ik classes, they are deliberately more challenging, frequently leading to misclassifications across a range of models. ImageNet-A enables we to test image classification performance when the input data has covariate distribution shifts.
ImageNet-R ImageNet-R (Rendition) [16] consists of artistic and non-photographic renditions of ImageNet-Ik 1k [7] classes, including art, cartoons, graffiti, embroidery, graphics, origami, paintings, patterns, plastic figures, plush toys, sculptures, sketches, tattoos, video game assets, and more. The dataset covers 200 ImageNet-1k classes with a total of 30,000 images, offering a diverse benchmark for evaluating model robustness distribution shifts in visual style and appearance.
ImageNet-Sketch The ImageNet-Sketel [49] dataset contains 50,889 images, with approximately 50 images per class for all 1,000 ImageNet- Ik [7] categories. It was constructed by querying Google Images using the phrase "sketch of [class name]," restricted to Black-andwwil color scheme. An initial set of 100 images was collected for each class, followed by manual filtering to remove irrelevant images and those belonging to visually similar but incorrect classes. For categories with fewer than 50 valid images after cleaning, data augmentation techniques such as flipping and rotation were applied to balance the dataset.
27

---

Table 8: The value of N for methods on different datasets.
K
N (Fixed)
N (Adaptive)
ImageNet
1000
200
88
ImageNet-100
100
20
20
ImageNet-10
10
5
4
ImageNet-20
20
10
6
C.3 Logits Selection Methods
Logits Selection with a Fixed Hyperparameter The effectiveness of our proposed LogitGap method relies on the selection of informative region within the logits space, which is governed by hyperparameter N. To determine an appropriate value for N, we consider the number of classes in the dataset. For datasets with large number of classes (e.g., ImageNet and ImageNet-1000 we set N to 20% of the total number of classes K. In contrast, for datasets with fewer classes (e.g., ImageNet-10 and ImageNet-20), when K is large, using a lower proportion (e.g.. 20%) helps reduce the influence of noise; whereas when K small, higher proportion (e.g.. 50%) preserves more useful information. Moreover, our empirical results demonstrate consistent performance improvement when N is set within the 20%-50% range of the total number of classes across different datasets. The specific N values chosen for different datasets are summarized in Table 8.
set N to 50% of K. This strategy is motivated by the following intuition:
Logits Selection with an Adaptive Hyperparameter N To enhance LogitGap, we introduce an improved strategy to adaptively choice the value of N. To this end, we firstly construct small validation set randomly sampled from the in-distribution (ID) data, with fixed size of 100 samples. Using the model's 's feature extractor, we obtain the image features of these ID samples. We then perform random inter-class interpolation on these features to generate synthetic OOD samples. To further increase the diversity of these synthetic samples, Gaussian noise is added to the interpolated features. The interpolation process is formally defined as follows:
FOOD 3y + a.) my + 3 (O,
(30)
where and æj represent two samples from the ID validation set, denotes the mixing coefficient between samples, while 3 controls the weight the added noise.
In our experiments, we generate set of synthetic OOD samples equal in size to the ID validation set serve the OOD validation set. For datasets with a large number of categories, such as ImageNet
[7] and ImageNet- 100 [33]. we set the interpolation parameters to a = 0.3 and B = 0.8. For smaller-scale datasets like ImageNet-10 10 [33] and ImageNet-20) [33], we set a = 0.3 and 3 0.0. We then compute the logits scores for both the ID and synthetic OOD validation samples and determine
the optimal value of N adaptively based on the following criterion:
arg max (Ra=Pooo
[Ew]
E [=x])
(31)
where byy represents the mean the logits ranked from second to the N-th largest.
C.4 Implementation Details on LogitGap Combined with Negative-Prompt-Based OOD Method
Negative-Pronpp Peeee-rrrmmtaaeeeett Based OOD detection methods jointly train both positive and negative prompts to separately capture the characteristics of ID and OOD samples. In these methods, the model's predicted logits take the form z [2] IID =I zOOD =OOD ..... = _001] where 2/4 denotes the ..... =K 1 =g
logit for the i-th ID class, and =; ,OOD denotes the logit for the j-th OOD class. Since negative prompts tend to increase the logits of OOD samples, directly applying LogitGap over the entire logits space is not appropriate. In our experiments, when combining ID-Like [1] with LogitGap, we rely solely on 2 to compute the LogitGap score.
the ID logits, I!D = [=]0 ID
28

---

D Experimental Results
D.1 Results on Traditional OOD Detection with CIFARI00 as ID Dataset
To further evaluate the effectiveness and generality of our LogitGap, we conduct experiments in traditional OOD detection settings with CIFARI00 [24] as ID dataset. Following the OpenOOD [54] protocol, we adopt the standard OpenOOD benchmark splits for OOD evaluation. The OOD
benchmarks include both near-OOD datasets: CIFAR-IO [24]. Tiny ImageNet [46], and far-OOD
datasets: MNIST [8], SVHN [36], Textures [5], and Places365 [61]. In this setup, we employ a
ResNet-50 [13] backbone trained from scratch II) data using cross-entropy loss. We compare
LogitGap against a comprehensive suite of basclines: (i) Logit-based post-hoc methods: MSP [17],
MaxLogit [14], KL-Matching [15], ODIN [27]. IODIN [40]] (ii) Internal network statistics-
methods: Mahananobis [25]. ASH [9]. SHE (Hopfield energy) [58]; (iii Training- baasd methods with auxiliary data: Outlier Exposure (OE) [18], MixOE [57]. The results are summarized in Table 9.
As shown in Table 9, our proposed LogitGap demonstrates superior performance across all evaluated benchmarks. We observe that: (1) Among logit-based methods, IODIN [40] achieves the best performance. ODIN [27] enhances OOD detection by introducing input perturbations to amplify the difference between ID) and OOD samples in the softmax output. Building upon this, IODIN proposes to mask low-magnitude regions and perturb only invariant features, effectively encouraging the model to ignore environmental factors and focus on more informative regions. This requires calculating an additional invariant feature mask on top of the gradient computation in ODIN. In contrast, LogitGap improves detection performance by applying simple transformation in the output space, reducing the FPR95 by 1.98% and 0.78% compared to MSP [17] and IODIN, respectively. (2) Internal network statie methods generally perform worse because they heavily rely on the representation quality and discriminative ability of the internal network. When the backbone lacks sufficient expressive power, the extracted feature distributions of ID and OOD samples tend to overlap, making it difficult to effectively distinguish between them. (3) When combined with methods that leverage extra -iittriiiitiiito data, such as OE [18] and MixOE [57]. LogitGap further enhances performance over their respective baselines. For example, a straightforward substitution of the OOD score function with LogitGap leads to a 3.57% and 1.23% performance gain in FPR95 and AUROC respectively over the original OE [18] method. These experiments highlight the advantages of LogitGap in terms of ease of integration and wide applicability across different settings.
Table 9: OOD Detection performance on ResNet-50 using CIFAR- 100 as the ID dataset.
Near OOD
Far OOD
AVG
Method
CIFARIO
TIN
MNIST EPR95
SVHN
Textures
PLACES365
PPR95 AUROC
AUROC
AUROC HPR95
FPR95
AUROC HPR95 AUROC
1. AUROC 1
MSP [17]
58.90
78.47
50.70
82.07
$7.23
76.08
59.07
78.42
61.89
77.32
56.63
79.23
57.40
78.60
Maxi ogin [14]
59.11
79.21
51.83
82.90
52.94
78.91
53.90
81.65
62.39
78.39
57.67
79.75
56.31
80.
ODIN [27]
60.63
78.18
55.21
81.63
45.94
83.79
67.43
74.54
62,37
79. 34
59.73
79.45
58.55
79.49
1ODIN [40]
59.09
79.24
51.57
82.96
52.93
78.89
54.06
62.07
57.47
79.83
80.16
KL. MatMhigh [15]
84.77
73.92
70.99
79.21
72.88
74.15
50.31
79.32
81.80
75.76
81.62
75.68
73.73
76.34
Mahalanohis [25]
88.00
55.87
79.04
61.50
67.47
67.22
70.67
70.49
76.26
79.60
63.15
ASH [9]
68.07
76.47
63.37
79.92
66.58 58
77 77.23
45.98
85.60
61.29
80.72
62.96
78.76
61.38
79.78
SHE [58]
60.41
78.15
57.73
79.74
58.78
76.76
59.16
80.97
73.28
73.64
65.26
76.30
62.44
77.59
LogitGap
58.70
79.43
50.01
83,31
$2.49
78.60
54,84
81.07
60.34
78.88
56.12
80..41
55.42
80.28
[18]
63.87
74.64
99.88
35.03
85.73
52.83
83.98
60.49
76.89
+LogitGap
63.29
75.73
0.42
99.88
24.96
92.93
50.28
87.68
49.82
85.37
58.67
78.21
41.24
86.63
Mix0E [57]
61.09
78.18
49.43
83,93
68.00 04
70.06
76.72
73.06
66.37
78.03
56.10
80.44
62.96
77.28
+LogitGap
61.31
78.41
48.41
84.05
67.43
69.98
75.10
73.22
65.58
78.22
55.31
80.69
62.19
77.43
D.2 Results on Traditional OOD Detection with ImtgeNet as ID Dataset
In the traditional OOD detection setting, we further evaluate the performance of LogitGap using
ResNet-50 [13] backbone on the large-scale ImageNet [7] dataset. Following the OpenOOD [54] protocol, we adopt SSB-hard [48] and NINCO [2] as near-OOD datasets, iNaturalist447], Textures[]]
and OpenImage-O [50] as far-OOD datasets. In this setup, the ResNet-50 model [13] is trained from
scratch on the ID data using cross-entropy loss. We compare LogitGap against several representative
29

---

Table 10: OOD Delection performance ResNet-50 using ImageNet the ID dataset.
AVG
Method
SSB-hard
NINCO
INaturalist
Textures
Opealmage-O
FPR95 AUROC FPR95
AUROC FPR95 AUROC FPR95 AUROC FPR95 AUROC FPR95 AUROC
MSP [17]
62
Maxt oggit [14]
76.19
72.51
59.49
80.41
30.59
91.16
46.12
88.39
37.88
89.17
50.05
84.33
KL-Matching [15]
84.72
71.38
81.90
38.51
52.38
84.72
87.30
56.97
ODIN [27]
76.86
71.74
68.08
77.37
36.12
91.16
49.25
89.01
46.48
88.23
55.36
83.58
GradNorm [2]]
78.24
71.90
79.50
74.02
32.01
93.89
43.24
92.05
68.44
84.83
60.
83.34 33.34
Energy
76.53
79.70
31.33
50.46
LogitGap
75.48
72.51
53.64
82.25
26.68
92.24
47.11
87.15
35.10
89.11
47.60
84.65
Table 11: OOD Detection performance on CLIP ViT-B/16 under zero-shot setting. Results are reported with ImageNet as the ID dataset in the far-OOD scenario.
OOD Dataset
iNaturalist
Textures
OpenImage-O O
Method
FPRV5 AUROC AUPR 1 HPR95 J. AUROCT 1 AUPR FPR95
AUROCT AUPR 1 EPR95 AUROC 1 AUPR
Zero-shot
Energy [30]
73.86
87.08
97.28
92.71
66.08
94.77
65.60
85.91
94.55
77.39
79.69
95.53
MCM [33]
31.49
98.80
58.76
85.84
98.02
40.76
91.99
96.95
43.67
90,74
97.92
MaxLogit [14]
$6.25
90.47
97.99
86.45
71.85
95.66
51.89
88.93
95.66
64.86
83.75
96.44
Logit
LogitGap*
27.82
94.89
98.91
58.17
85.68
97.97
37.27
92.66
97.19
41.09
91.08
98.02
post-hoc OOD detection methods, including MSP [17], Maxl [14), KI.-Matching [15], ODIN [27]. IODIN [40], Energy [30], and GradNorm [21].
As summarized in Table 10, LogitGap achieves comparable or superior performance across all benchmarks and obtains the best overall average performance, demonstrating its robustness and effectiveness in the traditional OOD detection scenario.
D.3
Results on Far-OOD Evaluation with ImageNet as ID Dataset in Zero-Shot OOD Detection
In the main paper, to isolate the effect of semantic shift, we construct a challenging OOD detec- tion benchmark specifically designed for semantic shift evaluation. This benchmark is built using ImageNet [7] as ID dataset, while NINCO [2], ImageNet-O [19], and ImageNet-OOD [55] as OOD datasets, enabling a more accurate assessment of the model's ability detect semantic-level distribution changes.
Moreover, following the OpenOOD [54] evaluation protocol, assess the performance of OOD detection methods in the far-OOD scenario under a zero-shot setting. the far-OOD scenario, ImageNet is used as the ID dataset, while iNaturalist [47], OpenImage-O [50], and Textures [5] serve as the OOD datasets. As shown in Table 11, LogitGap maintains robust performance under the broader distributional shift.
D.4 Results More Architectures with ImageNet ID Dataset in Zero-Shot OOD Detection
We extend our experiments to other CLIP variants with ImageNet as ID dataset, including ResNet-50, ResNet-101, ViT-B/32 and ViT-L/14 in zero-shot OOD detection. As shown in Table 12, LogitGap consistently outperforms baselines across all backbones. For instance, on VIT-L/14, LogitGap reduces FPR95 by 6.03% and improves AUROC by 2.65% compared to MCM. This demonstrate that LogitGap generalizes well across architectures.
30

---

Table 12: OOD Detection performance across various CLIP architectures under the zero-shot shot setting. Results reported with ImageNet the ID dataset in semantic shift scenario.
OOD Dataset
AVG
NINCO
ImageNet-O
ImagaNerOOD
Method
FPR95
AUROC AUPR FPR95 AUROC 1 AUPR FPR95
AUROCT f AUPR 1 FPR95
AUROC AUPR
Energy [30]
74.85
86.36
MCM [33]
82,09
71.58
95.55
84.25
73.95
98.57
84.97
75.19
83.64
83.77
73.57
92.59
agit [14]
72.50
98.41
LogirGap
82.65
73.26
95.87
83,70
75.44
98.67
84.01
76.51
84.35
83.45
75.07
92.96
(a) Results on ResNet-50.
0OD Datavet ImageNet-O
NINCO
ImageNetOOD
AVG
Method
FPR95
AUROC 1
AUROC
Energy [30]
91.83
66.06
94.62
86.15
70.51
98.32
81.19
75.07
83.21
86.39
70.55
92.05
MCM [33]
84.13
83.75
74.06
98.56
85.19
74.76
84.36
92.35
MaxLogit [14]
87.94
69.41
95.24
84.15
72.46
98.43
79.73
76.83
84.37
83.94
72.90
92.68
LogitGap
(b) Results on ResNet-101.
OOD Dataset ImageNei-O
NINCO
ImmgeNetOOD
Method
EPRY5
AUROC' AUPR
HPR95 J. AUROC 1 AUPR FPR95
AUROCT AUPR 1 EPR95 AUROC 1 AUPR
Energy [30]
87.05
68.75
94.96
83.80
72.46
98.39
79.66
75.12
82.67
83.50
72.11
92.01
MCM [33]
79.62
73.85
95.93
80.95
75.58
98.66
84.09
76.32
84.16
81.55
75.25
92.92
MaxLogit
82.27
71.76
95.53
80.55
74.32
98.51
77.38
76.99
80.07
74.36
92.70
LogitGap
79.13
75.66
96.27
79.15
77.45
98.77
82.03
77.68
84.84
80.10
76.93
93.29
(c) Results VIT-B/32.
Dataset ImageNet-O
NINCO FPR95 AUROC AUPR
ImageNetOOD
AVG
Method
FPR95
AUROC AUPR
FPR95
AUROC AUPR FPR95
AUROC AUPR
Energy [30]
$1.88
76.89
96.51
77.45
78.45
98.81
76.95
78.16
84.61
78.76
77.83
93.31
MCM [33]
69.48
79.13
96.74
68.30
82.48
99.06
73.99
80.71
86.60
70.59
80.77
94.13
MaxLogii [14]
74.23
79.18
96.86
71.85
80.73
98.
72.78
79.95
85.69
72.95
79.95
93.83
LogitGap
64.43
82.49
97.38
62.05
84.94
99.20
67.20
82.84
87.75
64.56
83.42
94.78
(d) Results on ViT-1/14.
31

---

E More Analysis about Lo
E.1
Generalization Beyond Visual Tasks
Although LogitGap is primarily designed for visual classification, of the settings for OOD detection, we further verify its generalization to non-visual tasks. Specifically, we conduct an evaluation the ESC-50 [38] audio classification dataset, where 50 categories randomly divided into 25 ID and 25 OOD classes. The method is implemented with the CLAP [12] model, following the same hyperparameter selection strategy used in the visual domain, with N 20% of the class count (N = 5).
As shown in Table 13, LogitGap maintains strong performance on this audio task, indicating that does not rely on modality-specifff architectures or features. This confirms its broad applicability across domains. In addition, we introduce MCM topN, comparative baseline that applies the top-N strategy to MCM [33]. For fair comparison, we use the same N for MCM topN and LogitGap. Results show that applying the top-N strategy MCM does not consistently improve performance, which indicates LogitGap's advantage goes beyond top-N filtering.
Table 13: OOD Detection performance on CLAP using ESC-50 dataset, where 50 classes are randomly split into 25 ID and 25 OOD classes.
FPR95 4
AUROC 1
AUPR 1
MCM [33]
26.40
94.86
95.35
MaxLogit [14]
40.60
92.32
92.51
Energy [30]
42.10
91.76
92.09
MCM NCCM_topN
27.90
94.69
95.21
GEN [32]
24.10
95.55
95.96
LogitGap
17.50
96.15
96.48
E.2 Relationship Between LogitGap and Other Logit-Pattern-Be Pattern-Basedd Methods
We review related works in both active learning and OOD detection, and summarize several repre- sentative methods in Table 14. Here, denotes the logit and Pe represents the predicted probability for e-th class. Specifically, we compare LogitGap with three classical active learning approaches: LC [6]. Margin [42], and Entropy [43]; and four representative OOD detection methods: MSP [17]. MaxLogit[ [4], DML [60], and GEN [32].
Among these methods, Margin Sampling is the most closely related to ours, as it also measures a margin between model outputs. However, two key distinctions set LogitGap apart: (1) Representation Level: Margin Sampling operates on predicted probabilities, whereas LogitGap computes directly on raw logits, avoiding softmax-induced normalization effects. (2) Scope of Comparison: Margin Sampling considers only the top-2 predictions, while LogitGap generalizes this to the top-N logits, enabling a more holistic uncertainty estimation.
Table 14: Comparison of logit-pattern-basedd methods, "OOD" and "AL" represent OOD detection and active learning respectively.
Method
Task
Equation
MSP [17]
OOD
max Pe
MaxLogit [14]
OOD
max, Ze
DML [60]
OOD
max, X&,- + || |, Zo = 2e ||zell
GEN [32]
0OD
Ee P
M
7, and P 2 ... 2 PM 2 2 PN, 7 E (0,
Margin [42]
AL
P1 P2 and p1 2 P2... 2 PN
LC [6]
AL
max. 1 Po
Entropy [43]
AL
- Σ. Po log
LogitGap
OOD
M-1 DM - 2e and 1 2 ... zM 2 ... NN
32

---

Table 15: OOD Detection Performance CLIP V under Zero-shot Setting. Results reported with ImageNet as dataset semantic shift scenario.
OOD Dataset ImageNet.O
AVG
NINCO
ImageNe:OOD FPRU5
Method
FPR95
AUROC 1
AUROCC AUPR
1 AUROC
Margin Sampling 89.
68.40
94.97
89.45
67.83
98.14
89.96
67.49
77.67
89.76
67.91
90.26
LogitGap
77.42
76.51
96.38
71,95
81.45
99.03
75.40
80.27
86.21
74.92
79.41
93.87
Table 16: N selected using synthetic and real OOD samples on VIT-B/16 with ImageNet as ID dataset. Noy and Niat denote N selected using synthetic OOD and real OOD samples, respectively.
ImageNet-O
ImageNetOOD
FPR95
AUROCT 1
1PR95
AUROCT
FPR95 4
AUROC
N
N
77.42
76.51
88
71.95
81.45
88
75.40
80.27
88
Nreal
77.22
76.51
110
80.27
To emphasize the importance of these distinctions, we adapt Margin Sampling for OOD detection under zero-shot setting using CLIP ViT-B/16, with ImageNet as the ID dataset in semantic shift scenario. As shown in Table 15, LogitGap consistently outperforms Margin Sampling across all benchmarks, demonstrating the effectiveness and robustness of our formulation.
E.3 The Effectiveness of Synthetic OOD Data
As described in Section C.3, we propose an OOD data synthesis strategy adaptively select the hyperparameter N. Since the synthesized OOD data are derived from in-distribution (ID) information, they may not fully capture the characteristics of world OOD data. Nevertheless, our empirical findings indicate that such synthetic samples are sufficiently informative for selecting robust hyperparameter N. As shown in Table 16, the optimal determined using synthetic OOD samples (i.e., Nyyn) is highly consistent with the one obtained from multiple real OOD datasets (i.e., Nreat), achieving comparable detection performance. These results validate the practicality of the N-selection strategy, even in the absence of real OOD data.
E.4 The Impact of Hyperparameter N on LogitGap Performance
In Table 17, we provide a more ablation study on hyparameter N. Specifically, we conduct experi- ments under the zero-shot OOD detection setting, using either ImageNet-100 100 or ImageNet- J as ID dataset. For simplicity, we report the FPR95 of our LogitGap method based on CLIP ViT-B/16 model. We can observe that: (1) Optimal N varies by dataset (e.g.. 19 for ImageNet-1000 195 for ImageNet- K); (2) Setting N 20% of total classes consistently provides strong performance. Therefore, adopt this value default in LogitGap.
Table 17: Effect hyperparameter on FPR95 using VIT-B/16 under zero-shot setting.
495
695
795
895
NINCO
83.26
77.34
76.81
76.56
76.40
76.74
77.00
77.53
78.29
78.68
79.65
ImageNet-O
81.80
71.85
72.45
73.20
73.40
73.55
73.95
74.30
74.85
75.50
75.90
ImageNetOOD
82.49
75.47
76.38
77.16
77.64
78.26
78.74
79.19
79.72
80.31
81.04
(a) ImageNet ID dataset.
69
79
NINCO
75.54
46.27
42.77
41.88
41.85
42.6
43.23
44.49
46.31
47.64
50,58
ImageNet-O
44.25
44.30
45.75
47.90
ImageNetOOD
76.02
46.86
46.19
46.62
47.10
47.80
48.33
49.32
50.51
50.57
$1.53
(b) ImageNet-100 ID dataset.
33


Reviews:
[{"review_id": "THCJEWpJkl", "reviewer": "Reviewer_BQ18", "summary": "LogitGap is a simple post-training method for differentiating between in-distribution (ID) and out-of-distribution (OOD) samples during inference. LogitGap uses a scoring function that explicitly measures the average gap between a sample’s largest logit and its remaining logits, exploiting the observation that ID samples have a much larger 'logit gap' than OOD samples. Using the logits from all K classes in the scoring function can increase noise in the score as many classes that are semantically far from the sample have negligible logit values. Hence, the authors compute the gap only over the top-N logits. N is chosen automatically from a handful of ID samples to maximize ID/OOD separation. A theoretical analysis links LogitGap to softmax–based scores such as MCM and proves it yields lower false-positive rates when the softmax temperature is high, while extensive experiments confirm the practical gains. On zero-shot CLIP ViT-B/16, LogitGap cuts FPR95 by up to 5.8% versus the previous best logit method, and when paired with few-shot prompt-tuning or training-time OOD schemes it delivers consistent extra improvements across semantic-shift and covariate-shift benchmarks.", "questions": "- Can LogitGap be applied to features at an earlier layer in the DNN in order to detect an OOD sample wtihout performing the full inference computation? This would further reduce the overhead of OOD inference.", "limitations": "yes", "rating": 4, "confidence": 4, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": 3, "clarity": 4, "significance": 3, "originality": 3, "strengths_and_weaknesses": "Strengths\n\n- The scoring function is simple to compute given the logits and does not require additional training.\n- LogitGap scoring function uses information from all logits as opposed to prior methods that may use only the maximum value.\n- The false-positive rate has a minimum when N lies between 20% and 50% of classes, thereby simplifying selection of N for image classification tasks.\n\nWeaknesses\n\n- We must perform the computation for all DNN layers in order to obtain the logits to determine whether a sample is ID or OOD. \n- Determining the correct N is not entirely free as LogitGap requires access to a small ID validation set, which may be unrealistic in zero-sample deployment scenarios\n- Relies on synthetic OOD samples generated by noise/interpolation, whose representativeness for real-world OOD samples is unclear and not justified.", "was_revised": false, "final_justification": "", "rebuttal": "We sincerely thank the reviewer for the insightful comments. Below, we address each concern.\n\n  ### **W1. The LogitGap requires the computation for all DNN layers to obtain the logits to determine whether a sample is ID or OOD.**\n\n  We would like to clarify that OOD detection is typically performed alongside the primary classification task, whose goal is to identify OOD samples without degrading ID classification accuracy [1]. In this context, the logits required for OOD detection are **already produced** during the standard forward pass of classification. Therefore, our method leverages these existing computations and **adds no extra computational cost** beyond standard inference. \n\n  [1] Generalized Out-of-Distribution Detection: A Survey, IJCV 2024.\n\n------\n\n  ### **W2. Determining the correct N is not entirely free, as LogitGap requires access to a small ID validation set, which may be unrealistic in zero-sample deployment scenarios.**\n\n  We would like to clarify that our proposed method can be applied in the zero-sample scenario.\n  Specifically, our method includes two variants (Lines 230-232): **LogitGap** (fixed N = 20% of classes) and **LogitGap\\*** (adaptive N via ID validation set). As shown in Tables 1 and 2, LogitGap performs comparably to LogitGap\\*, demonstrating that our method remains effective even without access to a validation set.\n\n------\n\n  ### **W3. Relies on synthetic OOD samples generated by noise/interpolation, whose representativeness for real-world OOD samples is unclear and not justified.**\n\n  Thanks for this valuable comment. We agree that synthetic OOD samples may not fully reflect the characteristics of real-world OOD samples. However, our empirical results show that these synthetic samples are sufficiently informative  for selecting a robust hyperparameter $N$.\n\n  As shown in the table below, on ImageNet, the optimal $N$ selected using synthetic samples (i.e., $N_{syn}$) is close to the optimal $N$ derived from multiple real OOD datasets (i.e., $N_{real}$), and achieves comparable performance. This demonstrates the practicality and generalizability of our strategy for selecting $N$ without requiring access to real OOD data.\n\n  |          |       | ninco |      |       | Imagenet-O |      |       | ImageNet | -OOD     |\n  | -------- | ----- | ----- | ---- | ----- | ---------- | ---- | ----- | ------------| ---- |\n  |          | FPR95 | AUROC | N    | FPR95 | AUROC      | N    | FPR95 | AUROC        | N    |\n  | $N_{syn}$ | **77.42** | **76.51** | 88   | **71.95** | 81.45      | 88   | **75.40** | **80.27**        | 88   |\n  | $N_{real}$     | 77.22 | **76.51** | 100  | 71.60 | **81.50**      | 110  | 75.39 | **80.27**        | 90   |\n\n-----\n\n  ### **Q1: Can LogitGap be applied to features at an earlier layer in the DNN in order to detect an OOD sample without performing the full inference computation?**\n\n  Detecting OOD samples using only shallow features is challenging. In zero/few-shot OOD detection settings, OOD samples often involves **semantic shifts**, which are difficult to capture without the high-level abstractions provided by deeper layers [2].\n\n  To address this, existing works [3, 4] explicitly leverage deep features to capture high-level semantic cues for OOD detection.\n  However, these methods may incur additional computational overhead as they require calculating feature correlations for each layer.\n  In contrast, our approach remains computationally efficient while still effectively identifying OOD samples.\n\n  [2] Full-Spectrum Out-of-Distribution Detection. IJCV 2023.\n\n  [3] A simple unified framework for detecting out-of-distribution samples and adversarial attacks. NeurIPS 2018.\n\n  [4] Detecting out-of-distribution examples with gram matrices. ICML 2020."}, {"review_id": "GCAps75Zjo", "reviewer": "Reviewer_4oYE", "summary": "This paper proposes LogitGap, a novel scoring function for out-of-distribution (OOD) detection. LogitGap is designed to address the limitations of existing methods such as MaxLogit and Maximum Concept Matching (MCM). Specifically, while MaxLogit considers only the highest class logit and ignores the rest of the distribution, MCM relies on the softmax function, which normalizes the logit values and may obscure informative differences. LogitGap is formulated as the gap between the top logit and the rest of the distribution, thereby combining the advantages of both MaxLogit (absolute logit norm) and MCM (distributional awareness). The paper provides both theoretical insights and extensive empirical results to demonstrate the effectiveness of LogitGap.", "questions": "1. Why this specific LogitGap formulation?\nThe motivation to combine the strengths of MaxLogit and MCM is clearly explained, and the experimental results support the effectiveness of LogitGap. However, the specific choice of computing the difference between the maximum logit and the average of the remaining logits requires further justification. Why is this particular subtraction-based formulation considered the most effective? For example, were alternative designs such as weighting the MCM score by the max logit or using other aggregation strategies considered? Providing experimental comparisons or ablation study results on these alternatives would help strengthen the justification for the robustness or optimality of the proposed formulation.\n\n2. Sensitivity to N (number of logits averaged):\nThe sensitivity of LogitGap to hyperparameter N is a significant concern for practical applications. While N averages non-maximum logits, low-ranked classes likely have consistently low values, regardless of whether they are in-distribution (ID) or out-of-distribution (OOD). This could reduce the average of the subtraction term, making ID/OOD distinction difficult. This challenge also affects MCM. We anticipate MCM would perform better if evaluated with an N value derived similarly to LogitGap's N. A comparison under such conditions would ensure a fair evaluation. We recommend conducting this experiment and sharing the results.", "limitations": "1. **Motivation Example in Section 4.1 may be unintuitive**:\n   In the provided example, 𝑧₂ shows high logits for two classes and is described as likely being an in-distribution sample, while 𝑧₁ lacks a dominant logit. While this may be intuitive from an OOD detection perspective, it contradicts typical classification expectations, where such ambiguity often indicates a confusing or hard-to-classify input. This could lead to confusion for readers. If a better illustrative example is not available, the current description should be revised for clarity. For instance, instead of:\n   \"Despite the significant difference in magnitude and sharpness...\"\n   a more intuitive phrasing might be:\n   \"Since OOD samples tend not to show confident alignment with any known class, a sample like 𝑧₂, which activates multiple classes relatively strongly, may indicate a higher likelihood of being in-distribution.\"\n\n2. **Excessive reliance on supplementary material for theoretical explanation**:\n   As previously mentioned, key derivations—especially Theorem 4.1—are presented only in the supplementary material. This is problematic given the central importance of this result. The main text does not provide sufficient intuition or explanation about why the theorem holds or how it contributes to the final formulation. Without such context, readers may struggle to assess the theoretical soundness of the method. Including a brief, self-contained summary or intuition for the theorem in the main paper would significantly improve clarity.\n\n3. **Limited generalization beyond vision classification tasks**:\n   Although the method is theoretically general, its evaluation is confined solely to vision classification benchmarks. Given the simplicity of the formulation and its potential for cross-domain applicability, including at least one experimental setting beyond vision classification would strengthen the paper. This would help demonstrate the broader applicability and robustness of the method across different domains.", "rating": 4, "confidence": 4, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": 3, "clarity": 2, "significance": 3, "originality": 3, "strengths_and_weaknesses": "Strengths:\n\n1. The proposed method is conceptually simple and easy to understand, making it broadly applicable across various domains.\n\n2. The authors support their approach with both comprehensive theoretical analysis and extensive experimental validation, which strengthens the credibility of the method.\n\n3. The paper is well-organized and clearly written, facilitating accessibility and readability for a wide range of readers.\n\nWeaknesses:\n\n1. The theoretical motivation of the proposed method relies on certain assumptions that are not fully verified or supported. If these assumptions are trivial or well-established, proper references should be provided to increase the logical soundness. For instance, Figure 2 lacks critical context — it is unclear under what setting it was generated, whether it represents a single data point or an average over multiple samples.\n\n2. The applicability of the method is demonstrated solely on vision classification tasks, which limits the scope of the contribution. Given the simplicity and generality of the proposed formulation, it would be more compelling to show its effectiveness across a broader set of domains or tasks.\n\n3. The theoretical explanation is overly reliant on the supplementary material. While it is acceptable to place extended proofs in the appendix, the main text should still provide enough intuition and explanation for readers to understand the formulation without constantly referring to the supplement. As it stands, readers may find it difficult to follow the logic behind the proposed metric.", "was_revised": true, "final_justification": "This paper proposes LogitGap, a simple yet practical and powerful algorithm for OOD detection. The authors justify their focus on the CLIP encoder setting by noting that existing energy-based methods underperform in this context.\n\nMany reviewers initially pointed out areas for improvement in the introduction, figures, and theorems. However, the authors responded effectively with additional experiments that demonstrated the strengths of their methodology and presented a concrete plan for revision. Furthermore, they highlighted their method's impressive generality by showing strong performance on tasks beyond image classification, such as audio classification.\n\nWhile there were initial concerns regarding the quality of the draft and the novelty of applying a classical method, the authors' thorough rebuttal and the clear empirical strengths of their work are highly convincing. The demonstrated effectiveness, the successful resolution of key issues, and the method's broad applicability are significant strengths. For these reasons, I have decided to raise my score from my initial rating.", "rebuttal": "### **W1.1 The theoretical motivation ... are not fully verified or supported.**\n\n- Our theoretical motivation stems from the observed distinction in logit patterns between ID and OOD samples: (i) Higher maximum logit values for ID samples; (ii) Higher non-predicted class logits in OOD samples.\n\n- To verify the generality of this phenomenon, we conduct experiments across various ID/OOD datasets and model architectures. Specifically, we report the average maximum logit, and the average logit of non-predicted classes, using ResNet-50, ViT-B/16, and ViT-L/14 as backbone models. As shown in the table below, the results support our hypothesis.\n\n| ResNet50  | max logit | average logit across non-predicted classes |\n| --------- | :-------: | :------------------------: |\n| CIFAR-10 (ID) | 9.020      | -0.1185                    |\n| CIFAR-100 | 7.6920        | 0.3973                     |\n| TIN       | 7.1911       | 0.5673                     |\n| Texture   | 5.5383         | 0.8482                     |\n| SVHN      | 5.5130      | 0.8406  |\n\n| CLIP ViT-B/16 | max logit |  average logit across non-predicted classes |\n| ------------- |  :--------: | :------------------------: |\n| ImageNet (ID) | 30.82     |  17.32                      |\n| iNaruralist   | 26.48     |  17.89                      |\n| SUN           | 26.71     |  17.90                      |\n| Textures      | 28.72     |  18.94                      |\n\n| CLIP ViT-L/14 | max logit | average logit across non-predicted classes |\n| ------------- | :-------: | :----------------------------------------: |\n| ImageNet (ID) |   25.76   |                   11.19                    |\n| iNaturalist   |   20.72   |                   11.65                    |\n| Textures      |   23.85   |                   13.18                    |\n| ImageNet-O    |   21.14   |                   12.16                    |\n\n-----\n\n### **W1.2: Figure 2 lacks critical context — it is unclear under what setting it was generated.**\n\nFigure 2 was generated using the CLIP ViT-B/16 model, with ImageNet100 as ID dataset and iNaturalist as OOD dataset. The logit curves represent the average logits computed over the entire test set, offering a generalizable summary of the model's behavior rather than illustrating a specific example.\n\n-----\n\n### **W2 & L3. Limited generalization beyond vision classification tasks.**\n\nWhile our method is primarily designed for visual classification (a core OOD detection scenario), we also demonstrate its broader applicability. We  evaluate it on  **audio classification**  using  **ESC-50 dataset**, where 50 classes are randomly split into 25 ID and 25 OOD classes. The method is applied with the CLAP [3] model, following the original hyperparameter strategy with $N$ set to 20% of the class count ($N = 5$).\n\nAs shown in the table below, our method is also effective beyond vision. Crucially, our method does not rely on modality-specific features or architectures, making it **easily portable to other domains**.\n\n|          | FPR95 $\\downarrow$ | AUROC $\\uparrow$ | AUPR $\\uparrow$ |\n| -------- | ------------------ | ---------------- | --------------- |\n| MCM      | 26.4               | 94.86            | 95.35           |\n| MaxLogit | 40.6               | 92.32            | 92.51           |\n| Energy   | 42.1               | 91.76            | 92.09           |\n| MCM_topN | 27.9               | 94.69            | 95.21           |\n| GEN      | 24.10              | 95.55            | 95.96           |\n| Logitgap | **17.5**           | **96.15**        | **96.48**       |\n\n-----\n\n### **W3 & L2. Excessive reliance on supplementary material for theoretical explanation.**\n\nWe agree that adding clearer intuition in the main text would improve accessibility and we will revise the main paper accordingly. Specifically:\n\n+ We will provide a clearer explanation for FPR:  **False Positive Rate (FPR)** measures the likelihood of an ID sample being misclassified as OOD. A lower FPR indicates better OOD detection performance.\n+ we will  expand the explanations for Theorem 4.1: Our analysis (Theorem 4.1) shows that LogitGap achieves a lower FPR than MCM when the  temperature $\\tau$ exceeds a threshold $z'_1\\cdot \\frac{K-1}{\\ln K}$. This implies that LogitGap better preserves  discriminative logit information, avoiding the over-smoothing effects introduced by softmax in MCM.  \n\nThus, the lower FPR of LogitGap confirms its effectiveness in distinguishing ID from OOD samples compared to MCM.\n\n-----\n\n### **L1: Motivation Example in Section 4.1 may be unintuitive.**\n\nWe agree that the current example might be unintuitive from a classification perspective. In the revision, we will clarify this point by rephrasing Line 139-141 as follows:\n\n*\"Since OOD samples tend not to show confident alignment with any known class, sample z2 is more likely to be in-distribution than sample z1. However, the maximum softmax probability for both is identical: ...\"*\n\n-----\n\n### **Q1. The choice subtraction-based formulation in LogitGap needs further justification, with experimental comparisons to alternative designs like weighting the MCM score or other aggregation strategies to strengthen the claim of its effectiveness.**\n\nWe subtract the average of remaining logits from the maximum logit because ID samples typically show larger maximum logits and smaller remaining logits than OOD samples. This pattern enhances the ID/OOD distinction, improving detection performance.\n\nWe evaluate alternatives on  CLIP ViT-B/16 with ImageNet as ID data:\n1. MCM_MaxLogit, a weighted combination of MCM and MaxLogit, which improves upon both but is still outperformed by LogitGap (see table below).\n2. Two LogitGap variants—LogitGap_exp and LogitGap_sqrt—applying exponential and square transformations to amplify score differences. Results show these variants perform comparably to the original LogitGap, indicating different transformations can yield similarly effective discrimination. These comparisons will be included in the revised manuscript.\n\n\n|                     |                    | ninco            |                 |                    | ImageNet-O       |                 |                    | ImageNet-OOD     |                 |                    | Avg              |                 |\n| ------------------- | ------------------ | ---------------- | --------------- | ------------------ | ---------------- | --------------- | ------------------ | ---------------- | --------------- | ------------------ | ---------------- | --------------- |\n|                     | FPR95 $\\downarrow$ | AUROC $\\uparrow$ | AUPR $\\uparrow$ | FPR95 $\\downarrow$ | AUROC $\\uparrow$ | AUPR $\\uparrow$ | FPR95 $\\downarrow$ | AUROC $\\uparrow$ | AUPR $\\uparrow$ | FPR95 $\\downarrow$ | AUROC $\\uparrow$ | AUPR $\\uparrow$ |\n| MCM                 | 79.67              | 73.59            | 95.87           | 75.85              | 79.52            | 98.93           | 80.98              | 78.33            | 85.42           | 78.83              | 77.15            | 93.41           |\n| MaxLogit            | 79.41              | 74.35            | 96.03           | 77.15              | 77.85            | 98.79           | 75.85              | 78.67            | 85.16           | 77.47              | 76.96            | 93.33           |\n| MCM$\\times$MaxLogit | 78.31              | 74.76            | 96.12           | 75.70              | 78.96            | 98.87           | 75.77              | 79.36            | 85.95           | 76.59              | 77.69            | 93.65           |\n| LogitGap            | 77.42              | 76.51            | 96.38           | 71.95              | 81.45            | 99.03           | 75.4               | 80.27            | 86.21           | 74.92              | 79.41            | 93.87           |\n| LogitGap_exp        | 77.15              | 76.67            | 96.42           | 71.40              | 81.54            | 99.04           | 74.33              | 80.55            | 86.51           | 74.48              | 79.59            | 93.99           |\n| LogitGap_sqrt       | 77.15              | 76.43            | 96.36           | 71.5               | 81.58            | 99.04           | 75.44              | 80.36            | 86.33           | 74.7               | 79.46            | 93.91           |\n\n-----\n\n### **Q2. A fair evaluation of MCM should consider N values derived similarly to LogitGap’s.**\n\nTo address this concern, we introduce MCM_topN, a comparative baseline that applies the top-N strategy to MCM. For fair comparison, we use the same $N$ for MCM_topN and our LogitGap. Experiments on CIFAR-10 (ID dataset) show that applying the top-N strategy to MCM does not consistently improve performance. Moreover, LogitGap outperforms both MCM and MCM_topN across all 6 benchmarks (see table below).\n\n\n|          | CIFAR100  | TIN      | MNIST     | SVHN     | TEXTURE   | PLACES365 |\n| -------- | --------- | -------- | --------- | -------- | --------- | --------- |\n| MCM      | 87.19     | 88.87    | 92.63     | 91.46    | 89.89     | 88.92     |\n| MCM_topN | 87.22     | 88.65    | 91.87     | 91.12    | 89.61     | 88.63     |\n| LogitGap | **88.01** | **89.7** | **93.44** | **92.1** | **90.73** | **89.74** |\n\n\n[1] A Baseline for Detecting Out-of-Distribution Examples in Image Captioning. ICLR 2017.\n\n[2] Delving into Out-of-Distribution Detection with Vision-Language Representations. NeurIPS 2022. \n\n[3] CLAP: Learning Audio Concepts From Natural Language Supervision. ICASSP 2023."}, {"review_id": "0MOWtobMky", "reviewer": "Reviewer_L4Ge", "summary": "This work proposes a post-hoc OOD score based on the gap between the maximum logit and the remaining logits. Specifically, they focus on the Top-$N$ logits,  the threshold $N$ is computed using only a small number of ID samples.  If ID samples are not available, $N$ is set to be 20% of the total number of classes $K$.", "questions": "See weaknesses.", "limitations": "yes", "rating": 4, "confidence": 5, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": 2, "clarity": 2, "significance": 2, "originality": 2, "strengths_and_weaknesses": "Strengths:\n- The idea is simple and effective compared to Maxi-Logit.\n- It demonstrates the performance of LogitGap on both semantic-shifted OOD detection and covariate-shifted OOD detection.\n- Experiments on semantic-shift OOD detection are conducted under both zero-shot and few-shot settings. \n\nWeaknesses:\n- The introduction section is poorly written. \n    - Line 27-18, I would say energy score is the most representative OOD score because of its simplicity and effectiveness compared to MSP score. \n    -  Line 32-33, it is true that MCM/MSP lacks information from other logits.  However, it's abrupt that the authors simply ignore the energy score (using full logit information) and directly raise the question of utilizing information from non-maximum logits. Could the authors clarify their reasoning for overlooking the energy score and elaborate on their motivation at this point?\n    - Line 38-40, although the authors make an effort to demonstrate the effectiveness of LogiGap in Figure 1, the caption does not provide any information about the datasets or models used. Additionally, I believe the authors should include energy score for comparison in Figure 1.\n\n\n- The experiments are not sufficient. \n    -  For zero-shot OOD detection setting, two baselines are missing including GL-MCM [1] and TAG [2]. Meanwhile, the performed   OOD benchmark is not standard. Specifically, the evaluation of far-OOD detection is missing.  See https://zjysteven.github.io/OpenOOD/ for complete evaluation. \n    -  For traditional OOD detection, two baselines are missing in the experiments section including ViM (using information from logit and feature) and GEN [3] (using information from probability space). Meanwhile, is there any reason that the authors switch from the large OOD benchmark (ImageNet-1k as ID dataset) to small OOD benchmark (CIFAR-10 as ID dataset)? Additionally, the results across different models such as ViT and BiT are also expected to present.\n    - All results are only demonstrated in CLIP ViT-B-/16, which fails to show the generalization of the proposed method across different models. If the authors focus on the vision-language models,  it is expected to evaluate on the other ViT models including ViT-B/32 and ViT-L/14 and ResNet-based models including ResNet-50 and ResNet-101. \n    - To support the claim in Line 159 -161, a more comprehensive empirical evaluation across different ID and OOD datasets with different models should be done.\n \n\nMinor weaknesses:\n- What datasets and models are utilized to produce Figure 2? \n- Line 50-51, the concept of focusing on the top-N logits is also mentioned in GEN [1], which demonstrates that using the energy score with top 10% of logit values improves OOD performance.  Again, the author probably could try to compare the performance of LogitGap with the energy score using top 10% logit information. \n- Based on the results in Table 3, specifically the FPR95 and AUROC metrics, it does not appear that OOD detection on ImageNet-10 and ImageNet-20 is particularly challenging, as the FPR95 values are close to 0 and the AUROC values are near 100.\n\n \n[1] GL-MCM: Global and Local Maximum Concept Matching for Zero-Shot Out-of-Distribution Detection, 2023.\n\n[2] TAG: Text Prompt Augmentation for Zero-Shot Out-of-Distribution Detection, 2024.\n\n[3] GEN: Pushing the Limits of Softmax-Based Out-of-Distribution Detection, 2023.", "was_revised": true, "final_justification": "During the rebuttal, the authors have addressed most of my initial concerns, and I am willing to increase my score. \nHowever, I believe the authors should revise the manuscript to better contextualize the contribution of LogitGap and include additional experiments to support the claims in the paper, e.g., ... achieves state-of-the-art performance .... .\n\nBased on the rebuttal results,  LogitGap achieves performance comparable to GEN without access to ID images. When ID images are available, LogitGap combined with Residual achieves outperforms ViM. In that case, GEN combined with Residual should also be evaluated for a fair comparison. My concern is that the manuscript overstates the performance of LogiGap due to incomplete comparisons. \n\nI believe the main contribution of LogitGap lies in its effectiveness on zero-shot and few-shot OOD detection (using CLIP-style models). Therefore,  the title and abstract should be revised to reflect this main message more accurately.", "rebuttal": "### W1: The introduction section is poorly written.\n\n**W1.1&1.2: Energy-based method is the most representative OOD score, which also utilizes information from non-maximum logits. Could the authors clarify their reasoning for overlooking this method?**\n\nWe would like to clarify that the energy-based method differs significantly from the other methods mentioned in the introduction, such as MaxLogit, MSP, and LogitGap. The energy-based method distinguishes between ID and OOD samples based on **likelihood density**, with the idea that high-energy points correspond to low likelihood density, making them more likely to be OOD samples. In contrast, the other methods focus on the **logit pattern**, with the idea that ID samples typically produce more peaked logits, while OOD samples corresponds to more uniform logit patterns. For this reason, we chose not to discuss energy-based methods in the introduction.\nIn the experments, we **have compared energy-based methods with our LogitGap**, and results show that LogitGap outperforms the energy score across multiple benchmarks (see Table 1, 2 and 3).\nIn addition, while energy-based method utilizes the non-maximum logits, we observe notable limitations of it from experimental results:\n\n- Energy-based method is **not compatible with zero-shot OOD scenarios** (see Tables 1, 2, and 3) when using a pre-trained CLIP model. \nWe attribute this to different training losses: CLIP model is trained using an image-text contrastive loss, which differs significantly from the NLL loss commonly assumed in energy-based methods. \nAs a result, energy-based methods perform poorly in this setting, since high energy values do not necessarily correspond to low likelihood densities during inference.\n- The log-sum-exp formulation is **numerically dominated by the largest logit**, which makes it behave similarly to MaxLogit in many cases.\n\n**W1.3: The caption of Figure 1 lacks information about datasets and models used. Additionally, the comparsion with energy-based method should be included in Figure 1.**\n\nThanks to point out this problem. The results in Figure 1 are reported on the zero-shot OOD scenario with CLIP ViT-B/16 model. In this experiment, categories from ImageNet-20 are used as ID, while those from ImageNet-10 are used as OOD.\nFor the comparison with energy-based method in Figure 1, we will revise Figure 1 in our updated version.\n\n### W2: The experiments are not sufficient.\n\n**W2.1: Missing baselines like GL-MCM and TAG in zero-shot OOD detection.**\n\nWe report the results of GL-MCM and TAG in the table below.\nThe experiments are conducted using CLIP ViT-B/16, with ImageNet categories as ID classes and categories from other benchmarks as OOD classes.\nAs shown in Table 2.1, LogitGap achieves comparable or better performance than the two methods on average across multiple benchmarks.\n\n|Table 2.1|ninco||ImageNet-O ||ImageNetOOD ||ssb_hard  |||AVG||\n|-|-|-|-|--|-|-|-|--|-|-|-|\n|Method|FPR95|AUROC|FPR95|AUROC|FPR95|AUROC|FPR95|AUROC|FPR95↓|AUROC↑|AUPR ↑ |\n|Energy|84.1|72.0|81.6|75.6|79.1|76.8|91.3|59.6|84.0|71.0|84.1|\n|+TAG|83.1|71.2|79.7|77.1|78.3|78.0|93.9|57.3|83.8|70.9|84.3|\n|MCM|79.7|73.6|75.9|79.5|81.0|78.3|89.5|63.8|81.5|73.8|85.9|\n|+TAG|81.6|71.3|77.6|79.9|83.0|78.8|90.6|63.3|83.2|73.3|86.1|\n|MaxLogit|79.4|74.4|77.2|77.9|75.9|78.7|89.6|60.7|80.5|72.9|84.7|\n|+TAG|77.7|73.9|74.5|79.5|**75.2**|80.1|91.6|59.1|79.8|73.2|85.1|\n|GL-MCM|**74.4**|76.0|72.4|79.5|79.2|77.3|**87.4**|**66.1**|78.3|74.7|86.2|\n|LogitGap|77.4|**76.5**|**71.9**|**81.5**|75.4|**80.3**|88.2|64.5|**78.2**|**75.7**|**86.4**|\n\n**W2.2: The performed OOD benchmark is not standard. Evaluation for far-OOD detection is missing.**\n\nOur benchmark design is inspired by recent observations [1], which highlight that **existing OOD datasets often mix covariate and semantic shifts**, making it difficult to isolate and accurately measure a model’s ability to detect true *semantic shift*. To address this, we construct a more challenging benchmark using NINCO, ImageNet-O, and ImageNet-OOD to emphasize **semantic shift** under a high-coverage, diverse, and realistic setting.\n\nMoreover, we have followed the OpenOOD protocol and added results on the far OOD scenario in Table 2.2 and included a comparison with the SSB_Hard dataset in Table 2.1 with ImageNet as ID set. These additions confirm LogitGap's robustness under a broader distributional shift.\n\n|Table2.2|iNaturalist||Textures||OpenImage-O |||AVG||\n|-|-|-|-|-|-|-|-|-|-|\n||FPR95|AUROC|FPR95|AUROC|FPR95|AUROC|FPR95↓|AUROC↑|AUPR↑|\n|Energy|73.9|87.1|92.7|66.1|65.6|85.91|77.4|79.7|95.5|\n|MCM|31.5|94.4|58.8|85.8|40.8|91.99|43.7|90.7|97.9|\n|MaxLogit|56.3|90.5|86.5|71.9|51.9|88.93|64.9|83.8|96.4|\n|LogitGap|**27.8**|**94.9**|**58.2**|**85.7**|**37.3**|**92.7**|**41.1**|**91.1**|**98.0**|\n\n**W2.3: Missing baselines like ViM and GEN in traditional OOD detection.**\n\nWe report the results of ViM and GEN in the table below.\nThe experiments are conducted in traditional OOD detection setting, using CIFAR-10 as ID dataset.\nSpecifically, since VIM requires training set statistics, we randomly selected 100 samples from the training set for estimation. In Table 2.3, LogitGap remains competitive, further validating its general applicability. \n\n|Table2.3|Near|OOD|Far|OOD|\n|-|-|-|-|-|\n|method|FPR95 ↓|AUROC ↑|FPR95 ↓|AUROC ↑|\n|ViM|68.7|71.4|56.7|75.5|\n|GEN|53.7|88.2|34.7|91.4|\n|Energy|61.3|87.6|41.7|91.2|\n|Energy+top10%|61.3|87.5|41.7|91.1|\n|LogitGap|**44.5**|**88.9**|**30.1**|**91.5** |\n\n**W2.4: Is there any reason that the authors switch from the large OOD benchmark (ImageNet-1k as ID dataset) to small OOD benchmark (CIFAR-10 as ID dataset)?**\n\nThank you for this question.\nWe report results on the small-scale OOD benchmark to demonstrate the generality of our method.\nWe also conduct experiments on a larger OOD benchmark (CIFAR-100 as ID dataset) in the Appendix C.5.\nFurthermore, we additionally report results on ImageNet-1k with ResNet50 under the traditional OOD setting in following table, using SSB-Hard and NINCO as Near-OOD datasets, and iNaturalist, Textures, and OpenImage-O as Far-OOD datasets. Due to space limitations, we report the average performance of the method across all datasets.\nAs shown in the table, our LogitGap achieves comparable or better performance than other methods across different benchmarks, and obtains the best average performance overall.\n\n|Table2.4|AVG||\n|--|--|-|\n|method|FPR95|AUROC|\n|MSP|49.1|84.6|\n|MaxLogit|50.1|84.3|\n|KLM |57.0|83.2|\n|ODIN|55.4|83.6|\n|Energy|50.5|84.0|\n|Energy+top10%|50.5|84.0|\n|LogitGap|**47.6**|**84.7**|\n\n**W2.5: For traditional OOD detection, the results across different models such as ViT and BiT are also expected to present.**\n\nHere, we report additional results in traditional OOD setting with different models, including Swin-T (Table 2.5.1) and ViT-B/16 (Table 2.5.2), to highlight the method's generalization.\nIn experiments, we utilize ImageNet-1k as ID dataset and other benchmarks as OOD datasets.\nAs shown in Table 2.5.1 and 2.5.2, our LogitGap achieves better performance than other comparative methods across different models.\n\n|Table2.5.1|Near|OOD|Far|OOD|\n|-|--|-|-|-|\n|method|FPR95 ↓|AUROC ↑|FPR95 ↓|AUROC ↑|\n|MSP|76.1|76.6|59.3|86.4|\n|MaxLogit|77.3|75.7|67.8|84.8|\n|Energy|78.3|73.2|75.6|81.3|\n|LogitGap|**69.6**|**78.2**|**39.1**|**89.7**|\n\n|Table2.5.2|Near|OOD|Far|OOD|\n|-|-|-|-|-|\n|method|FPR95 ↓|AUROC ↑|FPR95 ↓|AUROC ↑|\n|MSP|90.7|70.6|68.3|85.5|\n|MaxLogit|92.3|68.3|79.2|83.5|\n|Energy|93.2|62.4|85.3|79.0|\n|LogitGap|**85.0**|**72.7**|**47.6**|**88.6**|\n\n**W2.6: For zero-shot OOD detection, it is expected to evaluate on the other CLIP variants, including ViT models and ResNet models.**\n\nWe extend our experiments to other CLIP variants including ViT-L/14 and ResNet-101. Results in Table 2.6 demonstrate that LogitGap generalizes well across architectures. As shown in the table below, our method consistently outperforms baselines across all backbones, indicating strong generalization. These results have been included in the revised version of the paper.\n\n|Table2.6|Near|OOD|Far|OOD|\n|-|-|-|-|-|\n|**ViT-L/14**|FPR95↓|AUROC↑|FPR95↓|AUROC↑|\n|Energy|82.0|73.9|76.5|79.2|\n|MCM|74.4|77.7|41.1|90.8|\n|MaxLogit|77.1|75.9|63.2|83.2|\n|LogitGap|**68.9**|**80.3**|**38.0**|**91.6**|\n|**RN-101**|||||\n|Energy|88.1|67.9|94.2|69.6|\n|MCM|85.9|70.3|58.0|87.4|\n|MaxLogit|85.9|69.9|86.8|75.5|\n|LogitGap|**84.9**|**71.9**|**57.5**|**87.4**|\n\n**W2.7: To support the claim in Line 159 -161, a more comprehensive evaluation across different ID/OOD datasets with different models should be done.**\n\nTo further support our claim, we report statistical information on the logits distribution across multiple datasets (**see our response to Reviewer 4oYE’s Comment W1**). These results show that the observed logit pattern is consistently present across diverse datasets.\n\n### MW1: What datasets and models are utilized to produce Figure 2?\n\nFigure 2 was produced using the CLIP ViT-B/16 model, with ImageNet100 as the ID and iNaturalist as the OOD dataset. \n\n### MW2: Compare LogitGap with the energy score using top 10% logit information.\n\nWe have compared LogitGap with top-10% energy scoring and found LogitGap achieves consistently better results (see Table 2.3, 2.4), validating its stronger separability for OOD detection.\n\n### MW3: Experimental setup on ImageNet-10/ImageNet-20 is not particularly challenging. \n\nWe follow the experimental setup from previous works [2], alternately using ImageNet-10 and ImageNet-20 as the ID and OOD datasets to create a more challenging scenario.\nWhile existing methods achieve high AUROC scores in this setting, obtaining a low FPR95 remains difficult.\nFor example, LogitGap reduces FPR95 by 8.40% compared to MCM, highlighting its advantage in handling subtle distribution shifts.\n\n[1] IMAGENET-OOD: Deciphering Modern Out-of- Distribution Detection Algorithms, ICLR 24 \n\n[2] Delving into Out-of-Distribution Detection with Vision-Language Representations, NeurIPS 22"}, {"review_id": "SC6CdQKpGe", "reviewer": "Reviewer_AQ8y", "summary": "This paper addresses the under-utilization of the logit space in post-hoc OOD detection by proposing the LogitGap scoring function and its focused subset variant (LogitGap-topN). The main idea is to explicitly measure the average gap between the maximum logit and the other logits, and to improve separability between ID and OOD samples by retaining only the top-N logits to filter out noisy tail values.", "questions": "How well do synthetic OOD samples align with real OOD distributions, and how does this affect performance?", "limitations": "yes", "rating": 4, "confidence": 4, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": 2, "clarity": 4, "significance": 2, "originality": 2, "strengths_and_weaknesses": "**strengths**\n\n- The writing is very clear, articulating the motivation and method clearly\n- The method is simple and easy to use\n\n**weaknesses**\n\n- The biggest issue may be that the method itself is very trivial and lacks novelty. Research around logit magnitudes can be traced back to the last century, and the concept of logit gap proposed in this paper has similar concepts that were introduced as early as 2001 (Margin Sampling) [1], and has been discussed in many subsequent works. Therefore, the method and insights proposed in this paper are not novel.\n- The comparisons in the method section are not comprehensive enough. The zero-shot comparison targets in Tables 1 and 2 are all works from three years ago; while the effects when combined with other methods in Table 4 are often negative. In Table 5, the paper did not include several top-ranking works from the OpenOOD leaderboard for comparison, only comparing against methods with poorer performance.\n- The ablation study on hyperparameter N with only one figure (Fig 3) is insufficient. It would be better to provide more comprehensive data. As stated in the paper, N has a significant impact on logitgap performance, and it clearly needs different tuning for different datasets and models. Although the authors provide a synthetic OOD data scheme, whether synthetic OOD data aligns with real OOD distributions, and the impact of the alignment degree on final performance, need further discussion.\n\n**minor weaknesses**\n\n- The title of Table 2 in the supplementary material is incorrect\n\n[1] Tong, Simon, and Daphne Koller. \"Support vector machine active learning with applications to text classification.\" *Journal of machine learning research* 2.Nov (2001): 45-66.", "was_revised": true, "final_justification": "Most of my concerns have been resolved. Once the authors add the summary of related methods from the rebuttal and clarify the limitations about ImageNet-R in the final version, I believe the paper's overall contribution will meet the borderline for acceptance. However, these limitations prevent me from giving a higher score.", "rebuttal": "### **W1: The biggest issue may be that the method itself is very trivial and lacks novelty. Research around logit magnitudes can be traced back to the last century, and the concept of logit gap proposed in this paper has similar concepts that were introduced as early as 2001 (Margin Sampling).**\n\nWe agree that the general idea of utilizing logits has a long history, our method makes a novel contribution in the specific context of OOD detection: \n\n- **Revisit Logit Distribution in OOD Detection.** Traditional methods (e.g. MaxLogit and MSP) use only the maximum logit or probability as OOD score, overlooking the rich information in non-maximum logits.  Recent Energy-based methods instead link high energy to low likelihood, but they struggle in zero-shot (CLIP-based) settings and fail to explicitly model the logit distribution. In contrast, our method revisits the full logit distribution and proposes a novel logit-gap-based scoring function that better distinguishes ID from OOD samples. \n-  **Different Context and Objective.** While Margin Sampling also involves the concept of logit gap, it was designed for active learning to identify uncertain samples for labeling. In contrast, our LogitGap leverages the logit gap to score and detect OOD samples, particularly from unseen classes or styles. To our knowledge, this is the first work to adapt the logit gap specifically for OOD detection in zero- and few-shot settings.\n-   **Simple but effective.**  Although the proposed method is conceptually simple, it consistently demonstrates strong performance across various OOD detection tasks, including zero-shot, few-shot, hard and traditional settings. \n\n-----\n\n\n\n### **W2: The comparisons in the method section are not comprehensive enough.**\n\n### **W2.1: Zero-shot comparison baselines in Tables 1 and 2 are from three years ago.**\n\nIn response, we have added two recent zero-shot OOD detection methods [1,2]. See response to **reviewer L4Ge's Weakness 2.1(W2.1)** for details.  \n\n- **Training-free, post-hoc simplicity**: Many recent zero-shot OOD methods require additional training data [3,4] or external models [5]. Differently, LogitGap is a simple, training-free, post-hoc method directly applicable to pre-trained CLIP models. \n-  **Specialized for vision-language models**: Most post-hoc OOD methods target unimodal visual backbones (e.g., ResNet), and often struggle with vision-language models like CLIP,  underscoring the need for our specialized approach.\n\n### **W2.2: Effectiveness when combined with other methods in Table 4 are negative.**\n\nTable 4 evaluates the compatibility of LogitGap with existing fine-tuning methods. By simply replacing the OOD score, LogitGap improves performance on **9 out of 12** average metrics. The largest performance drop is under **0.2%**, indicating minimal downside. These results suggest that LogitGap can serve as a drop-in replacement in existing OOD frameworks, offering consistent gains with negligible risk.\n\n\n### **W2.3: Comparison in Table 5 did not include several top-ranking works from the OpenOOD.**\n\n+ **Training-Free & Data-Free Advantage**: Unlike top OpenOOD methods (e.g., OE-based approaches) that require large-scale data and training, LogitGap operates in a fully training-free and data-free manner.\n+  **Fair Comparison with Post-Hoc Baselines**: We benchmark against training-free post-hoc methods (e.g., SHE, NCI) in Table 5, where LogitGap shows superior performance.\n+  **Compatibility with Training-Based Methods**: LogitGap can also enhance training-based approaches—when combined with OE, performance further improves, demonstrating its versatility in OOD detection pipelines.\n\n-----\n\n\n\n\n### **W3.1: The ablation study on hyperparameter N with only one figure (Fig 3) is insufficient. It would be better to provide more comprehensive data.**\n\n  In below table, we provide a more ablation study on hyparameter $N$. Specifically, we conduct experiments under the zero-shot OOD detection setting, using either ImageNet-100 or ImageNet-1K as ID dataset. For simplicity, we report the FPR95 of our LogitGap method based on CLIP ViT-B/16 model. We can observe that: (1) Optimal  $N$ varies by dataset (e.g., 19 for ImageNet-100, 195 for ImageNet-1K); (2) Setting $N$ to 20% of total classes consistently provides strong performance. Therefore, we adopt this value as default in LogitGap.\n\n| ImageNet-100: N | 1     | 9     | 19    | 29    | 39    | 49    | 59    | 69    | 79    | 89    |\n| --------------- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- |\n| ImageNetOOD | 76.02 | 46.86 | 46.19 | 46.62 | 47.10 | 47.80 | 48.33 | 49.32 | 50.51 | 50.57 |\n| ImageNet-O  | 76.00 | 45.70 | 43.50 | 44.25 | 44.30 | 45.25 | 45.75 | 46.45 | 47.90 | 47.90 |\n\n| ImageNet-1k: N  | 5     | 95    | 195   | 295   | 395   | 495   | 595   | 695   | 795   | 895   |\n| --------------- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- |\n| ninco       | 83.26 | 77.34 | 76.81 | 76.56 | 76.40 | 76.74 | 77.00 | 77.53 | 78.29 | 78.68 |\n| ImageNet-O  | 81.80 | 71.85 | 72.45 | 73.20 | 73.40 | 73.55 | 73.95 | 74.30 | 74.85 | 75.50 |\n| ImageNetOOD | 82.49 | 75.47 | 76.38 | 77.16 | 77.64 | 78.26 | 78.74 | 79.19 | 79.72 | 80.31 |\n\n### **W3.2: Whether synthetic OOD data aligns with real OOD distributions, and the impact of the alignment degree on final performance, need further discussion.**\n\n- As stated in the paper, we propose a synthetic OOD sampling scheme to adaptively select $N$. Importantly, LogitGap also performs well **without synthetic OOD**, by simply setting $N$ to a fixed proportion (e.g., 20% of the number of classes). \n- We observe that while synthetic data may not fully capture real OOD characteristics, it is effective for selecting a suitable $N$ for LogitGap*. Please see our response to **Reviewer BQ1B's Weakness 3 (W3)** for more details.\n\n-----\n\n\n\n### **Minor W1. The title of Table 2 in the supplementary material is incorrect.** \n\nThank you for pointing this. We will fix it.\n\n\n\n[1] GL-MCM: Global and Local Maximum Concept Matching for Zero-Shot Out-of-Distribution Detection, IJCV 2025.\n\n[2] TAG: Text Prompt Augmentation for Zero-Shot Out-of-Distribution Detection, ECCV 2024.\n\n[3] CLIPN for Zero-Shot OOD Detection: Teaching CLIP to Say No, ICCV 2023.\n\n[4] Zero-Shot Out-of-Distribution Detection Based on the Pre-trained Model CLIP, AAAI 2022.\n\n[5] Envisioning Outlier Exposure by Large Language Models for Out-of-Distribution Detection, ICML 2024."}]

Author rebuttal:

Meta-review: The work proposes a new logit-based scoring method called LogitGap for OOD detection in vision-language models. The method shows effective performance under several challenging scenarios, such as zero-/few-shot setting and hard OOD detection, on some popular ID/OOD benchmarks.

Strengths of the work include: 1) simple yet effective method LogitGap, 2) good theoretical analysis and extensive empirical justification, and 3) well-organized paper.

There were a number of major concerns on technical novelty, reliance on validation set with ID (and synthetic OOD data) samples, unverified theoretical assumption, generalization beyond vision tasks, missing baselines, experiments limited to small ID/OOD benchmarks (e.g., missing results on ImageNet-1k data), outdated zero-shot detection contenders, insufficient ablation study.

After author rebuttal and author-reviewer discussion, all four reviewers confirmed that their main concerns have been adequately addressed, three of which increased their ratings to borderline accept. This leads to four border accept recommendations.

One key remaining concern is that the revisions required to be made are rather significant. The authors have promised on these changes, and should make every possible effort to accommodate all the requested revisions if the paper is accepted.
Decision: Accept (poster)