General-purpose embedding models excel at recognizing semantic similarities but fail to capture the characteristics of texts specified by user instructions. In contrast, instruction-tuned embedders can align embeddings with textual instructions yet cannot autonomously infer latent corpus structures, such as determining the optimal number of clusters. To address both limitations, we reframe instruction-following clustering as a generative task and train large reasoning models (LRMs) as autonomous clustering agents. Our reasoning-driven training pipeline enables LRMs to interpret high-level clustering instructions and then infer the corresponding latent groupings. To evaluate this paradigm, we introduce ReasonCluster, a comprehensive benchmark comprising 28 diverse tasks spanning daily dialogue, legal cases, and financial reports. Experiments across diverse datasets and clustering scenarios show that our approach consistently outperforms strong embedding-based methods and LRM baselines, demonstrating that explicit reasoning fosters more faithful and interpretable instruction-based clustering.
Figures & tables
Figure 1: Overview of embedding-based vs. reasoning-driven clustering. LRMs follow diverse user instructions and adaptively infer latent group structures.
Figure 2: The system prompt for clustering.
Figure 3: The overview of our multi-agent data synthesis pipeline.
Figure 4: Overview of the benchmark evaluation splits: (a) dataset statistics by source and split, where text and input lengths are measured in tokens, (b) distribution of the number of clusters per data example, and (c) distribution of cluster size, indicating the number of text instances per cluster for each dataset.
Model
LMSY
ECHR
SP500
AVG
OVERALL
C0
C1
C2
C0
C1
C2
C0
C1
C2
C0
C1
C2
V
Reasoning Models
o3
63.60
63.42
64.17
85.75
85.79
47.04
57.01
59.04
66.51
68.79
69.42
59.24
65.08
Gemini 2.5 Pro
55.98
56.06
57.95
85.05
84.14
64.29
57.60
63.43
69.34
66.21
67.88
60.92
61.82
GPT-oss-120B
48.74
49.30
52.77
70.54
69.18
52.58
44.76
48.15
51.84
54.68
55.54
52.40
52.31
DeepSeek-R1
42.96
43.64
45.80
53.78
54.55
34.06
41.57
40.47
39.69
46.10
46.22
39.85
44.06
Table 1: V-measure (%) score across three datasets under different evaluation splits (C0, C1, C2; see Section 4.3 for details). The final column presents the overall V-measure computed over all individual samples. Bold indicates the best result, and proprietary models are highlighted. Reasoning models outperform general models across all settings. Our models achieve the strongest overall performance, indicating that explicit reasoning supervision is crucial for faithful instruction-following clustering.
Model
LMSY
ECHR
SP500
AVG
OVERALL
C0
C1
C2
C0
C1
C2
C0
C1
C2
C0
C1
C2
V
K-means
Qwen3-Embedding
55.88
56.28
53.26
74.58
71.87
59.45
53.41
54.67
60.81
61.29
60.94
57.84
58.31
InBedder
52.19
52.05
45.95
67.46
66.08
48.13
53.06
53.97
49.72
57.57
57.37
47.93
53.28
Instructor
47.20
47.04
44.04
58.12
57.42
47.30
48.74
49.12
47.28
51.35
51.19
46.21
48.55
OpenAI-Embedding
50.63
51.28
49.11
56.58
55.99
45.75
47.74
48.82
48.47
51.65
52.03
47.78
50.66
Table 2: Comparison of embedding-based clustering against our models. Results of instruction-following embedders (Qwen3-Embedding, InBedder, and Instructor) are highlighted. Bold indicates the best result. While instruction-tuned embedders outperform generic embedders, they remain consistently inferior to reasoning-based clustering.
Method
C0
C1
C2
Ave.
SFT + Final Answer
65.51
52.70
8.20
42.14
SFT + Distilled + Final Answer
64.87
54.76
11.98
43.87
SFT + Distilled + RL
72.26
71.96
57.15
67.12
Table 3: Comparison of reasoning training versus SFT directly on final answer. Reasoning supervision is essential for generalization: models trained without reasoning fail on C2, while the full pipeline remains robust.
Method
C0
C1
C2
Ave.
7B Base Model
+ RL
46.72
48.19
46.52
44.90
+ RL + Reasoning Hint
48.19
49.99
46.07
46.42
+ Distill + RL + Reasoning Hint
66.05
65.97
56.46
61.80
14B Base Model
+ RL
56.39
53.57
53.71
52.76
Table 4: Comparison of training recipes across 7B and 14B models. Prompt-level reasoning hints offer limited benefits, whereas combining reasoning distillation with RL yields the strongest performance.
Figure 5: Training dynamics of different training recipes for the Qwen-7B model. Models initialized with distilled reasoning traces converge faster, exhibit more stable response lengths, and achieve higher rewards.
Figure 6: Effect of model size on clustering performance and generalization. The y-axis shows the average V-measure over all corresponding samples.
Appendix figures & tables11 assets
Supplementary material from the paper’s appendix.
Appendix
Figure 7: The system prompt of cluster generation agent.
Figure 8: The system prompt for taxonomy refinement and clustering instruction design.
Figure 9: The system prompt for expert classification using a predefined taxonomy.
Figure 10: The system prompt for clustering assistant with required output format.
Figure 11: The system prompt for reasoning chain generation.
Figure 12: The system prompt for reasoning chain refinement.
Figure 13: LMSYS-Chat data example.
Figure 14: ECHR data example.
Figure 15: Example of Item 2 (“Properties”) from SP500 dataset.
Dataset
Split
Prompt
ECHR
Held-in
Cluster these legal cases by the primary vulnerable population involved. Cluster these legal cases by the dominant type of domestic proceedings that preceded the European Court application. Cluster these legal cases by the violation articles invoked in the Court’s judgment.
Held-out
Cluster the following texts based on the primary underlying category of legal dispute or issue. Cluster the following texts based on the main types of parties or entities involved as adversaries or plaintiffs. Cluster the following texts based on the timing, duration, or current stage of resolution for the described legal proceedings.
LMSY
Held-in
Cluster the following user requests based on explanation audience level. Cluster these requests by temporal regime they focus on. Cluster the dialogue by identifying the root cause of the issue. Cluster the dialogue based on the type of transformation needed to convert it into a different form or function. Cluster these creative generation requests by content type. Group each dialogue according to the primary social function or interpersonal purpose it serves. Cluster these decision support requests based on the structure and format of the solution being requested. Group these recommendation requests by identifying the type of justification used. Cluster the dialogues by the distinct perspective or evaluative role the agent adopts. Group the conversations based on the type of structured planning or scheduling being discussed.
Held-out
Group these computational tasks by archetype. Cluster these data analysis requests by tooling context. Cluster these texts based on the kind of external context or disambiguation needed. Group these factual lookup requests by the structure and format of the expected output. Cluster these factual lookup requests based on the type of source or origin of information.
SP500
Held-in
Cluster these SP500 companies by their asset ownership and utilization patterns. Cluster these SP500 companies by their geographic distribution of assets and operations. Cluster these SP500 companies by their industry-specific asset composition. Cluster these SP500 companies by their risk exposure and asset encumbrance patterns.
Held-out
Cluster the texts based on the strategies companies use for distributing earnings to shareholders via dividends. Cluster the texts based on the approaches companies take toward buying back their own shares. Cluster the texts based on the varieties of equity instruments issued by companies.
Appendix
Table 5: Clustering instructions for both held-in and held-out tasks from each dataset.
Figure 16: Relationship between format accuracy and V-measure score. Models with higher format accuracy consistently achieve higher V-measure scores, highlighting format correctness as a fundamental prerequisite for clustering quality. Nevertheless, high format accuracy alone does not guarantee superior clustering performance. For instance, models such as Llama-3.1-70B-Instruct exhibit high format accuracy but still attain low V-measure scores. Effective clustering further depends on a model’s capacity for semantic reasoning and clustering instruction alignment. Mastering the syntax of clustering outputs is necessary but not sufficient.
Recent text-clustering methods use large language models to propose a cluster taxonomy from a corpus and then assign each text to it. These pipelines are fundamentally programmatic: the sequence of LLM calls and the rules for stopping, merging, and splitting clusters are fixed in code in advance, so they generalise poorly across corpora of different structure and cannot easily incorporate user-supplied constraints such as a target cluster count or a clustering intent. We propose an agentic alternative in which an orchestrator LLM inspects the state of the discovery process at each step and dispatches one of a small set of specialised agents -- proposer, synthesizer, auditor, investigator, and critic -- adapting the pipeline to the corpus rather than executing a fixed one. On seven public text-clustering benchmarks the method achieves state-of-the-art performance, beating the strongest prior baseline by 47% in mean ARI.
Unifying image clustering across different clustering scenarios remains challenging due to fundamental gaps among tasks. We introduce a Guideline-Driven Image Clustering Agent, the first universal framework that bridges these gaps through textual guidelines. To incorporate complex guidelines without task-specific training, we propose Generative Concept Proxy Modeling, which generates guideline-aware embeddings via concept proxy extraction. For scenarios requiring automatic cluster discovery, we introduce LLM Traversal based on Minimum Spanning Tree that selectively applies LLM reasoning for complex semantic judgments. Our method generalizes across diverse clustering scenarios spanning from general to fine-grained categorization, from global to local criteria, and from balanced to long-tail distributions. Our framework consistently outperforms specialized methods across diverse clustering tasks.
Multimodal objects can require different partitions under different instructions, as when products in an e-commerce catalog are grouped by color, material, or both. Retrieval-oriented embeddings may not recover these partitions, while generative clustering often relies on intermediate descriptions or iterative decisions. This paper presents CIM-Embed, a framework for learning instruction-conditioned multimodal embeddings for clustering. Supervised contrastive learning uses same-group positives and negatives from other groups, optionally including other tasks; heterogeneous structured batches accommodate tasks with different group counts. At inference, the model maps each object's image, text, and instruction directly to an embedding; HDBSCAN then forms a partition without the ground-truth cluster count. We construct ProductMIC from product metadata in Amazon Reviews 2023, comprising training data and an evaluation benchmark for instruction-conditioned clustering. The benchmark contains 5,373 products and 449 single-attribute and compositional grouping tasks spanning 50 leaf categories excluded from our training. With full-dimensional embeddings and HDBSCAN, direct within-task SupCon training achieves a mean per-task V-measure of 95.01, compared with 53.06 for WeMM 9B, the strongest general-purpose embedding baseline evaluated. Frozen product-trained encoders also improve out-of-domain conditional grouping, while controlled transfer experiments distinguish partition transfer from instruction response. We will release the code and dataset upon acceptance.
Yinghua Xu, Pengyang Xie, Yanxiang Zhou +4
College of Control Science and Engineering, Zhejiang University · Alibaba International Digital Commerce