In-Context Clustering with Large Language Models
Not on the map. Why?
Abstract (arXiv)
We propose In-Context Clustering (ICC), a flexible LLM-based procedure for clustering data from diverse distributions. Unlike traditional clustering algorithms constrained by predefined similarity measures, ICC flexibly captures complex relationships among inputs through an attention mechanism. We show that pretrained LLMs exhibit impressive zero-shot clustering capabilities on text-encoded numeric data, with attention matrices showing salient cluster patterns. Spectral clustering using attention matrices offers surprisingly competitive performance. We further enhance the clustering capabilities of LLMs on numeric and image data through fine-tuning using the Next Token Prediction (NTP) loss. Moreover, the flexibility of LLM prompting enables text-conditioned image clustering, a capability that classical clustering methods lack. Our work extends in-context learning to an unsupervised setting, showcasing the effectiveness and flexibility of LLMs for clustering. Our code is available at https://agenticlearning.ai/icc.
Key facts. No citing papers in the map yet (data through 7 Oct 2026). Builds on 32 of its 52 references that are in the map. First posted on arXiv 9 Oct 2025.
Builds on
32 of 52 references.
References · 32
- 2017Attention Is All You Needcited by 59,932
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2023GPT-4 Technical Reportcited by 18,132
- 2021LoRA: Low-Rank Adaptation of Large Language Modelscited by 14,084
- 2023Lost in the Middle: How Language Models Use Long Contextscited by 3,383
- 2023Qwen Technical Reportcited by 3,273
- 2023Sigmoid Loss for Language Image Pre-Trainingcited by 3,048
- 2023Sparks of Artificial General Intelligence: Early experiments with GPT-4cited by 2,579
- 2017EuroSAT: A Novel Dataset and Deep Learning Benchmark for Land Use and Land Cover Classificationcited by 1,488
- 2022What Can Transformers Learn In-Context? A Case Study of Simple Function Classescited by 700
- 2021Multimodal Few-Shot Learning with Frozen Language Modelscited by 657
- 2024An Image is Worth 1/2 Tokens After Layer 2: Plug-and-Play Inference Acceleration for Large Vision-Language Modelscited by 629
20 more
- 2021ImageNet-21K Pretraining for the Massescited by 607
- 2022Towards Reasoning in Large Language Models: A Surveycited by 593
- 2024LLaVA-NeXT-Interleave: Tackling Multi-image, Video, and 3D in Large Multimodal Modelscited by 571
- 2023Large Language Models Are Zero-Shot Time Series Forecasterscited by 491
- 2024MInference 1.0: Accelerating Pre-filling for Long-Context LLMs via Dynamic Sparse Attentioncited by 375
- 2024Long-context LLMs Struggle with Long In-context Learningcited by 285
- 2019Self-Supervised Learning by Cross-Modal Audio-Video Clusteringcited by 264
- 2016Using Deep Learning for Image-Based Plant Disease Detectioncited by 216
- 2023The emergence of clusters in self-attention dynamicscited by 133
- 2024LLM as a Mastermind: A Survey of Strategic Reasoning with Large Language Modelscited by 97
- 2023Large Language Models Enable Few-Shot Clusteringcited by 72
- 2023ClusterLLM: Large Language Models as a Guide for Text Clusteringcited by 69
- 2024From Words to Numbers: Your Large Language Model Is Secretly A Capable Regressor When Given In-Context Examplescited by 55
- 2024MADTP: Multimodal Alignment-Guided Dynamic Token Pruning for Accelerating Vision-Language Transformercited by 53
- 2024LLM as Dataset Analyst: Subpopulation Structure Discovery with Large Language Modelcited by 43
- 2023Image Clustering Conditioned on Text Criteriacited by 26
- 2023Meta Learning to Bridge Vision and Language Models for Multimodal Few-Shot Learningcited by 20
- 2018Improving Image Clustering With Multiple Pretrained CNN Feature Extractorscited by 12
- 2024Context-Aware Clustering using Large Language Modelscited by 9
- 2024Multimodal Generalized Category Discoverycited by 7
Built on by
Not cited yet.