D 2 U : Distance-to-Uniform Learning for Out-of-Scope Detection (2022)

Abstract: Supervised training with cross-entropy loss implicitly forces models to produce probability distributions that follow a discrete delta distribution. Model predictions in test time are expected to be similar to delta distributions if the classifier determines the class of an input correctly. However, the shape of the predicted probability distribution can become similar to the uniform distribution when the model cannot infer properly. We exploit this observation for detecting out-of-scope (OOS) utterances in conversational systems. Specifically, we propose a zero-shot post-processing step, called Distance-to-Uniform (D2U), exploiting not only the classification confidence score, but the shape of the entire output distribution. We later combine it with a learning procedure that uses D2U for loss calculation in the supervised setup. We conduct experiments using six publicly available datasets. Experimental results show that the performance of OOS detection is improved with our post-processing when there is no OOS training data, as well as with D2U learning procedure when OOS training data is available.

## introduction automated conversational systems have recently received attention from the research community @xcite @xcite . in applications such as voice assistants, spoken language understanding @xcite aims to extract meaning from the user inputs, called utterances, in order to process and execute desired functionalities. the task of intent detection, or intent classification, aims to classify user utterance into a set of system-identifiable intents. however, supervised training of such systems can only cover a restricted set of classes, i.e. in-scope (ins) classes. to enhance user experience, the task of out-of-scope (oos) detection @xcite @xcite distinguishes ins utterances from those that do not belong to the scope of the classifier with dedicated model architectures and loss functions. existing methods in oos detection utilize the classifier confidence score for a given utterance with thresholding to classify highly confident predictions as ins and lower confidence predictions as oos. however, softmax classifiers suffer from overconfident predictions for oos data @xcite , which makes it difficult to accurately determine a threshold value. confidence loss @xcite mitigates this by calculating the kl divergence between model prediction and the uniform distribution to decrease the confidence for oos input. we adapt a similar idea to the zero-shot setup with a novel post-processing step and exploit it jointly in the supervised setup with a learning procedure. the joint application of supervised d2u learning and d2u post-processing forms a novel oos detection pipeline. figure 1 illustrates output probability distributions of a classifier for predicting the intent class for an ins and oos utterance. the classifier, trained only on ins utterances, is confused when oos utterance is given. the model assigns closer probabilities for different classes since there is no correct class for this oos utterance, hence the resulting distribution gets closer to a uniform distribution than a discrete delta distribution. based on this observation, we propose to measure the dissimilarity from or distance to the uniform distribution (d2u). statistical distance calculations between the prediction and uniform distribution enable the decision boundary to be more accurate. figure 2 illustrates possible benefits of using distance to the uniform distribution with crossentropy. the subplot at the left shows the distribution of the number of utterances according to their maximum likelihood estimate (mle) score. the subplot at the right shows the same distribution according to cross-entropy score between prediction probability and uniform distribution. a decision boundary or threshold can be easily determined using d2u's cross-entropy as a post-processing step without any oos training data. when oos training data is available @xcite , d2u can be used as a loss function to minimize the distance between oos predictions and the uniform distribution. such a loss function forces oos predictions to be less confident, and benefit d2u post-processing further. to test our hypothesis that d2u is a useful method for oos detection, we answer following research questions: ## distance-to-uniform oos detection for the data instance i, c i is the ground-truth label indicating the correct class. the cross-entropy loss between softmax model output and discrete delta function is given as follows. here, p (u i ) is the output probability distribution of the model for utterance u i in a batch of n utterances, and c i is the correct class label for the given utterance. this criterion implicitly forces the model to generate confident predictions for a given data point with maximal confidence score assigned to the ground-truth class label, and low prediction scores for the other classes. when an oos utterance is given to an intent classifier that is trained using only ins data, the classifier gets confused, i.e., the output probability distribution is more dissimilar to a delta distribution than what an ins utterance would result in. in other words, output distributions of oos samples get closer to the uniform distribution than that of ins samples, an observation that we exploit for oos detection. the conventional methods for oos detection make use of a pre-determined threshold value on the maximum likelihood estimate (mle) score assigned to the predicted label, given as follows.