Post-pre-training for Modality Alignment in Vision-Language Foundation Models

Shin'ya Yamaguchi, Dewei Feng, Sekitoshi Kanai, Kazuki Adachi, Daiki Chijiwa

TL;DR

While CLIP models excel at zero-shot tasks, they suffer from a persistent "modality gap" where image and text features cluster into separate regions of the feature space. This paper introduces CLIP-Refine, a lightweight "post-pre-training" strategy that mitigates this gap in just a single epoch on a single GPU. By balancing distribution alignment with a novel hybrid distillation loss, CLIP-Refine significantly boosts both zero-shot classification and cross-modal retrieval without catastrophic forgetting.

What Problem Does This Paper Address?

Contrastive Language-Image Pre-training (CLIP) has become the bedrock of modern vision-language models. However, CLIP has a hidden flaw: the modality gap. Even after training on billions of pairs, the model encodes images and texts into distinct, isolated clusters on the hypersphere. This geometric separation limits the model's ability to precisely map complex concepts across modalities.

Existing fixes fall into two camps, both with major drawbacks:

  1. Modifying Pre-training: Requires massive datasets and immense computational power (hundreds of GPUs).
  2. Fine-tuning: Optimizes for specific downstream tasks but destroys the model's general, zero-shot capabilities.

The authors propose a new intermediate phase called post-pre-training (Figure 1). The goal is to take an off-the-shelf CLIP model and refine its cross-modal alignment using modest datasets and consumer-grade hardware, all while preserving its generalized knowledge.

Figure 1. Scope of our work: post-pre-training to align the modality gap in pre-trained CLIP models. We aim to address the modality gap and enhance the generalization performance of pre-trained CLIP models through lightweight training.

Methods

CLIP-Refine achieves lightweight alignment through two core techniques (Figure 2):

  1. Random Feature Alignment (RaFA): Naively pulling paired image and text features closer together collapses the feature space, ruining the "uniformity" (how evenly features spread across the hypersphere) required for generalization. Instead, RaFA forces both image and text features to follow a shared prior distribution (like a standard Gaussian). It does this by minimizing the distance of both features to a shared, randomly sampled reference vector.
  2. Hybrid Contrastive-Distillation (HyCD): To prevent the model from forgetting its pre-trained knowledge during this quick adjustment phase, the authors use a modified knowledge distillation loss. HyCD blends the frozen teacher model's similarity matrix with ground-truth labels using alpha-blending, allowing the model to absorb new alignment constraints while anchoring itself to its original representations.
Figure 2. Intuition of CLIP-Refine (proposed method). CLIP-Refine modifies a pre-trained CLIP model by Random Feature Alignment (RaFA, left) and Hybrid Contrastive-Distillation (HyCD, right). RaFA penalizes image and text features to follow a shared prior distribution by minimizing the gap between the features and a random reference vector sampled from the prior. HyCD trains the model with the KL-divergence-based distillation loss using hybrid soft labels composed by alpha blending the ground truth label of image-text pairs with the output of the pre-trained model (teacher).

Datasets

  • Post-pre-training (Refinement): Evaluated using COCO Captions (default), Flickr8K, Flickr30K, CC3M, and CC12M.
  • Evaluation: Tested across 12 standard image classification datasets (including ImageNet, Aircraft, Bird, Caltech-101, DTD, EuroSAT, Flower, Food, Pet, SUN397, and UCF-101) and cross-modal retrieval on COCO2017-Val and Flickr8K/30K.
  • Robustness: Evaluated using ImageNet variants (ImageNet-V2, ImageNet-A, ImageNet-R, and ImageNet-Sketch).

Key Insights and Ideas

  • Direct Alignment is Destructive: Directly minimizing the distance between text and image vectors collapses the feature space. Matching modalities to a random prior distribution instead preserves the hypersphere's uniformity, which is vital for zero-shot transfer.
  • Asymmetric Overfitting: During small-batch contrastive fine-tuning, image encoders overfit much faster than text encoders. Images possess continuous pixel values (higher degrees of freedom) compared to the discrete tokens of text, making the image encoder highly prone to catastrophic forgetting if left unconstrained.
  • Quality Over Quantity: Refining a model on a smaller, high-quality dataset with clean captions (like COCO) yields better modality alignment than training on massive, noisy web-scraped datasets (like raw CC3M), unless strict quality filtering is applied.

Key Results

  • Zero-Shot Classification Boost: For a standard CLIP ViT-B/32, CLIP-Refine improved the average zero-shot classification accuracy across 12 datasets from 52.74% to 54.69% in just one epoch.
  • Substantial Retrieval Gains: Cross-modal retrieval saw massive improvements. On COCO, Text-to-Image (T→I) R@1 performance jumped from 30.56 to 37.64.
  • Closing the Gap Visually: PCA visualizations demonstrate that while standard contrastive fine-tuning distorts the feature space, CLIP-Refine successfully brings the image and text clusters closer together while preserving the natural shape of the distributions (Figure 3).
PCA visualization of feature spaces

Limitations and Future Work

  • Sensitivity to Caption Quality: The success of CLIP-Refine heavily relies on the descriptive quality of the text captions. Performance degraded when using noisy datasets like raw CC12M, meaning users must employ data-filtering pipelines (like DataComp) to get the best results on web data.
  • Incomplete Gap Closure: While CLIP-Refine significantly reduces the modality gap, it does not eliminate it entirely. The authors note this is expected due to theoretical lower bounds inherent to contrastive learning objectives. Future work could explore alternative prior distributions beyond standard Gaussians to further optimize the shared space.

Summary updated

BibTeX
@inproceedings{yamaguchi2025post,
  author = {Shin'ya Yamaguchi and Dewei Feng and Sekitoshi Kanai and Kazuki Adachi and Daiki Chijiwa},
  title = {{Post-pre-training for Modality Alignment in Vision-Language Foundation Models}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2025},
  doi = {10.1109/cvpr52734.2025.00402},
}
Figure