arXiv:2410.00927cs.CLcs.IR2024-10被引 23

用大模型零样本聚类,省去调参和计算开销。

Text Clustering as Classification with LLMs

  • 把聚类转为分类任务,利用大模型上下文学习生成标签。
  • 在多个数据集上性能媲美或超越主流方法,计算量大幅降低。
  • 无需微调模型,适合快速部署与小样本场景使用。

文本聚类是组织和理解非结构化文本数据的基础技术,尤其在人工标注成本过高的场景中尤为重要。随着大语言模型(LLMs)在各类自然语言处理任务中的显著成效,研究者开始探索其在文本聚类中的应用。然而,现有基于LLM的方法仍依赖微调的嵌入模型和复杂的相似度度量,计算开销大且需领域适配。为此,本文提出一种新框架,将文本聚类重构为分类任务,充分利用LLM的上下文学习能力。该框架包含两步:首先,通过提示让LLM根据数据集生成候选标签,并合并语义相近的标签;其次,为每条文本分配最合适的标签。借助LLM强大的自然语言理解和泛化能力,该方法实现了低人力干预下的有效聚类。实验表明,在多个数据集上,本方法性能达到或超过当前最优嵌入式聚类技术,同时显著降低计算复杂度与资源消耗。这些结果凸显了大模型在简化和提升文本聚类任务方面的变革潜力。代码已公开于 https://github.com/ECNU-Text-Computing/Text-Clustering-via-LLM,附录亦可获取。

原文摘要 · Abstract (English)

Text clustering serves as a fundamental technique for organizing and interpreting unstructured textual data, particularly in contexts where manual annotation is prohibitively costly. With the rapid advancement of Large Language Models (LLMs) and their demonstrated effectiveness across a broad spectrum of NLP tasks, an emerging body of research has begun to explore their potential in the domain of text clustering. However, existing LLM-based approaches still rely on fine-tuned embedding models and sophisticated similarity metrics, rendering them computationally intensive and necessitating domain-specific adaptation. To address these limitations, we propose a novel framework that reframes text clustering as a classification task by harnessing the in-context learning capabilities of LLMs. Our framework eliminates the need for fine-tuning embedding models or intricate clustering algorithms. It comprises two key steps: first, the LLM is prompted to generate a set of candidate labels based on the dataset and then merges semantically similar labels; second, it assigns the most appropriate label to each text sample. By leveraging the advanced natural language understanding and generalization capabilities of LLMs, the proposed approach enables effective clustering with minimal human intervention. Experimental results on diverse datasets demonstrate that our framework achieves comparable or superior performance to state-of-the-art embedding-based clustering techniques, while significantly reducing computational complexity and resource requirements. These findings underscore the transformative potential of LLMs in simplifying and enhancing text clustering tasks. We make our code available to the public for utilization at https://github.com/ECNU-Text-Computing/Text-Clustering-via-LLM. We also provide the supplementary Appendix within the repository.

文本聚类大模型零样本分类

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。