Are Pre-trained Transformers Robust in Intent Classification? A Missing Ingredient in Evaluation of Out-of-Scope Intent Detection (2022)

Abstract: Pre-trained Transformer-based models were reported to be robust in intent classification. In this work, we first point out the importance of in-domain out-of-scope detection in few-shot intent recognition tasks and then illustrate the vulnerability of pre-trained Transformer-based models against samples that are in-domain but out-of-scope (ID-OOS). We construct two new datasets, and empirically show that pre-trained models do not perform well on both ID-OOS examples and general out-of-scope examples, especially on fine-grained few-shot intent detection tasks.

## introduction intent detection, which aims to identify intents from user utterances, is a vital task in goal-oriented dialog systems @xcite . however, the performance of intent detection has been hindered by the data scarcity issue, as it is non-trivial to collect sufficient examples for new intents. in practice, the user requests could also be not expected or supported by the tested dialog system, referred to as out-of-scope (oos) intents. thus, it is important to improve oos intents detection performance while keeping the accuracy of detecting in-scope intents in the few-shot learning scenario. recently, several approaches @xcite @xcite @xcite have been proposed to improve the performance of identifying in-scope and oos intents in few-shot scenarios. previous experiments have shown that a simple confidence-based out-of-distribution detection method @xcite equipped with pre-trained bert can improve oos detection accuracy. however, there is a lack of further study of pre-trained transformers on few-shot fine-grained oos detection where the oos intents are more relevant to the in-scope intents. besides, those studies mainly focus on the clinc dataset @xcite , in which the oos examples are designed such that they do not belong to any of the known intent classes. their distribution is dissimilar to each other, and thus they are easy to be distinguished from the known intent classes. moreover, clinc is not enough to study more challenging few-shot fine-grained oos detection as it lacks such semantically similar oos examples to in-scope intents, and other popular used datasets such as banking77 @xcite do not contain oos examples. in this paper, we aim to investigate the following research question: "are pre-trained transformers robust in intent classification w.r.t. general and relevant oos examples?". we first define two types of oos intents: out-of-domain oos (ood-oos) and in-domain oos (id-oos). we then investigate how robustly state-of-the-art pre-trained transformers perform on these two oos types. the ood-oos is identical to the oos in the clinc dataset, where the oos and in-scope intents (e.g., requesting an online tv show service in a banking system) are topically rarely overlapped. we construct an id-oos set for a domain, by separating semantically-related intents from the in-scope intents (e.g., requesting a banking service that is not supported by the banking system). empirically, we evaluate several pre-trained transformers (e.g., bert @xcite , roberta @xcite , albert @xcite , and electra @xcite ) in the few-shot learning scenario, as well as pre-trained tod-bert @xcite on task-oriented dialog system. the contributions of this paper are two-fold. first, we constructed and released two new datasets for oos intent detection based on the single-domain clinc dataset and the large finegrained banking77 dataset. second, we reveal several interesting findings through experimental results and analysis: 1) the pre-trained models are much less robust on id-oos than on the in-scope and ood-oos examples; 2) both id-oos and ood-oos detections are not well tackled and require further explorations on the scenario of finegrained few-shot intent detection; and 3) it is surprising that pre-trained models can predict undesirably confident scores even when masking keywords shared among confusing intents. ## evaluation protocol task definition we consider a few-shot intent detection system that handles pre-defined k in-scope intents. the task is, given a user utterance text u, to classify u into one of the k classes or to recognize u as oos (i.e., oos detection). to evaluate the system, we adopt in-scope accuracy a @xmath0, and oos recall r @xmath1, following @xcite and @xcite . we additionally report oos precision, p @xmath2. c in and c oos are the number of correctly predicted in-scope and out-of-scope examples, respectively; n in and n oos are the total number of the in-scope and out-of-scope examples evaluated, respectively; if an in-scope example is predicted as oos, it is counted as wrong. n ′ oos (≤ n in + n oos ) is the number of examples predicted as oos. inference we use a confidence-based method @xcite to evaluate the five pre-trained transformers. we compute a hidden vector @xmath3, where @xmath4, roberta, albert, electra, tod-bert}, and compute a probability vector p(y|u) = softmax(w h + b) ∈ r k , where w and b are the model parameters. we first take the class c with the largest value of p(@xmath5, then output c if p(@xmath6, where δ ∈ [0.0, 1.0] is a threshold value, and otherwise we output oos. δ is tuned by using the development set, so as to maximize (a in + r oos ) averaged across different runs @xcite . training to train the model, we use training examples of the in-scope intents, without using any oos examples. this is reasonable as it is nontrivial to collect sufficient oos data to model the large space and distribution of the unpredictable oos intents @xcite . ## dataset construction we describe the two types of oos (i.e., ood-oos and id-oos), using the clinc dataset @xcite and the fine-grained banking77 dataset @xcite . the clinc dataset covers 15 intent classes for each of the 10 different domains, and it also includes oos examples. we randomly select two domains, i.e., the "banking" and "credit cards", out of the ten domains for models evaluation. the banking77 dataset is a large fine-grained single banking domain intent dataset with 77 intents, and it initially does not include oos examples. we use these two datasets since clinc dataset focuses on the oos detection task, and we can evaluate models on the large single fine-grained banking domain on banking77 dataset. ood-oos we use the initially provided oos examples of clinc dataset as ood-oos examples for both datasets. to justify our hypothesis that the clinc's oos examples can be considered as out of domains, we take 100 oos examples from the development set, and check whether the examples are related to each domain. consequently, only 4 examples are relevant to "banking", while none of them is related to "credit cards". there are also no overlaps between the added oos examples and the original banking77 dataset. these findings show that most of the oos examples are not related to the targeted domains, and we cannot effectively evaluate the model's capability to detect oos intents within the same domain. ## conclusion we have investigated the robustness of pre-trained transformers in few-shot intent detection with oos samples. our results on two new constructed datasets show that pre-trained models are not robust on id-oos examples. both the oos detection tasks are challenging in the scenario of fine-grained intent detection. our work encourages more attention to be put on the above findings.