NegRefine: Zero-Shot OOD Framework
- NegRefine is a zero-shot OOD detection framework that systematically refines negative labels to reduce false positives in vision-language models.
- It employs an LLM-driven filtering mechanism to remove proper nouns and subcategory overlaps, enhancing reliability by mitigating label confusion.
- The method leverages a multi-matching-aware scoring function and shows improved AUROC and FPR95 metrics on benchmark datasets compared to prior approaches.
NegRefine is a zero-shot out-of-distribution (OOD) detection framework for vision-LLMs (VLMs), motivated by limitations in negative label-based methods that rely on large lexicons of negative textual labels. NegRefine systematically refines the negative label set and introduces a multi-matching-aware scoring function to mitigate false positives caused by label overlaps and improper negative sampling, enabling robust separation of in-distribution (ID) and OOD examples without extra fine-tuning (Ansari et al., 13 Jul 2025).
1. Limitations of Prior Negative Label-Based OOD Methods
Negative label-based OOD detection methods, such as NegLabel and CSP, operate by constructing a large negative lexicon (typically from WordNet) and contrasting a VLM’s similarity to (ID labels) versus . While this strategy is effective on broad classes, three pathologies degrade performance:
- Subcategory Overlap: Many negative labels are in fact subcategories of ID classes; since CLIP typically assigns higher similarity to specific (subcategory) prompts, images of e.g. “daisy” can match more strongly to “blue-eyed african daisy” (which is treated as OOD), causing misclassification.
- Proper-Noun Matches: Negative sets drawn from WordNet contain frequent proper noun entries (e.g., country names, places) that CLIP associates with generic concepts (e.g., “costa rica” matches “beach”). This increases false OOD detections when such negatives are spuriously matched.
- Multi-Label Matching: Real-world images often trigger both ID and (semantically related) negative labels, and in naive softmax-ratio scoring, negatives can dominate the score even when the ID class is present (e.g., a photo of a “bee” matches “tickseed sunflower,” driving OOD decision).
These effects result in high ID false positive rates and reduced robustness for existing zero-shot OOD methods (Ansari et al., 13 Jul 2025).
2. Negative Label Filtering Mechanism
NegRefine filters the negative label set by identifying and removing proper nouns and subcategory labels. Filtering is executed as a one-time offline procedure (Alg. 1 in (Ansari et al., 13 Jul 2025)), leveraging both CLIP and a LLM:
- Proper Noun Detection: Each candidate negative label is posed to the LLM (“Is a proper noun (name of an entity)?”). Labels for which the LLM returns “Yes” are collected into and excluded.
- Subcategory Detection: For non-proper-noun , the algorithm finds its top- nearest ID class labels using CLIP text-embedding similarity, then poses to the LLM for each : “Is 0 a subcategory of 1?” If true for any 2, 3 is added to the subcategory set 4.
The filtered negative set is
5
Empirically, this removes ∼20.6% of negatives as proper nouns and ∼3.6% as subcategories, reducing adverse overlap and ID confusion (Ansari et al., 13 Jul 2025).
3. Multi-Matching-Aware Scoring Function
The NegRefine scoring system augments the standard softmax-ratio (NegLabel-style) OOD score to explicitly account for cases where images match multiple labels. The overall ID score is: 6 where 7 are ID labels, 8 are filtered negatives (9), 0 is CLIP cosine similarity, 1.
To address multi-label matching, NegRefine selects the top-2 ID (3) and negative (4) labels for each image. For each 5, it constructs a composite caption “6 and 7” and computes: 8 The multi-matching term is
9
The final ID score is: 0 An image is classified as in-distribution if 1, where 2 is calibrated so that 95% of ID validation samples are accepted.
4. Algorithmic Structure and Computational Complexity
NegRefine’s workflow consists of an offline filtering stage and an efficient, fully zero-shot scoring scheme:
- Filtering Stage (NegFilter): For each negative label, LLM queries (for proper-noun and subcategory) are executed, and CLIP text similarity is computed to retrieve 3 most similar in-distribution classes for subcategory assessment. Complexity is 4.
- Inference per Image:
1. Compute CLIP similarities to all ID and filtered negative labels. 2. Compute 5 via (1). 3. Select top-6 from each set. 4. For each of 7 pairs, compute composite caption similarity and joint scores (8 via (2)). 5. Combine as 9. The per-image computational cost is 0 CLIP calls, with K=number of ID labels, M=filtered negatives, and 1.
5. Experimental Evaluation and Effectiveness
NegRefine is evaluated on ImageNet-1K (ID) with challenging OOD sets: iNaturalist, OpenImage-O, Clean, and NINCO. Metrics include AUROC (higher is better) and FPR95 (lower is better). The method is compared to CSP and ablated versions. Main results (ViT-B/16, zero-shot):
| Method | AUROC (avg) | FPR95 (avg) |
|---|---|---|
| CSP | 89.97 | 34.47 |
| NegRefine | 91.79 | 30.12 |
Component-wise ablation (ImageNet-1K, FPR95 avg):
| Variant | NegFilter | 2 | FPR95 |
|---|---|---|---|
| CSP (none) | – | – | 34.47 |
| + NegFilter only | ✓ | – | 31.88 |
| + 3 only | – | ✓ | 31.70 |
| NegRefine (both) | ✓ | ✓ | 30.12 |
Both filtering and multi-matching components yield measurable additive improvements.
Additional findings:
- Proper-noun filtering removes ~20.6% of raw negatives; subcategory filtering ~3.6%.
- Extended ablations show little effect from LLM choice, consistent gains across architectures (ResNet50, ViT variants), and optimal scoring settings at 4.
6. Hyperparameters and Tuning Procedures
Relevant parameters include:
- Negative fraction 5 of WordNet classes, balancing OOD coverage and noise.
- CLIP temperature 6.
- LLM filter neighbor pool 7.
- Matching parameters 8, 9; grid search on 0, 1 is recommended.
- Decision threshold 2 set for 95% ID recall.
This configuration is robust across OOD sets and CLIP backbones. A plausible implication is that performance is minimally sensitive to LLM model and moderately sensitive to matching hyperparameters.
7. Key Insights, Limitations, and Future Directions
Empirical evidence indicates that filtering “bad” negatives (proper nouns, subcategories) substantially reduces false OOD alarms for ID data; modeling multi-label matching with CLIP-style joint captions further addresses false positives when images match both ID and (otherwise problematic) negatives. NegRefine achieves fully zero-shot operation and is complementary to prompt tuning and test-time adaptation strategies (e.g., LAPT, AdaNeg).
Limitations include the reliance on LLMs for label filtering and the restriction to binary (“y and 3”) composite captions—richer n-ary constructs may provide additional robustness. A plausible implication is that as taxonomic resources like WordNet evolve, the cost of LLM-based filtering may be reduced. Extension to few-shot or supervised OOD, or application to alternative vision-language backbones (e.g., ALIGN), is outlined as future research.