Revisit Overconfidence for OOD Detection: Reassigned Contrastive Learning with Adaptive Class-dependent Threshold (2022)

Abstract: Detecting Out-of-Domain (OOD) or unknown intents from user queries is essential in a task-oriented dialog system. A key challenge of OOD detection is the overconfidence of neural models. In this paper, we comprehensively analyze overconfidence and classify it into two perspectives: over-confident OOD and in-domain (IND). Then according to intrinsic reasons, we respectively propose a novel reassigned contrastive learning (RCL) to discriminate IND intents for over-confident OOD and an adaptive class-dependent local threshold mechanism to separate similar IND and OOD intents for over-confident IND. Experiments and analyses show the effectiveness of our proposed method for both aspects of overconfidence issues.

## introduction out-of-domain (ood) detection is a key component of the task-oriented dialogue system @xcite @xcite . it aims to decide whether a user query falls outside the range of predefined supported intents and avoid performing wrong operations @xcite @xcite . due to the complexity of annotating ood intents, most work focus on unsupervised ood detection where there is no labeled ood data but only labeled in-domain (ind) data @xcite . no prior knowledge about ood intents makes it challenging to identify these unknown samples in the dialog system. existing unsupervised ood detection methods mostly follow the same framework: firstly learn intent representations via labeled in-domain (ind) data then employ detecting algorithms, such as maximum softmax probability (msp) (hendrycks ood ground truth input sentence (6)gas_type (7)who_made_you (8)smart_home (9)traffic (10)whisper_mode (1)todo_list (2)change_ai_name (3)change_user_name (4)what_is_your_name (5)user_name ood baseline predict can you call me a different name please clean the car windows error type over-confident ood over-confident ind class probability score (6) (7) (8) (9) (10) 0.2 0.4 0.6 0.8 1.0 class probability score (1) (2) (3) (4) (5) 0.2 0.4 0.6 0.8 1.0 global threshold change_user_name(ind) smart_home(ind) over-confident ood over-confident ind 0.0 0.2 0.4 0.6 0.8 1.0 threshold 0 200 400 600 800 1000 error num over-confident ind over-confident ood sum errors global threshold figure 2: number of error cases comparing overconfident ind and ood. global threshold denotes the best overall performance. and gimpel, 2017), local outlier factor (lof) @xcite , gaussian discriminant analysis (gda) @xcite to compute the similarity of features between ood samples and ind samples. for example, @xcite simply uses a fixed threshold on the ind classifier's probability estimate and predicts a query as ood only if its max logit is below the threshold. @xcite employs an unsupervised density-based novelty detection algorithm, local outlier factor (lof) to detect ood intents. further, @xcite proposes a supervised contrastive learning objective to learn discriminative intent features. however, these methods ignore the key challenge of ood detection, over-confidence. @xcite ; @xcite have theoretically proved that deep neural networks with the softmax classifier are prone to produce highly over-confident posterior distributions even for such abnormal ood samples. in this paper, we define the over-confidence issue from two aspects. in this paper, we propose a novel reassigned contrastive learning (rcl) to discriminate intent representations between semantically similar ind categories and an adaptive class-dependent local threshold mechanism to separate similar ind and ood intents. specifically, for over-confident ood, we first construct hard contrastive pairs among easily misclassified ind types using a pre-trained intent classifier. then we train a new model to learn discriminative intent representations for similar ind categories via supervised contrastive learning @xcite . we aim to sample hard contrastive batches where anchors and positives have the same class label but different classifier outputs (hard positives), and anchors and negatives have the same classifier output but different class labels (hard negatives). for over-confident ind, we propose an adaptive class-dependent local threshold mechanism to separate similar ind and ood intents. traditional detection methods like msp, gda, energy @xcite use a global threshold to identify the confidence score of a test query, ignoring the difference between each ind class with ood samples. we aim to adjust the class-dependent local threshold so that semantically correlated ood and ind classes have a higher threshold to mitigate the model's overconfidence to ind. our contributions are three-fold: (1) we perform a comprehensive study on the overconfidence issue of ood detection and analyze two-aspect reasons. (2) we propose a novel reassigned contrastive learning (rcl) to discriminate ind intents for overconfident ood and an adaptive class-dependent local threshold mechanism to separate similar ind and ood intents for over-confident ind. (3) experiments and detailed analyses demonstrate the effectiveness of our proposed method for both aspects of overconfidence issues. ## methodology figure 3 shows the overall architecture of our proposed rcl and class-dependent local threshold where rcl discriminates easily-confused ind intents and local threshold separates similar ind and ood intents. we follow a two-stage framework: first train an in-domain intent classifier in the training stage, then extract the intent feature of a test sample and employ the detection methods in the test stage. ## conclusion in this paper, we focus on the overconfidence issue of unsupervised ood detection. we find the reasons for overconfidence arise from two aspects: (1) ind classes have high semantic similarity. (2) ind and ood intents have spurious correlations. according to the two reasons, we respectively propose a novel reassigned contrastive learning (rcl) to discriminate ind intents for over-confident ood and an adaptive class-dependent local threshold mechanism to separate similar ind and ood intents for over-confident ind. we perform extensive experiments and comprehensive analyses to demonstrate the effectiveness of our approach. we hope to provide new guidance for future work.