Optimized Algorithms for Text Clustering with LLM-Generated Constraints

Authors

  • Chaoqi Jia Royal Melbourne Institute of Technology
  • Weihong Wu Fuzhou University
  • Longkun Guo Fuzhou University
  • Zhigang Lu Western Sydney University
  • Chao Chen Royal Melbourne Institute of Technology
  • Kok-Leong Ong Royal Melbourne Institute of Technology

DOI:

https://doi.org/10.1609/aaai.v40i27.39379

Abstract

Clustering is a fundamental tool that has garnered significant interest across a wide range of applications including text analysis. To improve clustering accuracy, many researchers have proposed incorporating background knowledge, typically in the form of must‑link and cannot‑link constraints, to guide the clustering process. With the recent advent of large language models (LLMs), there is growing interest in improving clustering quality through LLM-based automatic constraint generation. In this paper, we propose a novel constraint‑generation approach that reduces resource consumption by generating constraint sets rather than using traditional pairwise constraints. This improves both query efficiency and constraint accuracy compared to state‑of‑the‑art methods. We further introduce a constrained clustering algorithm tailored to the characteristics of LLM-generated constraints. Our method incorporates a confidence threshold and a penalty mechanism to address potentially inaccurate constraints. We evaluate our approach on five text datasets, considering both the cost of constraint generation and overall clustering performance. The results show that our method achieves clustering accuracy comparable to the state-of-the-art algorithms while reducing the number of LLM queries by more than 20 times.

Published

2026-03-14

How to Cite

Jia, C., Wu, W., Guo, L., Lu, Z., Chen, C., & Ong, K.-L. (2026). Optimized Algorithms for Text Clustering with LLM-Generated Constraints. Proceedings of the AAAI Conference on Artificial Intelligence, 40(27), 22229-22237. https://doi.org/10.1609/aaai.v40i27.39379

Issue

Section

AAAI Technical Track on Machine Learning IV