Abstract
Existing multimodal retrieval models often struggle with the "modality gap," where different data formats (text, images, or fused content) representing the same semantic concept are mapped to distant regions in an embedding space. This paper introduces Generalized Contrastive Learning (GCL), a training framework that enables models to retrieve information across any combination of modalities. By rethinking the use of standard image-caption pairs and implementing an all-to-all contrastive loss, GCL achieves state-of-the-art performance on universal retrieval benchmarks without the need for expensive, manually curated triplet datasets.
Introduction
While models like CLIP have revolutionized cross-modal retrieval—enabling users to find images using text queries—they often falter in "universal" retrieval scenarios. Modern information retrieval frequently requires navigating complex combinations: searching for a Wikipedia page (fused image and text) using a text query, or using an image-text pair to find a related video.
The primary technical obstacle is the modality gap. In a model's embedding space, an image of an object and its textual description often remain mathematically distant. This gap is exacerbated when dealing with "fused" modalities. Current solutions typically attempt to bridge this gap by generating massive synthetic datasets of triplets (Image, Text, and Fused), a process that is computationally expensive, difficult to curate, and often fails to generalize to unseen retrieval scenarios.
Methodology: Generalized Contrastive Learning (GCL)
Generalized Contrastive Learning (GCL) is proposed as a "plug-and-play" loss formulation that allows models to learn from all possible modality combinations simultaneously. Unlike traditional methods, GCL does not require specialized triplet data; it leverages existing image-caption pairs to simulate a multi-modal environment.
1. Unified Mini-Batches
GCL constructs mini-batches containing three distinct types of embeddings for every sample: Image ($e_i$), Text ($e_t$), and Fused Image-Text ($e_{it}$). For standard models like CLIP, the fused embedding is generated by summing the image and text vectors. For more complex architectures like VISTA, a specialized fusion layer is utilized.
2. All-to-All Contrastive Loss
Standard contrastive learning typically optimizes for two combinations (Image $\leftrightarrow$ Text). In contrast, GCL enforces semantic alignment across six different positive pairs:
- $(i, t)$ and $(t, i)$
- $(i, it)$ and $(it, i)$
- $(t, it)$ and $(it, t)$
3. Negative Pushing
Within each mini-batch, the model is trained to push away all "negative" samples regardless of their modality. This forces the model to ignore the format of the data and focus exclusively on semantic meaning, effectively merging the previously distinct "islands" of different modalities into a single, intermixed continent in the embedding space.
Experimental Setup
Training Data
The researchers utilized the LLaVA Visual Instruct Pretrain LCS-558K dataset. This dataset consists of standard image-caption pairs, demonstrating that GCL can achieve superior results without the need for specialized, hard-to-acquire triplet datasets.
Evaluation Benchmarks
The framework was evaluated across three major benchmarks:
- M-BEIR: A comprehensive benchmark for multimodal retrieval covering 10 datasets.
- MMEB: A benchmark focused on massive multimodal embedding tasks across 12 sub-datasets.
- CoVR: A benchmark specifically for composed video retrieval (using text + image to find video).
Key Results and Insights
The implementation of GCL yielded consistent performance gains across various model architectures:
- VISTA + GCL: On the M-BEIR global retrieval benchmark, the average Recall@50 improved significantly from 21.18 to 34.06.
- CLIP-SF + GCL: Performance on the same benchmark rose from 14.92 to 21.89.
- Video Retrieval: On the CoVR benchmark, GCL nearly doubled the Recall@1 for CLIP-based models, moving from 19.68 to 37.60.
- Model Efficiency: One of the most striking findings was the performance of TinyCLIP + GCL (120M parameters). This lightweight model outperformed much larger standard models, including the original VISTA (196M parameters) and CLIP-SF (427M parameters), on the M-BEIR benchmark.
PCA visualizations confirmed the theoretical goals of the framework: before GCL, images, text, and fused samples formed three distinct clusters. After GCL training, these clusters merged, significantly increasing the cosine similarity between semantically related items across different modalities.
Conclusion
Generalized Contrastive Learning demonstrates that the modality gap can be bridged through algorithmic refinement rather than just data scaling. By treating fused modalities as equal participants in the contrastive loss, GCL provides a simple, efficient, and scalable path toward universal multimodal retrieval. Future work will explore the integration of GCL with Multimodal Large Language Models (MLLMs) to enhance retrieval-augmented generation (RAG) and the application of dynamic loss weighting to prioritize specific retrieval tasks.
Summary updated