Intent classification is a major task in spoken language understanding (SLU). Since most models are built with pre-collected in-domain (IND) training utterances, their ability to detect unsupported out-of-domain (OOD) utterances has a critical effect in practical use. Recent works have shown that using extra data and labels can improve the OOD detection performance, yet it could be costly to collect such data. This paper proposes to train a model with only IND data while supporting both IND intent classification and OOD detection. Our method designs a novel domain-regularized module (DRM) to reduce the overconfident phenomenon of a vanilla classifier, achieving a better generalization in both cases. Besides, DRM can be used as a drop-in replacement for the last layer in any neural network-based intent classifier, providing a low-cost strategy for a significant improvement. The evaluation on four datasets shows that our method built on BERT and RoBERTa models achieves state-of-the-art performance against existing approaches and the strong baselines we created for the comparisons. Spoken language understanding (SLU) systems play a crucial role in ubiquitous artificially intelligent voice-enabled personal assistants (PA). SLU needs to process a wide variety of user utterances and carry out user's intents, a.k.a. intent classification . Many deep neural network-based SLU models have recently been proposed and have demonstrated significant progress (Guo et al., 2014; Liu and Lane, 2016; Zhang and Wang, 2016; Wang et al., 2018; Goo et al., 2018; Chen et al., 2019) in classification accuracy. These models usually apply the closed-world assumption, in which the SLU model is trained with predefined domains, and the model expects to see the same data distribution I don't like Thriller in playlist Playlist deleted I am too cold Oven turned on Figure 1: Failure Examples of Unsupported Skills in AI Voice Assistants. during both training and testing. However, such an assumption is not held in the practical use case of PA systems, where the system is used under a dynamic and open environment with personal expressions, new vocabulary, and unknown intents that are out of the design scope. To address the challenges in open-world settings, previous works adopt varied strategies. Shen et al. (2018a, 2019c) use a cold-start algorithm to generate additional training data to cover a larger variety of utterances. This strategy relies on the software developers to pre-build all possible skills. Shen et al. (2019b,a) introduce a SkillBot that allows users to build up their own skills. Recently, Ray et al. (2018, 2019); Shen et al. (2018b, 2019d) enables an SLU model to incorporate user personalization over time. However, the above approaches do not explicitly address unsupported user utter-ances/intents, leading to catastrophic failures illustrated in Figure 1. Thus, it is critically desirable for an SLU system to classify the supported intents ( in-domain (IND) ) and reject unsupported ones ( out-of-domain (OOD) ) correctly. A straightforward solution is to collect OOD data and train a supervised binary classifier on both IND data and OOD data (Hendrycks et al., 2018). However, collecting a representative set of OOD data could be impractical due to the infinite compositionality of language. Arbitrarily selecting a subset could incur the selection bias, causing the learned model might not generalize to unseen OOD data. Ryu et al. (2017, 2018) avoid learning with OOD data by using generative models ( e.g., autoencoder and GAN) to capture the IND data distribution, then judge IND/OOD based on the reconstruction error or likelihood. Recently, Tan et al. (2019) utilizes a large training data to enable the meta-learning for OOD detection. Zheng et al. (2020) generates pseudo OOD data to learn the OOD detector. The above-discussed approaches require additional data or training procedures beyond the intent classification task, introducing significant data collection effort or inference overhead. This paper proposes a strategy based on neural networks to use only IND utterances and their labels to learn both the intent classifier and OOD detector. Our strategy modifies the structure of the classifier, introducing an extra branch as a regularization target. We call the structure a Domain-Regularized Module (DRM). This structure is probabilistically motivated and empirically leads to a better generalization in both intent classification and OOD detection. Our analysis focuses more on the latter task, finding that DRM not only outputs a class probability that is a better indicator for judging IND/OOD, but also leads to a feature representation with a less distribution overlap between IND and OOD data. More importantly, DRM is a simple drop-in replacement of the last linear layer, making it easy to plug into any off-the-shelf pre-trained models ( e.g. BERT (Devlin et al., 2019)) to fine-tune for a target task. The evaluation on four datasets shows that DRM can consistently improve upon previous state-of-the-art methods. In the application of intent classification, a user utterance will be either an in-domain (IND) utterance (supported by the system) or an out-of-domain (OOD) utterance (not supported by the system). The classifier is expected to correctly (1) predict the intent of supported IND utterances; and (2) detect to reject the unsupported OOD utterances. The task is formally defined below. We are given a closed world IND training set DIND = { x , y } = { ( x i , y i ) } Ni =1 . Each sample ( x i , y i ) , an utterance x i and its intent class label y i  { 1 . . . C } for C predefined in-domain classes, is drawn from a fixed but unknown IND distribution PIND ( x , y ) . We aim to train an intent classifier model only on IND training data DIND such that the model can perform: (1) Intent Classification: classify the intent class label y of an utterance x if x is drawn from the same distribution PIND as the training set DIND ; (2) OOD Detection: detect an utterance x to be an abnormal/unsupported sample if x is drawn from a different distribution POOD . Intent Classification is one of the major SLU components (Haffner et al., 2003; Wang et al., 2005; Tur and De Mori, 2011). Various models have been proposed to encode the user utterance for intent classification, including RNN (Ravuri and Stoicke, 2015; Zhang and Wang, 2016; Liu and Lane, 2016; Kim et al., 2017; Wang et al., 2018; Goo et al., 2018), Recursive autoencoders (Kato et al., 2017), or enriched word embeddings (Kim et al., 2016). Recently, the BERT model (Devlin et al., 2019) was explored by (Chen et al., 2019) for SLU. Our work also leverages the representation learned in BERT. OOD Detection has been studied for many years (Hellman, 1970). Tur et al. (2014) explores its combination with intent classification by learning an SVM classifier on the IND data and randomly sampled OOD data. Ryu et al. (2017) detects OOD by using reconstruction criteria with an autoencoder. Ryu et al. (2018) learns an intent classifier with GAN and uses the discriminator as the classifier for OOD detection. Zheng et al. (2020) leverages extra unlabeled data to generate pseudo-OOD samples using GAN via auxiliary classifier regularization. Tan et al. (2019) further incorporates the few-shot setting, learning the encoding of sentences with a prototypical network that is regularized with the OOD data outside a learning episode. Other researchers developed methods in computer vision based on the rescaling of the predicted class probabilities (ODIN) (Liang et al., 2017) or building the Gaussian model with the features extracted from the hidden layers of neural networks (Mahalanobis) (Lee et al., 2018). Recently, (Hsu et al., 2020) proposed Generalized-ODIN with decomposed confidence scores. However, both approaches also heavily depend on the image input perturbation to achieve good performance. Unfortunately, such perturbation cannot be applied to discrete utterance data in SLU. Our method is inspired by the decomposed confidence of Generalized-ODIN (Hsu et al., 2020), but we leverage the fact that the training data are all from IND to introduce an extra regularization. This regularization leads to a better generalization (lower classification error) on the intent classification. The improvement is in contrast to the original Generalized-ODIN, which has its classification error slightly increased. Since the improved generalization is likely due to a more generalizable feature representation, we leverage this observation, providing a modified Mahalanobis (Lee et al., 2018), which we called L-Mahalanobis, for a transformer-based model to detect OOD data. In the following sections, we first describe the DRM and then elaborate on using the outputs of a DRM-equipped model to detect OOD data. The motivation begins with introducing the domain variable d ( d = 1 means IND, while d = 0 means OOD) following the intuition in (Hsu et al., 2020), then rewrite the posterior of class y given x with domain d as follows: (cid:98) p ( y | d = 1 , x ) = (cid:98) p ( y , d = 1 | x ) (cid:98) p ( d = 1 | x ) = (cid:98) p ( y | x ) (cid:98) p ( d = 1 | x )  (cid:98) p ( y , d = 0 | x ) (cid:98) p ( d = 1 | x )  (cid:98) p ( y | x ) (cid:98) p ( d = 1 | x ) (1) where the last step holds since (cid:98) p ( y , d = 0 | x ) is close to 0 with the intrinsic conflict between IND classes y and random variable d = 0 for OOD. Motivated by the above Equation 1, we design the DRM to mitigate overconfidence by decomposing the final logits f into two branches. Figure 2 illustrates the architecture. Domain Logits f d models (cid:98) p ( d = 1 | x ) before normalization. It projects from hidden state h to a scalar w.r.t. d: f d = W d h + b d (2) where W d  R | h | 1 . Since (cid:98) p ( d = 1 | x ) is a probability between 0 and 1, Section 3.1.2 will describe the training details of domain loss via the sigmoid function. Classification Logits f c models the probability posterior (cid:98) p ( y | x ) before normalization. It follows the conventional linear projection from hidden state h to the number of classes: where W  R | h | C with C classes. d At the end, we obtain the final logits f to represent (cid:98) p ( y | d = 1 , x ) by putting f d and f c together following the dividend-divisor structure of Equation 1: f = f /f (4) We propose two training loss functions to train a model with DRM. The first training loss aims to minimize a cross-entropy between the predicted intent class and ground truth IND class labels. L classification (cid:44)  C (cid:88) i =1 y i log (cid:98) p ( f ) i (5) (cid:98) p ( f ) = softmax ( f ) The second training loss aims to ensure that the domain component f d is close to 1 since all utterances in the training set are IND. We first restrict f d between 0 and 1 by using sigmoid activation function. Then, this loss function encourages sigmoid ( f d ) close to 1 for training on IND utterances. In order to avoid f d to be very large values and affect the training convergence, we further apply clamp function on f d before feeds to Equation 4: f d = (cid:40) f d if   < f d <   if f d < =   or f d > = Thus, we sum them up to optimize the model: Remarks: It is important to note that the design of L domain is to introduce extra regularization to mitigate the overconfidence in standard posterior probability (cid:98) p ( f ) . sigmoid ( f d ) is not used to directly predict if an utterance is IND or OOD. There are two types of strategies to utilize the outputs of a classifier to perform OOD detection. One is based on the confidence which is computed from logits, the other is based on the features. In the below, we describe how to compute different OOD scores with our DRM. Recent works (Liang et al., 2017) has shown that the softmax outputs provide a good scoring for detecting OOD data. In our DRM model, we use the decomposed softmax outputs for the score. The logits f c w.r.t. the true posterior distribution in open-world can be combined with varied approaches: DRM Confidence Score: Conf DRM = softmax ( f c ) (8) DRM ODIN Confidence Score: ODINDRM = softmax ( f c /T ) (9) with large T = 1000 (Liang et al., 2017). DRM Entropy Confidence Score: ENTDRM = Entropy [ softmax ( f c )] (10) The OOD utterances have low Conf DRM ODINDRM scores and high ENTDRM score. While our DRM confidence already outperforms many existing methods (later shown in experi-ments), we further design the feature-based Mahalanobis distance score, inspired by the recent work (Lee et al., 2018) for detecting OOD images. We first recap the approach in (Lee et al., 2018) which consists of two parts: Mahalanobis distance calculation and input preprocessing. Mahalanobis distance score models the class conditional Gaussian distributions w.r.t. Gaussian discriminant analysis based on both lowand upper-level features of the deep classifier models. The score on layer (cid:96) is computed as follows: where f (cid:96) ( x ) represents the output features at the (cid:96) th -layer of neural networks;  i and  are the class mean representation and the covariance matrix. Thus, the overall score is their summation: In addition, the input preprocessing adds a small controlled noise to the test samples to enhance the performance. Although Mahalanobis distance score can be applied only to the last feature layer without input preprocessing S last Maha ( x ) , the analysis (Table 2 in (Lee et al., 2018)) shows that either input preprocessing or multi-layer scoring mechanism is required to achieve decent OOD detection performance. Unfortunately, neither of the above two mechanisms is applicable in the intent classifier for SLU. First, unlike image data, noise injection into discrete natural language utterances has been shown not to perform well. Second, in most cutting-edge intent classifier models, lowand upper-level network layers are quite different. The direct application of multilayer Mahalanobis distance leads to much worse OOD detection performance. Since BERT-based models showed significant performance improvement for intent classification in SLU (Chen et al., 2019), we focus on designing the multi-layer Mahalanobis score for BERT-based classifier models. In existing BERT-based text classification models, such as BERT, RoBERTa, Distil-BERT, ALBERT, etc., there are different designs between the last transformer layer and the classification layer. Figure 3 shows our generic design of Mahalanobis score computation (blue) for various BERT-based models. Our design is based on our extensive experiments and understanding of the common insights in different BERT-based models. Specifically, we use the features from different layers between the last transformer layer and the classification layer. We empirically found that the nonlinear tanh layer plays an important role. Thus, to map the features of each transformer layer and last layer into the same semantic space, we pass the features of each layer through tanh function and sum them up to compute our Mahalanobis score: SL  Maha ( x ) = S Maha ( f n ( x )) + (cid:88) 1  (cid:96)<n S Maha ( tanh ( f (cid:96) ( x ))) (11) where f (cid:96) and f n are the features of each layer (cid:96) and last layer n in a BERT-based intent classifier model. We refer to our proposed approach as L-Mahalanobis . We evaluate our proposed approach on three benchmark SLU datasets and one in-house SLU dataset. Table 1 provides an overview of all datasets. Among all these datasets, the recently released CLINC dataset serves as a benchmark for OOD detection in SLU. For the other three datasets, we treat them mutually OOD due to non-overlapping domains. We crowdsourced the in-house Movie dataset containing common questions that users may ask regarding movies. This dataset mainly consists of queries a user may ask in the movie domain. The dataset consists of 38 different intents (e.g. rating information, genre information, award information, show trailer) and 20 slots or entities (e.g., director, award, release year). This dataset was collected using crowdsourcing as follows. At first, some example template queries were generated by linguistic experts for each intent, along with intent and slot descriptions. Next, a generation crowdsourcing job was launched where a crowd worker was assigned a random intent, a combination of entities, and few slots generally associated with the intent. To better understand the intent and slots, the worker was asked to review the intent and slot descriptions, and example template utterances. The first task of the worker was to provide 3 different queries corresponding to the given intent, which also contains the provided entities. The second task of the worker was to provide additional entities corresponding to the same slot type. A subsequent validation crowdsourcing job was launched where these crowdsourced queries were rated by validation workers in terms of their accuracy with the provided intent and entities. Each query was rated by 5 different validation workers, and the final validated dataset contains a subset of crowdsourced queries with high accuracy score and high inter-rater agreement. We implemented our method using PyTorch on top of the Hugging Face transformer library (Wolf et al., 2019). We follow the hyperparameters in the original models. For the only hyperparame-ter  , we experimented only on CLINC dataset from 2.2 to 4 with uniform interval 0.2 (we try 10 values of  ) based on sigmoid (2 . 2)  0 . 9 and sigmoid (4)  0 . 982 . We used  = 3 which gives the best performance in our experiment for all datasets. We train each model with 3 epochs using 4 NVIDIA Tesla V100 GPUs (16GB) for each training. We conducted experiments on two transformer-based models, BERT (Devlin et al., 2019) and RoBERTa (Liu et al., 2019). Remarks: All experiments only use IND data for both training and validation. We use the same hyperparameters in all datasets and validate the generalizability of our method. We consider the strongest baseline BERT-Linear (the last layer is linear) fine-tuned on the pre-trained BERT-based models (Chen et al., 2019). We consider the existing OOD detection methods: ConGAN (Ryu et al., 2018): a GAN-based model based on given sentence representations to generate OOD features with additional feature matching loss. OOD utterances are expected to have low discriminator confidence scores. Autoencoder (AE) (Ryu et al., 2017): first uses an LSTM based classifier model to train sentence representations; then train an autoencoder on the above sentence embeddings. OOD utterances are expected to have high reconstruction error. ODIN (Liang et al., 2017): we only use the temperature scaling on logits. OOD utterances are expected to have a low scaled confidence score. Generalized-ODIN (G-ODIN) (Hsu et al., 2020): we fine-tune on pre-trained BERT models with replaced last layer and only use the decomposed confidence. We evaluate all three variations proposed in the paper h I , h E and h C and report the best one. OOD utterances are expected to have low scaled confidence score. Mahalanobis (Lee et al., 2018): we only use the feature of BERT's last layer to compute Mahalanobis distance score. OOD utterances are expected to have a low scaled confidence score. For ConGAN and AE, we evaluate the model in the original paper as well as customized BERT-based backbone models as strong baselines. Specifically, we customize En-ConGAN and En-AE as follows: En-ConGAN uses BERT sentence representation as input; En-AE applies a BERT classifier model to train the sentence representation and then use them to further train an autoencoder. Thus, En-ConGAN and En-AE are not existing baselines. Note that ERAEPOG (Zheng et al., 2020) and O-Proto (Tan et al., 2019) are not comparable since they require additional unlabeled data and labels. We only put the ERAEPOG results on CLINC dataset (from the original paper) for reference. We evaluate IND performance using the classification accuracy metric as in literature (Liu and Lane, 2016; Wang et al., 2018; Chen et al., 2019). we follow the evaluation metrics in literature (Ryu et al., 2018) and (Liang et al., 2017; Lee et al., 2018). Let TP, TN, FP, and FN denote true positive, true negative, false positive, and false negative. We use the following OOD evaluation metrics: EER (lower is better) : (Equal Error Rate) measures the error rate when false positive rate (FPR) is equal to the false negative rate (FNR). Here, FPR=FP/(FP+TN) and FNR=FN/(TP+FN). FPR95 (lower is better) : (False Positive Rate (FPR) at 95% True Positive Rate (TPR)) can be interpreted as the probability that an OOD utterance is misclassified as IND when the true positive rate (TPR) is as high as 95%. Here, TPR=TP/(TP+FN). Detection Error (lower is better) : measures the misclassification probability when TPR is 95%. Detection error is defined as follows: min  { PIND ( s   ) p ( x  PIND ) + POOD ( s >  ) p ( x  POOD ) } where s is a confidence score. We follow the same assumption that both IND and OOD examples have an equal probability of appearing in the testing set. AUROC (higher is better) : (Area under the Receiver Operating Characteristic Curve) The ROC curve is a graph plotting TPR against the FPR=FP/(FP+TN) by varying a threshold. AUPR (higher is better) : (Area under the Precision-Recall Curve (AUPR)) The PR curve is a graph plotting the precision against recall by varying a threshold. Here, precision=TP/(TP+FP) and recall=TP/(TP+FN). AUPR-IN and AUPR-OUT is AUPR where IND and OOD distribution samples are specified as positive, respectively. Note that EER, detection error, AUROC, and AUPR are threshold-independent metrics. We also evaluate the statistical significance between all baselines and our best result (DRM + L-Mahalanobis) on all the above metrics. We train each model 10 times with different PyTorch random seeds. We report the average results and t-test statistical significance results. Table 3 reports the IND intent classification results on each dataset finetuned using BERT and RoBERTa pre-trained models. It is interesting to observe that all DRM combined models consistently achieve better classification accuracy with up to 0.8% improvement (reproduced No joint row in Table 3 in (Chen et al., 2019) on Snips dataset). This is because the domain loss forces sigmoid ( f d ) close to 1 and therefore also slightly mitigates its impact to IND classification. Thus, the true posterior distribution of IND data is also modeled more precisely. For both BERT and RoBERTa Table 3: IND Intent Classification Results Model Last Layer Datasets CLINC ATIS Snips Movie BERT Linear 96.19  97.76  97.97  97.26  DRM* 96.66 98.21 98.23 97.87 RoBERTa Linear 96.82  97.64  98.07  98.07  DRM* 97.15 98.31 98.87 98.63 Our DRM methods (marked by *) are significantly better than baseline model on all datasets with p-value < 0 . backbones, DRM models are significantly better than conventional BERT-linear classification models with p-value < 0 . 05 . Results on CLINC Dataset: Table 2 reports the OOD detection results on CLINC dataset. This result covers all existing work and our enhanced baselines. We focus on analyzing the contribution by each of our proposed techniques, DRM and L-Mahalanobis. The first three rows report the performance of existing approaches based on the original designs in their papers (ERAEPOG in grey uses additional unlabeled data). Unfortunately, we observe that their performance is even worse than the simple confidence-based approach via BERT Table 4: OOD Detection Results on Snips/ATIS/Movie Datasets (RoBERTa Model Finetuning) OOD Method OOD Evaluation EER(  ) FPR95(  ) Detection Error(  ) AUROC(  ) AUPR In(  ) AUPR Out(  ) IND dataset: Snips; OOD Datasets: CLINC OOD/ATIS/Movie En-ConGAN 54.50  /63.05  /54.22  99.16  /99.87  /99.10  42.61  /49.10  /37.32  39.03  /30.88  /45.64  37.15  /34.47  /30.03  51.23  /45.70  /52.59  Confidence 9.91  /17.83  /22.22  14.94  /47.43  /51.85  9.18  /11.17  /19.34  96.09  /92.03  /87.44  94.78  /92.65  /97.67  97.21  /92.29  /55.16  Entropy 10.21  /18.05  /23.15  14.54  /45.04  /52.68  9.25  /10.77  /19.58  96.32  /92.44  /87.12  94.90  /92.94  /97.60  97.53  /92.99  /52.27  ODIN 10.01  /16.93  /23.15  14.22  /39.04  /58.33  9.43  /9.64  /23.01  96.46  /93.81  /83.58  94.59  /93.99  /96.63  97.75  /94.53  /47.36  G-ODIN 9.65  /15.16  /22.02  13.31  /37.86  /55.67  8.32  /8.55  /21.82  97.21  /94.73  /85.60  95.70  /95.04  /97.73  98.02  /95.44  /50.38  En-AE 4.40  /4.37  /3.59  4.18  /3.59  /3.08  4.25  /4.00  /3.64  98.56  /98.12  /88.96  97.41  /98.92  /94.39  98.12  /95.34  /86.84  Maha 3.90  /1.81/11.11  2.66  /2.23  /5.58  3.47  /1.36  /10.21  98.79  /99.74  /95.61  97.73  /99.75  /99.22  99.21  /99.77  /76.61  DRM+L-Maha* 3.00/1.79/2.78 1.95/0.00/2.78 2.63/1.16/3.16 98.90/99.79/98.53 98.15/99.79/99.76 99.24/99.80/87.02 IND dataset: ATIS; OOD Datasets: CLINC OOD/Snips/Movie En-ConGAN 21.60  /19.74  /23.28  81.52  /86.33  /93.77  15.51  /15.54  /16.03  82.34  /81.79  /79.32  84.52  /89.35  /58.36  72.74  /60.20  /89.14  Confidence 10.21  /8.52  /10.19  20.50  /12.92  /17.59  9.28  /8.36  /9.33  96.99  /97.84  /96.62  97.19  /98.57  /99.56  97.04  /96.99  /84.27  Entropy 9.91  /8.84  /10.12  21.67  /13.75  /17.59  9.11  /8.16  /9.38  97.06  /97.93  /96.68  97.25  /98.62  /99.57  97.11  /97.14  /85.02  ODIN 9.11  /8.36  /10.08  21.32  /14.39  /18.52  7.50  /6.15  /9.37  97.16  /98.00  /96.73  97.39  /98.68  /99.58  97.16  /97.18  /84.88  G-ODIN 8.75  /8.01  /9.97  20.87  /13.44  /17.76  7.31  /6.02  /8.98  97.27  /98.11  /96.85  97.46  /98.76  /99.59  97.28  /97.32  /85.90  En-AE 4.00  / 2.09 /3.69  2.20  / 0.00 /0.35  3.45  / 1.33 /1.97  99.41  / 99.83 /99.63  99.43  / 99.89 /98.72  99.43  / 99.74 /97.93  Maha 4.00  /3.85  /6.48  12.13  /8.06  /11.64  3.76  /2.94  /5.04  99.18  /99.47  /98.72  98.78  /99.45  /99.71  99.46/99.49/95.45  DRM+L-Maha* 2.70/2.09/1.85 1.30 /0.32/ 0.00 2.55 /2.01/ 1.23 99.48 /99.70/ 99.78 99.51 /99.82/ 99.97 99.47 /99.50/ 98.22 IND dataset: Movie; OOD Datasets: CLINC OOD/ATIS/Snips En-ConGAN 45.90  /15.12  /41.09  44.05  /14.35  /39.59  22.95  /7.56  /20.55  43.85  /57.44  /45.78  85.21  /88.23  /90.40  14.68  /17.56  /10.09  Confidence 19.22  /16.70  /18.81  36.81  /47.94  /47.52  18.51  /15.15  /18.53  91.65  /91.99  /90.53  98.11  /98.50  /98.68  76.78  /67.58  /59.63  Entropy 19.12  /17.26  /19.13  34.64  /44.24  /44.80  18.25  /16.12  /18.87  91.79  /92.14  /90.72  98.11  /98.50  /98.69  78.66  /70.87  /63.96  ODIN 19.42  /18.95  /19.94  34.43  /39.91  /39.38  18.24  /18.38  /19.33  91.34  /91.40  /90.03  97.96  /98.29  /98.53  78.56  /71.62  /65.18  G-ODIN 18.61  /18.23  /19.25  34.19  /36.42  /37.03  18.15  /17.27  /18.91  91.86  /91.97  /90.63  98.21  /98.34  /98.70  78.98  /72.07  /66.79  En-AE 13.70  /7.28  /16.05  43.42  /16.05  /32.29  11.00  /4.46  /11.87  94.57  /93.56  /92.23  98.91  /99.58  /99.01  77.12  /76.13  /68.75  Maha 3.90  /3.41  /6.11  6.02  /2.35  /15.40  3.72  /3.02  /6.02  99.37  /99.43  /98.63  99.81  /99.89/99.82  97.82  /97.27  /91.44  DRM+L-Maha* 3.70/3.36/4.66 2.56/1.01/4.34 3.61/2.85/4.58 99.48/99.53/99.06 99.89/99.92/99.88 97.90/97.38/93.85 In each OOD method for an IND dataset, / separates the results for different OOD datasets. Our method (*) is significantly better than baseline models with p-value < 0 . 01 (marked by  ) and p-value < 0 . 05 (marked by  ) using t-test in most cases. finetuning baseline (row 5). Thus, we mainly focus on comparing our method with strong baselines with BERT and RoBERTa models. For a given OOD detection method, we find that their combinations with DRM consistently perform better than those with standard models. The improvement is at least 1-2% for all metrics against our enhanced baselines. Among all OOD detection approaches, our proposed L-Mahalanobis OOD detection approach achieves the best performance for both linear and DRM combined BERT and RoBERTa models. It is not surprising to observe that our DRM method combined with a better pre-trained RoBERTa model achieves larger OOD detection performance improvement. Note that our customized En-AE performs much better than most other methods since we incorporated the enhanced reconstruction capability with pre-trained BERT models. However, En-AE cannot utilize all BERT layers as our proposed L-Mahalanobis method, resulting in worse performance. In addition, DRM+L-Mahalanobis models are significantly better than existing methods and enhanced baselines with p-value < 0 . 01 on most metrics for both BERT and RoBERTa backbones. Ablation Study on CLINC Dataset: We analyze how our two novel components, DRM model and L-Mahalanobis, impact the performance. The rows with DRM in Last Layer column of Table 2 show the performance of DRM model. As one can see, for all OOD methods, DRM consistently performs better than the conventional Lin-ear last layer. Specifically, the DRM and Confidence combo also outperforms its closest baseline G-ODIN. This validates the effectiveness of our disentangled logits design in DRM based on the mathematical analysis of overconfidence. It also shows that our new domain loss can indeed enhance the model awareness that all training data is IND. The rows with L-Mahalanobis in OOD Method column of Table 2 outperform other OOD methods with the same model and last layer. Compared with its closest baseline Mahalanobis, the better performance of L-Mahalanobis validates the usefulness of all layers' features in various models. Results on ATIS/Snips/Movie Datasets: Since our strong baselines on pre-trained RoBERTa model showed better results on CLINC, we next evaluate other results finetuned on RoBERTa model. When taking each dataset as IND, we use the other two mutually exclusive datasets and CLINC OOD as OOD datasets for evaluating OOD detection performance. As one can see in Table 4, our method outperforms other approaches on both Snips and movie IND datasets. For ATIS IND dataset, En-AE for Snips OOD dataset achieves almost perfect performance. This is because ATIS and Snips are almost completely non-overlapping and ATIS is well designed with carefully selected varieties and entities in the airline travel domain. When taking Snip as IND and ATIS as OOD, it is interesting to see that our method achieves better performance than En-AE. This is because that Snips contains a large number of entities such that the reconstruction error will be lower and become less separable than that in ATIS OOD utterances. For both Snips and Movie IND datasets, DRM+L-Mahalanobis are significantly better than baseline methods with p-value < 0 . 01 in most cases for all OOD datasets. For ATIS IND dataset, DRM+L-Mahalanobis shows similar behavior except En-AE since it is easier to train an autoencoder model for ATIS IND dataset due to its carefully collected clean training utterances. We provide a quantitative analysis by visualizing our two methods, DRM and L-Mahalanobis. Figure 4 plots the histograms of detection scores for OOD and IND data. Compared with Figure 4(a), DRM significantly reduces the overlap between OOD and IND in Figure 4(b). L-Mahalanobis utilizes features from all layers to further reduce the overlap in Figure 4(c). Moreover, the score distributions from left to right in Figure 4, imply that a larger entropy of all score reflects a better uncertainty modeling. Figure 5 visualizes the utterance representations learned with or without DRM. The red IND data are tightly clustered within classes (totally 150 CLINC IND classes), while the blue OOD data spread arbitrarily. As one can see, the blue dots in Figure 5(b) have less overlap with red dots, indicating the DRM helps to learn the utterance representation to better disentangle IND and OOD data. This paper proposes using only IND utterances to conduct intent classification and OOD detection for SLU in an open-world setting. The proposed DRM has a structure of two branches to avoid overconfidence and achieves a better generalization. The evaluation shows that our method can achieve state-of-the-art performance on various SLU benchmark and in-house datasets for both IND intent classification and OOD detection. In addition, thanks to the generic of our DRM design and with the recent extensive use of BERT on different data modalities, our work can contribute to improving both in-domain classification robustness and out-of-domain detection robustness for various classification models such as image classification, sound classification, vision-language classifications. Our proposed method in this paper has been deployed in the domain classification SLU model for Samsung Bixby voice assistant. In addition to SLU, our work could have a broader impact on other applications, which can be benefited from having a more robust classification system. For example, our method can help the robot to detect objects more accurately or stop safely by correctly identifying unknown objects, classify environmental sounds or detect anomaly sounds, and so on. Moreover, by better detecting the OOD samples that are different from the training data distribution, our method can facilitate to handle distributional shifts between training data and practical usage data.
abstain abstain abstain objective objective abstain result abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain objective method method abstain result abstain abstain other other other abstain other objective other other other abstain other other other other other other other other other other method abstain abstain method method abstain other abstain method abstain abstain abstain abstain abstain abstain method method abstain abstain method method abstain method abstain method method abstain abstain method method abstain abstain other method abstain method method method method method abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain result abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain result abstain result abstain abstain abstain abstain result abstain abstain abstain result abstain abstain result abstain abstain abstain abstain abstain result abstain abstain result abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain result abstain abstain result abstain abstain result abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain objective abstain result objective abstain abstain method abstain