LLM-MemCluster: Empowering Large Language Models with Dynamic Memory for Text Clustering
Yuanjie Zhu, Liangwei Yang, Ke Xu, Weizhi Zhang, Zihe Song, Jindong Wang, Philip S. Yu
TL;DR
This work tackles unsupervised text clustering with large language models by overcoming LLM statelessness and the challenge of determining the number of clusters. It introduces LLM-MemCluster, which embeds a Dynamic Memory to maintain evolving cluster labels and uses a Dual-Prompt Strategy to actively control clustering granularity in a single-pass, end-to-end process. The approach achieves state-of-the-art results on six public benchmarks without model fine-tuning, significantly outperforming traditional embedding pipelines and prior LLM-based baselines. The findings suggest that architectural design choices—stateful memory and adaptive prompting—drive gains across diverse LLMs, enabling robust, tuning-free clustering in real-world settings.
Abstract
Large Language Models (LLMs) are reshaping unsupervised learning by offering an unprecedented ability to perform text clustering based on their deep semantic understanding. However, their direct application is fundamentally limited by a lack of stateful memory for iterative refinement and the difficulty of managing cluster granularity. As a result, existing methods often rely on complex pipelines with external modules, sacrificing a truly end-to-end approach. We introduce LLM-MemCluster, a novel framework that reconceptualizes clustering as a fully LLM-native task. It leverages a Dynamic Memory to instill state awareness and a Dual-Prompt Strategy to enable the model to reason about and determine the number of clusters. Evaluated on several benchmark datasets, our tuning-free framework significantly and consistently outperforms strong baselines. LLM-MemCluster presents an effective, interpretable, and truly end-to-end paradigm for LLM-based text clustering.
