Source-linked AI summary
Out-of-domain Detection for Natural Language Understanding in Dialog Systems
Yinhe Zheng, Guanyi Chen, Minlie Huang
TL;DR
OOD detection matters because NLU systems may encounter unsupported inputs, while labeled OOD samples are difficult to collect and discrete-language generation remains underexplored. This paper proposes POG, which generates pseudo OOD utterances through latent-space adversarial training and auxiliary intent regularization. Experiments report that these samples improve OOD detection, with the authors also reporting gains from using unlabeled data.
Problem
Labeled OOD data are difficult to collect, and generating useful pseudo OOD samples in discrete natural-language space remains underexplored.
Source: §I · p. 1Method
POG uses an autoencoder, adversarial latent-code generation, and an auxiliary classifier to generate pseudo OOD samples for NLU training.
Source: §I · p. 2, §V · p. 10Results
The authors report that POG-generated samples improve OOD detection and that using unlabeled data further improves their effectiveness.
Source: §I · p. 2, §V · p. 10Takeaways & Limitations
The authors conclude that unlabeled data can improve generated pseudo OOD samples, making the approach more suitable for practical applications.
Source: §I · p. 2The study focuses on OOD detection for NLU; applying the approach to longer-text classification and other dialogue-system components remains future work.
Source: §V · p. 10
Abstract
from arXiv · showhide
Natural Language Understanding (NLU) is a vital component of dialogue systems, and its ability to detect Out-of-Domain (OOD) inputs is critical in practical applications, since the acceptance of the OOD input that is unsupported by the current system may lead to catastrophic failure. However, most existing OOD detection methods rely heavily on manually labeled OOD samples and cannot take full advantage of unlabeled data. This limits the feasibility of these models in practical applications. In this paper, we propose a novel model to generate high-quality pseudo OOD samples that are akin to IN-Domain (IND) input utterances, and thereby improves the performance of OOD detection. To this end, an autoencoder is trained to map an input utterance into a latent code. and the codes of IND and OOD samples are trained to be indistinguishable by utilizing a generative adversarial network. To provide more supervision signals, an auxiliary classifier is introduced to regularize the generated OOD samples to have indistinguishable intent labels. Experiments show that these pseudo OOD samples generated by our model can be used to effectively improve OOD detection in NLU. Besides, we also demonstrate that the effectiveness of these pseudo OOD data can be further improved by efficiently utilizing unlabeled data.
I. INTRODUCTION
The introduction motivates open-world OOD detection because deployed NLU systems encounter unsupported inputs, while labeled OOD data are costly and discrete-language generation remains underexplored. It presents POG, which generates pseudo OOD samples and can use unlabeled data, and situates it among existing detection and generation approaches.
I. INTRODUCTION
- Open-world NLU must reject unsupported inputs, unlike the closed-world assumption that training and test data share a distribution,.Accepting unsupported inputs may trigger catastrophic failures in risk-sensitive applications.Source: §I · p. 1
- Large-scale OOD data are difficult and expensive to collect, while generating effective pseudo OOD samples in discrete natural-language space remains underexplored,,.Unlabeled data, such as user logs, are easier to obtain and may provide prior knowledge about the testing OOD distribution.Source: §I · pp. 1–2
- POG combines an autoencoder, adversarial training, and an auxiliary classifier to generate pseudo OOD samples for entropy-regularized NLU training.The authors report that it outperforms competitive baselines on two datasets.Source: §I · p. 2
II. RELATED WORK
- Many IND-only detection methods are computationally expensive or memory-intensive and do not fully use unlabeled data –[9],, –.Methods trained with a special OOD class also face scarce, potentially imbalanced, and overly narrow OOD training data.Source: §II · p. 2
- Unlike PU learning, which assumes unlabeled data cover the negative distribution, this study aims to reject all non-IND samples without assuming full OOD coverage [40].The OOD distribution may be too large to capture with available unlabeled data.Source: §II · p. 2
- Prior GAN-based OOD generators operate in continuous spaces, whereas this study targets discrete token sequences and can also use unlabeled data,.Earlier controllable text generation instead aims to produce fluent utterances within the data distribution –.Source: §II · p. 2
III. MODEL
The task is to build an intent classifier that classifies IND utterances and rejects OOD utterances using labeled IND data and unlabeled data drawn from either distribution. Because the OOD distribution may be unknown or too large to capture, the unlabeled data can provide prior knowledge about it.
A. Task Definition
- Training uses labeled IND data and unlabeled utterances drawn from either the IND or OOD distribution.The labeled IND examples have intent labels; the unlabeled set may mix both distributions.Source: A. Task Definition · p. 3
- The system must reject inputs drawn from the OOD distribution and predict the correct intent for IND inputs.The task focuses on intent classification, with detected OOD inputs rejected during that process.Source: A. Task Definition · p. 3
- Because the OOD distribution may be unknown or too large to capture with limited samples, unlabeled data can provide prior knowledge about it.The authors do not assume that the available unlabeled data cover the entire OOD distribution.Source: A. Task Definition · p. 3
B. Classifier with Entropy Regularization
The classifier uses maximum Softmax probability as its detection score and rejects inputs below a validation-selected threshold. Entropy regularization is intended to make OOD predictions less confident, addressing the risk that cross-entropy-trained classifiers assign high scores to OOD inputs resembling IND examples.
B. Classifier with Entropy Regularization
- The maximum Softmax probability is the detection score, and inputs below a validation-selected threshold are rejected.The classifier is trained with a Softmax output distribution over intent types.Source: B. Classifier with Entropy… · p. 3
- Cross-entropy training encourages confident IND predictions, but similar OOD inputs may also receive high detection scores.For example, an unsupported Bluetooth request may resemble the phrasing of supported commands.Source: B. Classifier with Entropy… · p. 3
- Entropy regularization encourages OOD predictions toward a uniform distribution, lowering their detection scores.The entropy term is optimized using OOD samples, which may be infeasible when the OOD distribution is unknown or too broad to sample comprehensively.Source: B. Classifier with Entropy… · p. 3
C. Pseudo OOD Sample Generation
POG generates pseudo OOD samples through adversarial generation in an autoencoder’s latent space, aiming to make generated utterances resemble IND inputs without matching their intents. An auxiliary classifier regularizes the generator, and the resulting samples are used for entropy regularization in NLU training.
C. Pseudo OOD Sample Generation
- POG uses adversarial generation to produce pseudo OOD samples for entropy-regularized NLU training.The approach is motivated by the difficulty of detecting OOD utterances that resemble IND inputs but express unsupported intents.Source: C. Pseudo OOD Sample Generation · p. 3, 1) Model Overview · p. 3
1) Model Overview:
- An encoder maps utterances to latent codes, a decoder reconstructs them, and a generator produces fake codes that a discriminator distinguishes from real codes.Imitating real codes is intended to make generated utterances resemble reconstructed IND utterances.Source: 1) Model Overview · p. 3, Figure 1 · p. 4
- An auxiliary classifier predicts labels for reconstructed utterances and regularizes the generator so generated utterances have indistinguishable intents.The figure caption describes this regularization as encouraging a uniform intent distribution for generated utterances.Source: 1) Model Overview · pp. 3–4, Figure 1 · p. 4
2) Autoencoder:
The autoencoder maps utterances to continuous latent codes and reconstructs them, while Gaussian noise smooths the latent space. An adversarial generator learns latent codes intended to yield utterances similar to in-domain inputs.
2) Autoencoder:
- The autoencoder encodes each input utterance as a continuous latent code and decodes that code to reconstruct an utterance.It is trained by minimizing reconstruction loss.Source: 2) Autoencoder · p. 4
- Gaussian noise is added to latent codes during training to smooth the latent space before decoding.The noisy code is used to generate a reconstruction optimized with reconstruction loss.Source: 2) Autoencoder · p. 4
3) Adversarial Generation Module:
- The adversarial generator maps noise to latent codes, while a discriminator distinguishes generated codes from real in-domain codes.The generator is trained to fool the discriminator; its codes are expected to decode into utterances similar to in-domain inputs.Source: 3) Adversarial Generation Module · p. 4
- The generator and discriminator are trained to minimize the Wasserstein-1 distance, with a gradient penalty enforcing the discriminator’s 1-Lipschitz constraint.The penalty’s sampling distribution is approximated by uniformly interpolating between data and generated samples.Source: 3) Adversarial Generation Module · p. 4
4) Auxiliary Classifier:
The auxiliary classifier predicts intent labels for decoded in-domain utterances and guides generation toward samples that do not fit existing intent labels. Soft decoder outputs allow the classifier’s signal to backpropagate to the generator.
4) Auxiliary Classifier:
- The auxiliary classifier maps decoded utterances to distributions over the in-domain intent labels and is trained with cross-entropy to predict their correct labels.For an in-domain training utterance, its encoded latent code is decoded before the classifier predicts its intent.Source: 4) Auxiliary Classifier · p. 4
- The generator is trained to maximize the classifier’s output entropy on generated utterances, making its predicted intent distribution uniform rather than assigning an existing intent.The generator samples noise, creates a fake latent code, and decodes it into an utterance before applying this objective.Source: 4) Auxiliary Classifier · pp. 4–5
- The entropy regularizer seeks decoded samples that resemble in-domain utterances yet cannot be assigned to an existing intent label.The loss is minimized when the auxiliary classifier produces a uniform distribution.Source: 4) Auxiliary Classifier · p. 5
- A continuous approximation replaces sampled discrete tokens with decoder probability vectors so classifier gradients can reach the generator.The classifier’s token embeddings are weighted averages of word embeddings, and temperature scaling sharpens decoder distributions as training proceeds.Source: 4) Auxiliary Classifier · p. 5
D. Utilizing Unlabeled Data
AEPOG uses unlabeled mixed data to augment POG’s training, addressing the expense of human-labeled OOD examples. The added training is intended to enrich the latent space with OOD samples and improve generated pseudo-OOD data.
D. Utilizing Unlabeled Data
- Human-labeled OOD data are expensive, while unlabeled mixed data can provide prior knowledge about testing OOD inputs.The authors note that using only in-domain data makes it difficult for POG to gain such prior knowledge.Source: D. Utilizing Unlabeled Data · p. 5
- AEPOG adds autoencoder reconstruction and discriminator updates using samples from the unlabeled mixture Dmix.The authors expect the autoencoder’s latent space to be enriched with OOD samples, guiding the auxiliary classifier and generator toward them.Source: D. Utilizing Unlabeled Data · p. 5
- The authors report that the resulting generated pseudo-OOD utterances can be more effective at improving OOD detection.The evaluation is described as appearing in Section IV.Source: D. Utilizing Unlabeled Data · p. 5
IV. EXPERIMENT
The experiments use OSQ and IPA data, with a separate Chat test set for IPA-trained models. The IPA partition makes OOD utterances similar to in-domain utterances, representing a more difficult detection setting.
A. Dataset
- The evaluation uses OSQ data with 150 in-domain intents and manually labeled out-of-scope queries, and IPA data with 67 domains and 1,310 intents.For IPA, 310 intents are selected as OOD; domain labels define the in-domain classes.Source: A. Dataset · p. 5
- Dmix contains 10K in-domain and 250 OOD OSQ examples, while IPA uses 20K unlabeled utterances extracted from user logs.Table I presents statistics for the OSQ and IPA datasets and defines Dmix as a mixture of in-domain and OOD data.Source: A. Dataset · p. 6, Table I · p. 6
- The IPA partition makes OOD and in-domain utterances similar, a difficult setting the authors describe as a lower bound for real-system OOD detection.The setup reflects users issuing unsupported requests that resemble supported ones.Source: A. Dataset · p. 6
- The IPA-trained models are also tested on a manually annotated Chat set of 1.2K OOD utterances, including chitchat and nonsense.This dataset is used only in testing.Source: A. Dataset · p. 6
B. Model Implementation
The section describes the text classifier and POG implementation, the OOD-detection baselines, and component ablations. Tables II–IV report significant advantages for ER+AEPOG across their stated evaluation settings.
B. Model Implementation
- The text classifier uses a CNN with four kernel sizes, 128 feature maps per kernel, and a three-layer MLP with 512-unit hidden layers.Its vocabulary covers IND and OOD tokens; embeddings are initialized partly with 100-dimensional pre-trained vectors, and classifiers are trained for 30 epochs.Source: B. Model Implementation · p. 6
- POG uses LSTM encoder and decoder modules plus four-layer MLP generator and discriminator networks.The auxiliary classifier shares the text classifier's structure and hyperparameters; POG and AEPOG are trained for 80 epochs.Source: B. Model Implementation · p. 6
C. Baselines
- ER+AEPOG is significantly better than other models on OSQ, IPA, and IPA-trained/Chat-tested results (Tables II–IV).The tables report averages over ten runs.Source: Table II · p. 6, Table III · p. 7, Table IV · p. 7
- The baselines span score-based, distance-based, generative, reconstruction, likelihood-ratio, and ER-based OOD detectors.They include MSP, entropy, ODIN, DOC, KNN, Mahalanobis distance, continuous GAN, AE, Likelihood Ratio, ER+Perturb, and ER+Mix.Source: C. Baselines · pp. 6–7
- Ablations remove Gaussian noise or soft-token approximation, and both are evaluated without unlabeled data Dmix.The w/o Soft Token variant estimates decoder-sampling gradients with policy gradients.Source: C. Baselines · p. 7
D. Metrics
The section defines threshold-independent and threshold-specific OOD metrics, including false-positive rates tied to a chosen true-positive rate. It also describes ROC plots for IPA and OSQ.
D. Metrics
- AUROC and AUPR evaluate performance across thresholds, while FPR95 and FPR90 measure false-positive rates at fixed true-positive rates.Lower FPRN means fewer false alarms when IND performance is maintained at the specified precision.Source: D. Metrics · pp. 7–8
- FPR is false positives divided by all negatives, and TPR is true positives divided by all positives.Higher AUROC and AUPR are better; lower FPRN is better.Source: D. Metrics · p. 7
- On IPA ROC curves, ER+AEPOG improves AUROC over ER+POG, while ER+Mix shows a sharp AUROC decrease.ER+Mix directly uses Dmix to optimize the classifier's ER term.Source: Figure 2 · p. 8
- The OSQ ROC plot zooms into its upper-left corner for a clearer view.Source: Figure 3 · p. 8
E. Effects of Generated Pseudo OOD Utterances
ER+AEPOG improves OOD detection on OSQ and IPA, with particularly large reported FPRN gains when unlabeled data is used. Generated pseudo-OOD utterances also improve score separation, while IND classification accuracy is not harmed.
E. Effects of Generated Pseudo OOD Utterances
- 4.16% (FPR95) and 15.84% (FPR90) relative gains on OSQ, and 0.92% (FPR95) and 1.61% (FPR90) on IPA, were reported for ER+POG over the best baselines.IPA detection was harder because many OOD inputs resembled IND inputs; IPA-trained models also gained performance on Chat, especially for FPRN.Source: E. Effects of Generated Pseudo OOD… · p. 8
- IND classification accuracy was unaffected by ER training with POG-generated utterances and sometimes improved; Table V reports ten-run averages and ER+AEPOG significance against most other models.The authors suggest the generated samples may help prevent classifier over-fitting.Source: E. Effects of Generated Pseudo OOD… · p. 8, Table V · p. 8
F. Effects of Utilizing Unlabeled Data
- 9.87% (FPR95) and 23.16% (FPR90) relative gains on OSQ, and 7.26% (FPR95) and 11.45% (FPR90) on IPA, were reported for ER+AEPOG over the best baselines.The model significantly outperformed the other models, especially on FPRN.Source: F. Effects of Utilizing Unlabeled Data · p. 9
- ER+Mix, which applies the entropy-regularization term directly to Dmix, dropped on all metrics, especially on IPA; the authors attribute ER+AEPOG’s gains to its generated pseudo-OOD samples.The results indicate that the entropy-regularization term alone cannot use Dmix directly.Source: F. Effects of Utilizing Unlabeled Data · p. 9
- The OOD share of Dmix was 2.44% for OSQ and 33.33% for IPA, a dataset difference the authors give as part of the reason AEPOG’s OSQ improvement was smaller.Source: F. Effects of Utilizing Unlabeled Data · p. 9
- Detection-score distributions overlap for MSP and separate only marginally with ER+Perturb, while POG improves separation and AEPOG enlarges it further on OSQ and IPA.Figures 4 and 5 show the IND/OOD score distributions for OSQ and IPA, respectively.Source: F. Effects of Utilizing Unlabeled Data · p. 9, Figure 4 · p. 9, Figure 5 · p. 9
G. Feature Vectors for IND and OOD Inputs
On OSQ, the feature analysis finds stronger IND/OOD separation with POG and AEPOG, and the case study describes how generated utterances combine or reuse phrases. The conclusion summarizes POG’s generation design and identifies longer texts and other dialogue-system components as future directions.
G. Feature Vectors for IND and OOD Inputs
- OSQ penultimate-layer features mapped with t-SNE show separated IND clusters across classifiers, while POG and AEPOG enhance OOD separation beyond ER alone.Figure 6 visualizes these feature vectors.Source: G. Feature Vectors for IND and OOD… · pp. 9–10, Figure 6 · p. 10
H. Case Study for Generated OOD Utterances
- POG combines IND words and phrases into grammatical utterances with indistinguishable intents, while AEPOG can incorporate phrases from OOD data.Table VI presents human-generated IND/OOD examples and pseudo-OOD utterances from POG and AEPOG.Source: H. Case Study for Generated OOD… · p. 10, Table VI · p. 10
V. CONCLUSION
- POG uses an autoencoder, adversarial training to align OOD and IND latent codes, and an auxiliary classifier to regularize generated samples’ intent labels.The authors report that these samples improve OOD detection when used to optimize the entropy-regularization term, and that augmenting autoencoder training improves their effectiveness.Source: §V · p. 10
- The study focuses on NLU input detection; exploring longer-text classification and OOD detection in dialogue state tracking or dialogue management is left for future work.Source: §V · p. 10