Skip to main content
QUICK REVIEW

[Paper Review] Discriminative Nearest Neighbor Few-Shot Intent Detection by Transferring Natural Language Inference

Jianguo Zhang, Kazuma Hashimoto|arXiv (Cornell University)|Oct 25, 2020
Topic ModelingComputer Science52 references20 citations
TL;DR

This paper proposes a discriminative nearest neighbor classification (DNNC) model for few-shot intent detection that leverages BERT-style pairwise encoding with deep self-attention to improve both in-domain and out-of-scope (OOS) intent detection. By transferring a natural language inference (NLI) model, the method achieves competitive performance with 50-shot or full-shot classifiers using only 10-shot examples, while maintaining constant inference time via fast embedding retrieval.

ABSTRACT

Intent detection is one of the core components of goal-oriented dialog systems, and detecting out-of-scope (OOS) intents is also a practically important skill. Few-shot learning is attracting much attention to mitigate data scarcity, but OOS detection becomes even more challenging. In this paper, we present a simple yet effective approach, discriminative nearest neighbor classification with deep self-attention. Unlike softmax classifiers, we leverage BERT-style pairwise encoding to train a binary classifier that estimates the best matched training example for a user input. We propose to boost the discriminative ability by transferring a natural language inference (NLI) model. Our extensive experiments on a large-scale multi-domain intent detection task show that our method achieves more stable and accurate in-domain and OOS detection accuracy than RoBERTa-based classifiers and embedding-based nearest neighbor approaches. More notably, the NLI transfer enables our 10-shot model to perform competitively with 50-shot or even full-shot classifiers, while we can keep the inference time constant by leveraging a faster embedding retrieval model.

Motivation & Objective

  • Address the challenge of few-shot intent detection with robust out-of-scope (OOS) detection, especially under data scarcity.
  • Overcome limitations of softmax classifiers and embedding-based nearest neighbor methods in distinguishing OOS from in-domain intents.
  • Improve discriminative power in few-shot settings by modeling utterance pairs directly instead of relying on class-level embeddings.
  • Enable fast inference with constant latency by combining a retrieval-based approach with a lightweight NLI model for filtering.
  • Investigate the effectiveness of NLI transfer to enhance generalization and separation between in-domain and OOS examples.

Proposed method

  • Propose a discriminative nearest neighbor classification (DNNC) framework that uses BERT-style paired encoding to model relations between input utterances and training examples.
  • Train a binary pairwise classifier using deep self-attention to predict whether an input utterance matches a given training example.
  • Transfer knowledge from a pre-trained natural language inference (NLI) model to enhance the discriminative ability of the pairwise matching function.
  • Introduce a joint inference strategy where the NLI model filters candidate training examples before the final DNNC matching step, balancing speed and accuracy.
  • Use a fast embedding retrieval model (e.g., FAISS) to maintain constant inference time regardless of shot size, by retrieving top-k candidates before applying the NLI filter.
  • Apply a threshold-based strategy for OOS detection, where predictions are classified as OOS if no matching training example exceeds a confidence threshold.

Experimental results

Research questions

  • RQ1Can a pairwise matching approach with deep self-attention outperform standard softmax classifiers and embedding-based nearest neighbor methods in few-shot intent detection with OOS?
  • RQ2Does transferring a pre-trained NLI model improve the discriminative boundary between in-domain and OOS intent examples?
  • RQ3Can a 10-shot DNNC model achieve performance comparable to 50-shot or full-shot models through NLI transfer?
  • RQ4How can inference speed be maintained at a constant level while improving accuracy in few-shot OOS intent detection?
  • RQ5What is the trade-off between filtering aggressiveness (k) and the balance between accuracy and latency in the inference pipeline?

Key findings

  • The DNNC model achieves more stable and accurate in-domain and OOS intent detection than RoBERTa-based classifiers and embedding-based nearest neighbor methods across multiple few-shot settings.
  • With NLI transfer, the 10-shot DNNC model performs competitively with 50-shot or full-shot classifiers, demonstrating strong sample efficiency.
  • The DNNC-joint method with k=20 achieves OOS accuracy close to the full DNNC method but with significantly reduced inference latency.
  • The t-SNE visualization shows that the DNNC model produces clearer separation between in-domain and OOS examples compared to RoBERTa and baseline nearest neighbor methods.
  • The NLI transfer improves the discriminative ability of the pairwise matching function, as evidenced by better clustering of in-domain examples and clearer OOS rejection.
  • Distilled RoBERTa models perform poorly in OOS detection, suggesting that model compactness may compromise robustness to out-of-distribution inputs.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.