Dynamic Semantic Matching and Aggregation Network for Few-shot Intent Detection

Hoang Nguyen, Chenwei Zhang, Congying Xia, Philip S. Yu

Abstract

Few-shot intent detection (ID) is critical for scaling natural language understanding systems to emerging user needs. However, existing models often rely on brittle word-level matching and static similarity metrics, failing in realistic generalized settings. We present the Semantic Matching and Aggregation Network (SMAN), which extracts high-level semantic components via multi-head attention and employs a multi-perspective matching strategy. SMAN incorporates dynamic regularization to align query and support distributions. Evaluated on SNIPS and NLUE datasets in the Generalized Few-shot Intent Detection (GFSID) setting, SMAN significantly outperforms state-of-the-art baselines, demonstrating superior robustness and stability across both seen and novel intents.

Introduction

Intent Detection (ID) is the foundational task of mapping user utterances to specific actions (e.g., "book a spot for six" $\rightarrow$ BookRestaurant). While deep learning has advanced ID, traditional models require extensive labeled data, making them ill-suited for "emerging intents" in evolving services. Few-shot Learning (FSL) offers a solution by learning from minimal examples, but current research faces three primary challenges:

  1. Word-level Over-reliance: Models often match individual words while ignoring phrase-level context, leading to errors with polysemous words.
  2. Static Similarity Measures: Fixed metrics like Euclidean distance lack the flexibility to capture the diverse linguistic expressions of the same intent.
  3. Unrealistic Evaluation: Standard "episodic" testing evaluates models on small subsets of classes. In real-world Generalized Few-shot Intent Detection (GFSID), models must distinguish between all seen and novel intents simultaneously.

The SMAN Architecture

The proposed Semantic Matching and Aggregation Network (SMAN) addresses these gaps through a three-stage process:

The SMAN architecture overview, illustrating the flow from semantic encoding to multi-perspective matching and instance aggregation.

1. Semantic Encoder

SMAN utilizes multi-head self-attention to extract $r$ distinct "semantic components" (heads) from an utterance. To ensure these components are informative, three regularization techniques are applied:

  • Self-attention regularization: Encourages heads to focus on different sentence segments.
  • Head uniform regularization: Ensures collective coverage of all words, preventing the omission of rare but significant terms.
  • Head distribution regularization: A novel constraint that aligns the attention distribution of a query with its corresponding support examples.

2. Multi-perspective Semantic Matching

Rather than a single similarity score, SMAN evaluates the relationship between query and support instances across four dimensions: head-wise comparison, max-pooling (best match across all heads), attentive matching (weighted sum based on similarity), and a hybrid max-attentive approach.

3. Instance Aggregation

Instead of simple averaging to find a class prototype, SMAN employs an attention mechanism to weigh support examples based on their relevance to the specific query before final classification.

Experimental Setup

The model was evaluated on two benchmarks: SNIPS-NLU (7 intents) and NLU-Evaluation (NLUE) (64 intents). Crucially, testing was conducted in a non-episodic setting, requiring the model to classify queries within the joint label space of all seen and novel classes. This GFSID setting is significantly more challenging than standard episodic few-shot tasks.

Results and Analysis

SMAN consistently outperformed state-of-the-art baselines, including MLMAN and HAPN, across both datasets.

Performance comparison of SMAN against baseline models on the SNIPS dataset in both episodic and non-episodic (generalized) settings.

Key findings include:

  • Superior Joint Accuracy: On SNIPS (1-shot, non-episodic), SMAN achieved 81.85% accuracy, significantly higher than MLMAN's 78.61%.
  • Robustness (h-accuracy): The harmonic mean of seen and novel accuracy (h-accuracy) was notably higher for SMAN, indicating it effectively learns new intents without degrading performance on previously seen ones.
  • Semantic Robustness: By matching coarse-grained semantic components rather than individual words, SMAN is less susceptible to noise from "stop words" or ambiguous terminology.

Conclusion

SMAN demonstrates that matching high-level semantic concepts and employing dynamic regularization significantly improves few-shot intent detection, particularly in realistic generalized settings. Future work will explore more dynamic extraction methods, efficient synthesis of matching perspectives, and the integration of large-scale contextual embeddings to further enhance the semantic encoder.

Summary updated

BibTeX
@inproceedings{nguyen2020dynamic,
  author = {Hoang Nguyen and Chenwei Zhang and Congying Xia and Philip S. Yu},
  title = {{Dynamic Semantic Matching and Aggregation Network for Few-shot Intent Detection}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2020},
  doi = {10.18653/v1/2020.findings-emnlp.108},
}
Figure