Abstract
Contrastive Language-Image Pre-training (CLIP) models often exhibit a "modality gap" where image and text embeddings remain clustered separately in the feature space. This gap hinders cross-modal performance. We present CLIP-Refine, a lightweight "post-pre-training" stage that bridges this gap using two novel objectives: Random Feature Alignment (RaFA) and Hybrid Contrastive-Distillation (HyCD). By training for just one epoch on a small dataset like COCO, CLIP-Refine significantly enhances zero-shot classification and retrieval without catastrophic forgetting.
Introduction
Contrastive Language-Image Pre-training (CLIP) has become a cornerstone of vision-language modeling. Despite its success, a persistent "modality gap" exists where image and text features occupy distinct regions of the embedding space. This separation limits the precision of cross-modal mapping, especially for fine-grained tasks. Traditional solutions—re-training from scratch or intensive fine-tuning—are either computationally prohibitive or prone to catastrophic forgetting of general knowledge.
The authors propose a "middle-way" phase called post-pre-training: a short, efficient alignment step that uses off-the-shelf pre-trained models and small, high-quality datasets to refine the embedding space.
The CLIP-Refine Framework
The core of the framework introduces two primary techniques to refine the embedding space while preserving the model's general-purpose capabilities:
- Random Feature Alignment (RaFA): Instead of directly minimizing the distance between image and text features (which can cause feature space collapse), RaFA pulls both features toward a shared random reference vector sampled from a Gaussian prior. This encourages the two modalities to follow the same distribution while preserving "uniformity"—ensuring features remain spread out and informative on the hypersphere.
- Hybrid Contrastive-Distillation (HyCD): To prevent the model from forgetting its original knowledge, a frozen, original CLIP model acts as a "teacher." HyCD blends ground-truth labels with the teacher's soft predictions. This hybrid label allows the model to learn new alignment while anchored to its original, broad-world knowledge.
Experimental Results
The method was evaluated using COCO Captions (118k samples) for the post-pre-training phase. Evaluation spanned 12 zero-shot classification datasets (including ImageNet, Oxford Pets, and EuroSAT) and multiple retrieval benchmarks.
- Zero-shot Classification: On a ViT-B/32 model, CLIP-Refine improved average accuracy across 12 datasets from 52.74% to 54.69%.
- Cross-modal Retrieval: Improvements were even more dramatic. On Flickr30k (Image-to-Text), the Recall@1 score jumped from 24.52 to 30.99.
- Efficiency: These gains were achieved in just one epoch of training on a single NVIDIA A100 GPU, making it a highly accessible method for researchers with limited compute.
Key Insights and Discussion
A major finding is the importance of data quality over quantity. Surprisingly, training on the relatively small but high-quality COCO dataset yielded better results than training on the much larger but noisier CC12M dataset. This suggests that for modality alignment, clean captions are more critical than massive scale.
Furthermore, the use of randomness in RaFA proved essential for generalization; using a fixed reference point led to overfitting. While the modality gap is significantly reduced rather than eliminated, CLIP-Refine offers a practical and efficient path toward better-aligned vision-language foundation models.
Summary updated