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.
1. Introduction
Short-text clustering—grouping chatbot queries or social media posts—is a fundamental task for organizing large volumes of unstructured data. The brevity and lack of context in short texts make this task particularly challenging. Traditional approaches rely on pre-trained models (e.g., BERT) to generate dense vector embeddings, which are then grouped using clustering algorithms. However, these pre-trained models often carry inherent geometric biases that may not align with the specific semantic requirements of a new dataset. Recent "training-free" methods attempt to use Large Language Models (LLMs) to refine these embeddings, but they often remain "trapped" by the original model's distance relationships.
2. The LeBoT Framework
We introduce LeBoT (LLM-enabled Bag-of-Texts), a method that constructs a sparse, interpretable vector space from scratch, bypassing the limitations of pre-trained dense embeddings. The framework operates in several stages:
- Representative Selection: An initial embedder performs a rough clustering to identify "medoids"—the most central texts in each group—to serve as representatives.
- Equidistant Initialization: These representatives are converted into one-hot vectors. In this new space, every representative is initially equidistant from all others, providing a "clean slate."
- LLM Guidance and BoT Construction: For each text in the dataset, the LLM identifies similar representatives from a candidate pool. The text is then represented as a vector where dimensions correspond to these representatives; specifically, the vector is the average of the one-hot vectors of the similar representatives identified by the LLM.
- Iterative Refinement: This process repeats, expanding the candidate pool and updating vectors until they converge, typically within 3 to 5 iterations.
3. Scalability via Distillation
To address the computational cost of LLM calls on massive datasets, LeBoT employs a distillation strategy. A small Multi-Layer Perceptron (MLP) with approximately 10 million parameters is trained to mimic the BoT vectors generated for a small subset of the data. This approach allows the method to scale to production-sized datasets, reducing inference time from ~0.7 seconds per text to 0.0002 seconds with minimal loss in accuracy.
4. Experimental Results and Insights
LeBoT was evaluated across diverse short-text benchmarks, including intent detection (Bank77, Clinc150) and emotion recognition (GoEmo). The method consistently outperformed state-of-the-art baselines like IDAS and SPILL.
- Robustness to Embedders: Unlike other methods that degrade with weaker initial models, LeBoT remains stable. For instance, using a BERT backbone, LeBoT achieved 60.95% accuracy on Bank77, while the baseline dropped to 29.07%.
- Model Agnosticism: The framework is robust to the choice of LLM, performing effectively even with smaller open-source models like Gemma-2-9b-it.
- Handling Unknown K: When tested with HDBSCAN, which does not require a pre-defined number of clusters, LeBoT's refined embeddings led to significantly more accurate cluster count estimates compared to raw embeddings.
- Hyperparameter Sensitivity: The performance of LeBoT is influenced by the subset size $m$, which defines the number of candidates the LLM evaluates.
As illustrated in Figure 6, increasing the subset size $m$ leads to improvements in Normalized Mutual Information (NMI) and Accuracy (ACC), with performance stabilizing as $m$ increases. This suggests that a relatively small pool of candidates is sufficient for the LLM to provide effective guidance.
5. Conclusion
LeBoT offers a flexible, scalable, and model-agnostic solution for unsupervised short-text clustering. By leveraging LLMs to build a new vector space rather than refining an existing one, it avoids the biases of pre-trained models and excels in real-world "cold start" scenarios where labels and cluster counts are unknown. Future work will explore multi-lingual applications and the integration of human-in-the-loop feedback.
Summary updated