Enhancing Near OOD Detection in Prompt Learning: Maximum Gains, Minimal Costs

2405.16091

YC

0

Reddit

0

Published 5/28/2024 by Myong Chol Jung, He Zhao, Joanna Dipnall, Belinda Gabbe, Lan Du
Enhancing Near OOD Detection in Prompt Learning: Maximum Gains, Minimal Costs

Abstract

Prompt learning has shown to be an efficient and effective fine-tuning method for vision-language models like CLIP. While numerous studies have focused on the generalisation of these models in few-shot classification, their capability in near out-of-distribution (OOD) detection has been overlooked. A few recent works have highlighted the promising performance of prompt learning in far OOD detection. However, the more challenging task of few-shot near OOD detection has not yet been addressed. In this study, we investigate the near OOD detection capabilities of prompt learning models and observe that commonly used OOD scores have limited performance in near OOD detection. To enhance the performance, we propose a fast and simple post-hoc method that complements existing logit-based scores, improving near OOD detection AUROC by up to 11.67% with minimal computational cost. Our method can be easily applied to any prompt learning model without change in architecture or re-training the models. Comprehensive empirical evaluations across 13 datasets and 8 models demonstrate the effectiveness and adaptability of our method.

Create account to get full access

or

If you already have an account, we'll log you in

Overview

ā€¢ This research paper focuses on enhancing near out-of-distribution (OOD) detection in prompt learning, with the goal of achieving maximum gains while minimizing costs.

ā€¢ The paper explores techniques to improve the ability of language models to identify inputs that are similar, but not identical, to the training data. This is an important challenge in prompt learning, where models are asked to perform tasks they were not explicitly trained for.

ā€¢ The proposed approaches aim to make models more robust to near-OOD inputs, which can help improve the reliability and safety of language AI systems in real-world applications.

Plain English Explanation

ā€¢ Language models like GPT-3 are trained on a vast amount of text data, which allows them to perform a wide variety of tasks when given the right "prompts." However, these models can struggle to identify inputs that are slightly different from their training data, known as "near out-of-distribution" (near-OOD) inputs.

ā€¢ This paper explores ways to enhance the ability of prompt-based language models to detect near-OOD inputs, which could be important for real-world applications where the model may encounter novel or slightly different inputs. The researchers test several techniques, such as learning transferable negative prompts and dual-adapter training, to see which methods can improve near-OOD detection with minimal additional training.

ā€¢ By making language models more robust to near-OOD inputs, the researchers hope to improve the reliability and safety of these systems when deployed in real-world settings, where they may encounter slightly different or novel inputs than what they were trained on. This could have important implications for overcoming pitfalls in vision-language model finetuning and improving the learnability of out-of-distribution detection.

Technical Explanation

ā€¢ The paper explores several techniques to enhance near-OOD detection in prompt learning, including:

  1. Learning transferable negative prompts - The researchers train a separate model to generate prompts that can help identify near-OOD inputs, which can then be used to fine-tune the main prompt-based model.

  2. Dual-adapter training - The researchers add a separate "adaptation" module to the main model, which can be trained on a small set of near-OOD examples to improve its ability to detect these inputs.

  3. Overcoming pitfalls in vision-language model finetuning - The researchers explore techniques to mitigate common issues that arise when finetuning vision-language models on new tasks, which can impact their ability to detect near-OOD inputs.

ā€¢ The paper evaluates the effectiveness of these approaches on a range of benchmark datasets and tasks, demonstrating that they can significantly improve near-OOD detection performance with minimal additional training.

Critical Analysis

ā€¢ The paper acknowledges that while the proposed techniques can enhance near-OOD detection, there are still limitations and areas for further research. For example, the effectiveness of the methods may depend on the specific task and dataset, and the paper does not explore the generalizability of the approaches across a wide range of applications.

ā€¢ Additionally, the paper does not address the potential computational and resource costs of implementing these techniques in real-world systems, which could be an important consideration for practical deployment.

ā€¢ It would be valuable for future research to further explore the learnability of out-of-distribution detection and how the proposed approaches can be optimized for efficiency and scalability.

Conclusion

ā€¢ This research paper presents novel techniques to enhance the near-OOD detection capabilities of prompt-based language models, with the goal of improving the reliability and safety of these systems in real-world applications.

ā€¢ The proposed methods, including learning transferable negative prompts and dual-adapter training, have shown promising results in experiments, demonstrating the potential to achieve significant gains in near-OOD detection with minimal additional training.

ā€¢ While the paper acknowledges some limitations and areas for further research, the insights and approaches discussed could have important implications for the development of more robust and versatile language AI systems.



This summary was produced with help from an AI and may contain inaccuracies - check out the links to read the original source documents!

Related Papers

Zero-Shot Out-of-Distribution Detection with Outlier Label Exposure

Zero-Shot Out-of-Distribution Detection with Outlier Label Exposure

Choubo Ding, Guansong Pang

YC

0

Reddit

0

As vision-language models like CLIP are widely applied to zero-shot tasks and gain remarkable performance on in-distribution (ID) data, detecting and rejecting out-of-distribution (OOD) inputs in the zero-shot setting have become crucial for ensuring the safety of using such models on the fly. Most existing zero-shot OOD detectors rely on ID class label-based prompts to guide CLIP in classifying ID images and rejecting OOD images. In this work we instead propose to leverage a large set of diverse auxiliary outlier class labels as pseudo OOD class text prompts to CLIP for enhancing zero-shot OOD detection, an approach we called Outlier Label Exposure (OLE). The key intuition is that ID images are expected to have lower similarity to these outlier class prompts than OOD images. One issue is that raw class labels often include noise labels, e.g., synonyms of ID labels, rendering raw OLE-based detection ineffective. To address this issue, we introduce an outlier prototype learning module that utilizes the prompt embeddings of the outlier labels to learn a small set of pivotal outlier prototypes for an embedding similarity-based OOD scoring. Additionally, the outlier classes and their prototypes can be loosely coupled with the ID classes, leading to an inseparable decision region between them. Thus, we also introduce an outlier label generation module that synthesizes our outlier prototypes and ID class embeddings to generate in-between outlier prototypes to further calibrate the detection in OLE. Despite its simplicity, extensive experiments show that OLE substantially improves detection performance and achieves new state-of-the-art performance in large-scale OOD and hard OOD detection benchmarks.

Read more

6/4/2024

šŸ”Ž

CLIPScope: Enhancing Zero-Shot OOD Detection with Bayesian Scoring

Hao Fu, Naman Patel, Prashanth Krishnamurthy, Farshad Khorrami

YC

0

Reddit

0

Detection of out-of-distribution (OOD) samples is crucial for safe real-world deployment of machine learning models. Recent advances in vision language foundation models have made them capable of detecting OOD samples without requiring in-distribution (ID) images. However, these zero-shot methods often underperform as they do not adequately consider ID class likelihoods in their detection confidence scoring. Hence, we introduce CLIPScope, a zero-shot OOD detection approach that normalizes the confidence score of a sample by class likelihoods, akin to a Bayesian posterior update. Furthermore, CLIPScope incorporates a novel strategy to mine OOD classes from a large lexical database. It selects class labels that are farthest and nearest to ID classes in terms of CLIP embedding distance to maximize coverage of OOD samples. We conduct extensive ablation studies and empirical evaluations, demonstrating state of the art performance of CLIPScope across various OOD detection benchmarks.

Read more

5/24/2024

Continual Unsupervised Out-of-Distribution Detection

Continual Unsupervised Out-of-Distribution Detection

Lars Doorenbos, Raphael Sznitman, Pablo M'arquez-Neila

YC

0

Reddit

0

Deep learning models excel when the data distribution during training aligns with testing data. Yet, their performance diminishes when faced with out-of-distribution (OOD) samples, leading to great interest in the field of OOD detection. Current approaches typically assume that OOD samples originate from an unconcentrated distribution complementary to the training distribution. While this assumption is appropriate in the traditional unsupervised OOD (U-OOD) setting, it proves inadequate when considering the place of deployment of the underlying deep learning model. To better reflect this real-world scenario, we introduce the novel setting of continual U-OOD detection. To tackle this new setting, we propose a method that starts from a U-OOD detector, which is agnostic to the OOD distribution, and slowly updates during deployment to account for the actual OOD distribution. Our method uses a new U-OOD scoring function that combines the Mahalanobis distance with a nearest-neighbor approach. Furthermore, we design a confidence-scaled few-shot OOD detector that outperforms previous methods. We show our method greatly improves upon strong baselines from related fields.

Read more

6/5/2024

Learning Transferable Negative Prompts for Out-of-Distribution Detection

Learning Transferable Negative Prompts for Out-of-Distribution Detection

Tianqi Li, Guansong Pang, Xiao Bai, Wenjun Miao, Jin Zheng

YC

0

Reddit

0

Existing prompt learning methods have shown certain capabilities in Out-of-Distribution (OOD) detection, but the lack of OOD images in the target dataset in their training can lead to mismatches between OOD images and In-Distribution (ID) categories, resulting in a high false positive rate. To address this issue, we introduce a novel OOD detection method, named 'NegPrompt', to learn a set of negative prompts, each representing a negative connotation of a given class label, for delineating the boundaries between ID and OOD images. It learns such negative prompts with ID data only, without any reliance on external outlier data. Further, current methods assume the availability of samples of all ID classes, rendering them ineffective in open-vocabulary learning scenarios where the inference stage can contain novel ID classes not present during training. In contrast, our learned negative prompts are transferable to novel class labels. Experiments on various ImageNet benchmarks show that NegPrompt surpasses state-of-the-art prompt-learning-based OOD detection methods and maintains a consistent lead in hard OOD detection in closed- and open-vocabulary classification scenarios. Code is available at https://github.com/mala-lab/negprompt.

Read more

4/5/2024