Manuscript Offprint

arXiv:2610.21805

CIM-Embed: Learning Instruction-Conditioned Multimodal Embeddings for Clustering

Yinghua Xu, Pengyang Xie, Yanxiang Zhou, Chuanzhi Tong, Xiao Xiao, Chaoqun Feng, Xiaoqing Wang

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

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.

1 INTRODUCTION

Organizing products in e-commerce often requires grouping the same collection by different criteria, such as color, material, or their combination. This need reflects a broader problem: for the same collection of multimodal objects, the appropriate partition depends on the current grouping criterion, and whether two objects belong to the same group can change accordingly. For example, red and blue wooden cups belong together when grouped by material but separate when grouped by color; grouping by both color and material requires agreement on both attributes. Evidence for the relevant attributes may be distributed across images and text. We address instruction-conditioned multimodal clustering, investigating how to learn multimodal representations that enable a clustering algorithm to recover the partition specified by a natural-language grouping instruction.

Shared multimodal embedding spaces support image–text alignment and retrieval, while instruction-aware models extend these capabilities to task-conditioned embedding tasks (Radford et al., 2021;

∗^{*}Corresponding author

Figure

Figure 1: Illustration of grouping the same eight faucets by color, handle type, or both. All partitions are schematic rather than empirical model predictions.

Wei et al., 2024; Lin et al., 2025; Li et al., 2026; Zhou et al., 2026). Retrieval evaluates whether relevant objects rank ahead of alternatives for an anchor, while conditional similarity evaluates whether similarities reflect a specified criterion. Neither evaluation directly establishes whether a clustering algorithm can recover the complete instruction-specified partition of an object collection. In the task studied here, the same pair of objects may belong together under one grouping instruction and to different groups under another; success is assessed by recovering the target partition across the collection. Conditional clustering systems offer another route: the framework built around GCPM generates concept descriptions, clusters their embeddings, and uses language-model-guided cluster merging (Zhong et al., 2026). This motivates a direct representation-learning question: can the embedding geometry itself be trained to make the partition requested by the instruction recoverable?

We introduce CIM-Embed (Clustering-oriented Instruction-conditioned Multimodal Embeddings), which adapts Qwen3-VL-Embedding using instruction-defined group relations (Li et al., 2026). Within a task, objects assigned to the same target group provide multiple positives for supervised contrastive learning, while objects in different groups provide negatives (Khosla et al., 2020). To supply these relations at each training step, partition-structured batches contain multiple groups and multiple objects per group and can combine tasks with different group counts. We study two comparison scopes: Within compares instances only inside the same task, whereas Cross additionally uses instances from other tasks in the physical batch as negatives. Gradient analysis characterizes how these scopes affect the contrastive objective. At inference, the model directly embeds each object together with its instruction, and HDBSCAN recovers a partition without a supplied cluster count (McInnes et al., 2017); no intermediate descriptions or language-model-based merge decisions are required.

We instantiate this task in e-commerce by constructing ProductMIC from Amazon Reviews 2023 (Hou et al., 2026). It provides training supervision for grouping by individual attributes and by combinations of attributes, together with a benchmark of 449 tasks over 5,373 products from 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, versus 53.06 for WeMM 9B, the strongest general-purpose embedding baseline evaluated (Table 1). As an extension for category retention, staged training adds generic adaptation and replay; its Cross SupCon configuration achieves 93.85 on conditional grouping and 97.08 on category clustering (Tables 1 and 17). We also evaluate frozen encoders on Cards, CLEVR-4, and CIFAR10-MC to examine cross-domain grouping and instruction response (Section 5.6; Appendix G).

Our contributions are:

• We present CIM-Embed, a framework that learns image–text embeddings for direct clustering under natural-language grouping instructions. Instruction-defined group membership supplies multi-positive supervision, while structured batches enable joint training across tasks with different numbers of groups.

• To train and evaluate instruction-defined partition recovery, we construct ProductMIC, comprising training data and a benchmark of 449 single-attribute and compositional grouping tasks across 50 leaf categories excluded from training. The benchmark supports comparisons with general-purpose multimodal embeddings, conditional representation methods, and generative clustering systems.

• We examine within-task partition recovery, the organization of conditioned tasks in a shared space, and category-structure retention through comparison-scope and staged-training experiments. Exact gradient decomposition characterizes the objective differences between Within and Cross. Cross-domain matched controls further show that improved partition quality does not necessarily imply reliable instruction switching.

References (100)

  • C-STS: Conditional semantic textual similarity
  • Don’t reinvent the wheel: Efficient instruction-following text embedding based on guided space transformation (opens the publisher in a new tab)
  • Alexander Hermans, Lucas Beyer, and Bastian Leibe. In defense of the triplet loss for person re-identification. arXiv preprint arXiv:1703.07737, 2017. URL https://arxiv.org/abs/1703.07737. (opens arXiv in a new tab)
  • Bridging language and items for retrieval and recommendation: Benchmarking llms as semantic encoders
  • VLM2Vec: Training vision-language models for massive multimodal embedding tasks
  • Supervised contrastive learning
  • Image clustering conditioned on text criteria
  • Qwen3-VL-Embedding and Qwen3-VL-Reranker: A unified framework for state-of-the-art multimodal retrieval and ranking (opens arXiv in a new tab)
  • CLAY: Conditional visual similarity modulation in vision-language embedding space
  • MM-Embed: Universal multimodal retrieval with multimodal LLMs
  • hdbscan: Hierarchical density based clustering (opens the publisher in a new tab)
  • Controllable clustering with LLM-driven embeddings (opens the publisher in a new tab)
  • Answer is all you need: Instruction-following text embedding via answering the question (opens the publisher in a new tab)
  • Cluster-R1: Large reasoning models are instruction-following clustering agents (opens arXiv in a new tab)
  • Learning transferable visual models from natural language supervision
  • ABC: Achieving better control of visual embeddings using VLLMs
  • One embedder, any task: Instruction-finetuned text embeddings (opens the publisher in a new tab)
  • Representation Learning with Contrastive Predictive Coding
  • GeneCIS: A benchmark for general conditional image similarity
  • Conditional similarity networks
  • Understanding contrastive representation learning through alignment and uniformity on the hypersphere
  • Multi-similarity loss with general pair weighting for deep metric learning
  • Uniir: Training and benchmarking universal multimodal information retrievers
  • Promptriever: Instruction-trained retrievers can be prompted like language models
  • Multi-modal proxy learning towards personalized visual multiple clustering
  • Customized multiple clustering via multimodal subspace proxy learning (opens the publisher in a new tab)
  • ClusterLLM: Large language models as a guide for text clustering (opens the publisher in a new tab)
  • Interpretable text-guided image clustering via iterative search
  • Universal guideline-driven image clustering via a hybrid LLM agent
  • WeMM-Embedding: WeChat Multi-Modal Embedding Technical Report
  • The ProductMIC pipeline comprises product deduplication and form selection, attribute-schema normalization, label verification, and task sampling for individual attributes and their combinations
  • The following subsections specify these stages and their acceptance rules
  • Within a leaf category, products with identical normalized titles and main images are treated as duplicates, retaining the record with more complete information
  • We sample 32 products per category and use a VLM to identify their product forms
  • Brand, product identifiers, rankings, reviews, and logistics fields are excluded as grouping attributes
  • Candidate construction requires at least 18 supporting products per value within a leaf category, retains at most 7 candidate values per key, and requires at least two valid candidates
  • The final annotation input contains 266,074 products, 11,357 attribute keys defined within category–form scopes, and 48,350 candidate values
  • It excludes Details, candidate attribute-value lists, and reference labels
  • It determines whether the product belongs to the target form and predicts values within the candidate domain
  • Labels are then accepted under the following rules:
  • Across the released InfoNCE and SupCon conditional-training formats, ProductMIC-Train covers 1,955 leaf categories, 163,168 distinct product IDs, and 474,458 distinct product–instruction pairs
  • Open-ended functionality, compatible-device, and package-content fields are also excluded when their value combinations are incomplete or their semantic levels are inconsistent
  • Only its target attributes require complete labels; missing values for other attributes do not exclude a product
  • Construction selects a pool $\mathcal{X}_U$ with complete target-attribute labels and implements co-membership as
  • Products are selected after sorting by a stable hash
  • All 50 leaf categories support eligible two-attribute tasks, and 14 support eligible three-attribute tasks
  • Products are deduplicated by ID, with overlap across attribute orders
  • For complete batches in which every instance has at least one positive, we average within each unit and aggregate in proportion to its size:
  • C5M4 and C2M4+C3M4 both provide 3 positives and 16 negatives; the latter replaces some within-unit comparisons with cross-unit comparisons
  • The completed direct and staged configurations are reported in Tables 1, 16, and 17
  • Because these comparisons jointly vary initialization history, training objective, and replay rather than matching all training conditions and budgets, staged results are interpreted as configuration-level comparisons, not isolated ablations of replay or loss effects
  • We use the standard InfoNCE and SupCon formulations (van den Oord et al., 2018; Khosla et al., 2020) to derive the exact relation between Within and Cross, the full bidirectional gradients, and backpropagation through normalization
  • Structured sampling retains the same single-batch SupCon form but changes positive support, class coverage, and the batch distribution, and can therefore change the expected training objective
  • Positives remain restricted to instances with the same contrastive unit and complete attribute tuple
  • The logit derivative for a cross-unit pair is zero under Within and $q_{ij}^C > 0$ under Cross, introducing a cross-unit repulsion coefficient at the level of independent logits
  • It equals 1 when no cross-unit candidates are present and is strictly less than 1 when cross-unit candidates exist and their logits are finite
  • Its gradient changes both within-unit and cross-unit coefficients; it cannot be interpreted as leaving the original within-unit gradient unchanged and merely adding cross-unit repulsion
  • Positive-pair coefficients need not become negative
  • This ratio depends jointly on similarities, candidate counts, and temperature; separation between contrastive units alone does not establish that it approaches zero
  • attraction
  • These observations show that, in this comparison, the pooled relative distance ratio decreases while the task-wise ratio slightly increases; the Uniformity change describes the distribution geometry (Wang & Isola, 2020)
  • If pooled ground truth is jointly defined by $(U, V)$, stronger separation by contrastive-unit identity alone may improve some pooled metrics without demonstrating correct instruction-dependent changes in relations on the same product pool
  • Task-wise evaluation averages 449 tasks equally
  • We compare direct conditional training with generic adaptation followed by conditional training and generic replay
  • Task-wise and pooled evaluations use $Q = Q_{\text{target}}$; generic evaluation uses $Q = Q_{\text{leaf}}$, all with $T = 1$ (Equation (24))
  • $D_{\mathrm{out}}^{(u)}$ averages each class's mean distance to its nearest other class, also equally over classes
  • Full-dimensional and UMAP results appear in Tables 6–8
  • Full-dimensional vectors are L2-normalized before UMAP (5 components, 5 neighbors, minimum distance 0, Euclidean metric, seed 42), with no normalization after projection
  • Cluster counts exclude noise and are averaged across tasks only in the task-wise scope; scoring retains the common noise label –1
  • Noise -1 is retained for scoring but excluded from cluster counts
  • V and coverage are percentages
  • On ProductMIC, Direct Within and Direct Cross outperform Direct InfoNCE in task-wise V-measure for Qwen 2B, WeMM 2B, and WeMM 9B (Table 13)
  • Noise –1 is retained for scoring but excluded from cluster counts
  • Model groups follow Table 1
  • Stage 2 uses generic training; Stage 3 uses conditional training with generic replay and differs from the earlier InfoNCE replay checkpoint
  • >Direct conditional training (Qwen3-VL 8B)</td></tr><tr><td>InfoNCE</td><td>0.2237</td><td>-3.2742</td></tr><tr><td>Within SupCon</td><td>0.0529</td><td>-2.5084</td></tr><tr><td>Cross SupCon</td><td>0.0590</td><td>-3.2891</td></tr><tr><td colspan=
  • >Direct conditional training (Qwen3-VL 8B)</td></tr><tr><td>InfoNCE</td><td>0.9990</td><td>-2.9523</td></tr><tr><td>Within SupCon</td><td>0.4362</td><td>-1.5023</td></tr><tr><td>Cross SupCon</td><td>0.6340</td><td>-2.8466</td></tr><tr><td colspan=
  • ABC and CLAY evaluate complementary routes to conditional representations
  • Predicted cluster counts exclude noise
  • G1 and G2 achieve V-measures of 57.32 and 57.61; semantic refinement increases these by 17.54 and 16.56 percentage points, respectively
  • The originally reported image-only adaptations of ABC, CLAY, ITGC, and Multi-Sub use fixed HDBSCAN parameters (2, 1), whereas our embedding runs use label-assisted parameter selection
  • Selection and scoring use the same task pool in this setting
  • Input modalities and training procedures follow the original runs:
  • For ITGC, we re-evaluate terminal clustering of the representation produced by its original feedback search
  • The unified clustering comparison reuses existing embeddings and generation outputs, leaving the recorded generative workload unchanged
  • Counts include cached generation consumed by evaluation and exclude training annotation and unrelated exploration
  • Multi-Sub additionally performs per-unit optimization, and ITGC performs iterative search
  • GCPM G3/G4 rows report the merging stage; standalone branch totals also include shared proxy generation
  • We matched frozen input/label hashes to the run manifests and reproduced all saved per-unit V-measure, ARI, and coverage scores
  • ITGC's axes refer to task-specific concepts, while Multi-Sub independently optimizes task-local representations; a common cross-task metric space has not been established for these runs
  • CIM-Embed requires no additional generative strong-LLM calls, as is also true for ABC. The recorded pipelines average 4.58, 4.55, and 13.95 requests per task for CLAY, Multi-Sub, and ITGC, respectively
  • Shared multimodal representations support cross-modal retrieval, with instructions specifying the current matching task or similarity criterion (Wei et al., 2024; Lin et al., 2025; Jiang et al., 2025; Li et al., 2026)
  • A second family adjusts representations so that matching or clustering reflects a specified condition
  • InfoNCE contrasts an anchor's positive against negatives, while supervised contrastive learning supports multiple same-class positives (van den Oord et al., 2018; Khosla et al., 2020)
  • Cards contains 8,029 images evaluated under two grouping conditions: rank, with 13 reference classes, and suit, with four
  • All model weights are frozen, without training on Cards
  • CLEVR-4 uses all 10,531 images from the 10k release, combining the original 8,424 training and 2,107 validation images without training the encoder on them
  • $(c, s)$ denotes minimum cluster size and minimum samples; - means None
  • Both datasets use the same ten frozen checkpoints, without target-data training or checkpoint selection
  • V and its differences are in percentage points; coverage is a percentage

Couldn't load all references. Reload the page to try again.