Intent Detection and Discovery from User Logs via Deep Semi-Supervised Contrastive Clustering

Rajat Kumar, Mayur Patidar, Vaibhav Varshney, Lovekesh Vig, Gautam ShroffNAACL 2022

Abstract

Modern dialogue systems face the challenge of evolving user needs that fall outside pre-defined intent categories. We present DSSCC (Deep Semi-Supervised Contrastive Clustering), an end-to-end framework designed to simultaneously classify known intents and discover novel ones from unlabeled logs. By integrating supervised fine-tuning with a joint contrastive learning phase that optimizes cluster centers within the neural network, DSSCC achieves state-of-the-art performance on multiple benchmarks. Our approach effectively handles scenarios where the number of new intents is unknown through a human-in-the-loop variant, demonstrating significant improvements in both accuracy and operational efficiency.

Introduction

Intent detection is a cornerstone of conversational AI, typically treated as a static classification task. However, in production environments, users frequently generate "out-of-scope" (OOS) utterances that reflect emerging requirements. Manually labeling these utterances is labor-intensive and unscalable. The dual challenge lies in accurately detecting known intents while grouping novel utterances into coherent clusters for future implementation. Existing methods often decouple representation learning from clustering, leading to suboptimal results. DSSCC addresses this by proposing a joint, end-to-end optimization strategy.

Methodology

The DSSCC framework operates in two distinct training phases to leverage both labeled and unlabeled data effectively.

Phase 1: Supervised Fine-tuning

The model, initialized with a Pre-trained Language Model (PLM) such as SBERT, is fine-tuned on a limited set of labeled data. This phase uses standard cross-entropy loss to establish a baseline understanding of known intent categories.

Phase 2: Joint Contrastive Learning

This core phase optimizes the model on a mixture of labeled and unlabeled data.

  • Contrastive Loss: Utterances with the same label are pulled together in the embedding space. For unlabeled data, an "Augmentor" creates positive pairs (e.g., via word masking), and the model learns to minimize the distance between these pairs while maximizing the distance from other utterances.
  • Learnable Cluster Centers: Unlike traditional post-hoc clustering (like K-means), cluster centers are integrated as weights within the network, allowing for simultaneous representation and cluster refinement.
  • Entropy Maximization: To avoid "cluster collapse"—where the model assigns all data to a single cluster—a loss term is added to encourage a uniform distribution across available clusters.
Figure 3: The two-phase training architecture of DSSCC, showing the transition from supervised fine-tuning to joint contrastive clustering.

For practical deployment where the number of intents is unknown, the DSSCC-HIL (Human-In-the-Loop) variant utilizes DBSCAN to generate dense micro-clusters, which are then merged by human experts based on representative samples.

Experimental Results

The model was evaluated on five diverse datasets, including BANKING77 (77 intents) and CLINC150 (150 intents). Results indicate that DSSCC consistently outperforms existing state-of-the-art methods like DeepAligned.

Figure 6: Performance comparison (ACC and NMI) of DSSCC against baseline methods across different Known Intent Ratios (KIR) on CLINC150 and BANKING77 datasets.

On the BANKING77 dataset with only 25% known intents, DSSCC achieved an Accuracy (ACC) of 55.52%, significantly higher than DeepAligned's 48.88%. The model also demonstrated robustness; when estimating the number of new intents automatically, performance degradation was minimal (1-6%). Furthermore, the HIL approach reached over 81% accuracy on BANKING77 with minimal human intervention.

Discussion and Conclusion

A key finding is that joint optimization allows the model to refine language representations specifically for clustering. The choice of base model is also critical: SBERT outperformed standard BERT by providing superior initial sentence embeddings. While DSSCC shows strong results, challenges remain in distinguishing semantically similar intents (e.g., "lost" vs. "stolen" cards) and handling the "long-tail" distribution of real-world logs. Future work will focus on automated natural language description generation for discovered clusters to further streamline the human review process.

Summary updated

BibTeX
@inproceedings{kumar2022intent,
  author = {Rajat Kumar and Mayur Patidar and Vaibhav Varshney and Lovekesh Vig and Gautam Shroff},
  title = {{Intent Detection and Discovery from User Logs via Deep Semi-Supervised Contrastive Clustering}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2022},
  doi = {10.18653/v1/2022.naacl-main.134},
}
Figure