Abstract
In this paper, we propose a training-free method for unsupervised short text clustering that relies less on careful selection of embedders than other methods. In customer-facing chatbots, companies are dealing with large amounts of user utterances that need to be clustered according to their intent. In these settings, no labeled data is typically available, and the number of clusters is not known. Recent approaches to short-text clustering in label-free settings incorporate LLM output to refine existing embeddings. While LLMs can identify similar texts effectively, the resulting similarities may not be directly represented by distances in the dense vector space, as they depend on the original embedding. We therefore propose a method for transforming LLM judgments directly into a bag-of-texts representation in which texts are initialized to be equidistant, without assuming any prior distance relationships. Our method achieves comparable or superior results to state-of-the-art methods, but without embeddings optimization or assuming prior knowledge of clusters or labels. Experiments on diverse datasets and smaller LLMs show that our method is model agnostic and can be applied to any embedder, with relatively small LLMs, and different clustering methods. We also show how our method scales to large datasets, reducing the computational cost of the LLM use. The flexibility and scalability of our method make it more aligned with real-world training-free scenarios than existing clustering methods.
Introduction
Short-text clustering is a significant challenge in NLP, particularly for chatbot utterances where brevity limits context. Traditional methods rely on dense vector embeddings, but these often struggle with domain-specific nuances. While recent "training-free" methods use Large Language Models (LLMs) to refine these embeddings, they remain constrained by the geometry of the original pre-trained model. If an initial embedder incorrectly groups unrelated sentences, the LLM must overcome significant "geometric gravity" to correct the error. This paper introduces a representation that directly encodes LLM judgments without being biased by pre-trained geometric constraints.
Methods: The LeBoT Approach
The proposed method, LeBoT (LLM-enabled Bag-of-Texts), avoids the pitfalls of refining existing embeddings by constructing an entirely new vector space from scratch.
The process involves three key stages:
- Initial Construction: Representative texts are selected via simple clustering. Each is assigned a unique "one-hot" vector, ensuring they start perfectly equidistant. For other texts, a lightweight embedder identifies candidate representatives, and an LLM (e.g., Gemma-2-9b) selects those with matching intents. The final vector is the average of these LLM-selected representatives.
- Iterative Refinement: Vectors are updated over several rounds. The pool of candidates for LLM review is refined based on the updated vector space, pulling similar texts into tighter, more stable clusters.
- Scalability via Distillation: To handle large datasets, the authors employ knowledge distillation. LLM-generated vectors for a data subset are used to train a fast Multi-Layer Perceptron (MLP) to predict vectors for the remaining data, drastically reducing computational costs.
Datasets and Evaluation
The method was rigorously tested across diverse benchmarks, including intent detection (Bank77, CLINC150), sentiment analysis (GoEmo), and community QA (StackOverflow). External sets like ArxivS2S and Reddit were used for hyperparameter tuning to ensure a blind evaluation on the main benchmarks.
Key Results and Insights
LeBoT consistently outperformed state-of-the-art methods like ClusterLLM and SPILL. On the Bank77 dataset, it achieved an NMI of ~85%, compared to the ~79% baseline.
Key findings include:
- The "Blank Slate" Advantage: Starting with equidistant vectors allows the LLM to be the sole architect of the similarity space, avoiding pre-trained biases.
- Model Agnosticism: The method remains effective even with basic initial embedders like TF-IDF, proving that LLM reasoning is the primary performance driver.
- Rapid Convergence: As shown in the iterative refinement analysis, the model typically reaches stability by the 5th iteration, with significant gains in the first few rounds.
- Efficiency: Distillation reduced inference time from 0.7 seconds to 0.0002 seconds per text, making the approach viable for real-time production.
Conclusion
LeBoT offers a flexible, scalable, and training-free solution for short-text clustering. By decoupling LLM judgments from initial embedding geometry, it achieves superior robustness and performance. Future work will explore its application in low-resource languages and the integration of human-in-the-loop feedback for highly specialized domains.
Summary updated