Large Language Models Enable Few-Shot Clustering (2024)

Abstract: Unlike traditional unsupervised clustering, semi-supervised clustering allows users to provide meaningful structure to the data, which helps the clustering algorithm to match the user’s intent. Existing approaches to semi-supervised clustering require a significant amount of feedback from an expert to improve the clusters. In this paper, we ask whether a large language model (LLM) can amplify an expert’s guidance to enable query-efficient, few-shot semi-supervised text clustering. We show that LLMs are surprisingly effective at improving clustering. We explore three stages where LLMs can be incorporated into clustering: before clustering (improving input features), during clustering (by providing constraints to the clusterer), and after clustering (using LLMs post-correction). We find that incorporating LLMs in the first two stages routinely provides significant improvements in cluster quality, and that LLMs enable a user to make trade-offs between cost and accuracy to produce desired clusters. We release our code and LLM prompts for the public to use.1

## introduction unsupervised clustering aims to do an impossible task: organize data in a way that satisfies a user's needs without any specification of what those needs are. clustering, by its nature, is fundamentally an underspecified problem. according to @xcite , this underspecification makes clustering ''probably approximately useless.'' semi-supervised clustering, on the other hand, aims to solve this problem by enabling the domain expert to guide the clustering algorithm @xcite ) by providing feedback. prior work has introduced different types of interaction between an expert and a clustering algorithm, such as hand-picked seed points @xcite or pairwise constraints between points @xcite 1 https://github.com/viswavi/few-shot-clustering . ## methods to incorporate llms in this section, we describe the methods that we use to incorporate llms into clustering. ## conclusion we find that using llms in simple ways can provide consistent improvements to the quality of clusters for a variety of text clustering tasks. we find that llms are most consistently useful as a means of enriching document representations, and we believe that our simple proof-of-concept should motivate more elaborate approaches for document expansion via llms.