TL;DR
Conventional wisdom says you shouldn't use CLIP’s original contrastive loss to fine-tune it on small datasets because small batch sizes cause "catastrophic forgetting." This paper discovers that batch size isn't the villain—the temperature parameter is. By simply turning down the contrastive temperature and combining it with two lightweight stabilizing losses, the authors create ComCLIP, a single-epoch upgrade for CLIP's vision encoder that boosts visual feature quality while remaining a zero-cost, drop-in replacement for downstream vision-language models.
What Problem Does This Paper Address?
OpenAI’s CLIP is the visual backbone for countless modern Vision-Language Models (VLMs) like LLaVA. However, CLIP has well-known blind spots on fine-grained visual details. Retraining CLIP from scratch is wildly expensive and breaks compatibility with existing models built around CLIP’s specific embedding space.
The pragmatic alternative is post-training: refining a pretrained CLIP on a small dataset. Recently, researchers abandoned CLIP’s native contrastive loss (InfoNCE, which pulls matched image-text pairs together and pushes mismatched "negatives" apart) during post-training. They argued that affordable small batch sizes don't provide enough negative examples, causing the model to forget what it already knew. Instead, the field pivoted to complex distillation recipes. The authors ask: Is contrastive post-training really broken because of batch size, and how can we upgrade CLIP's vision encoder without breaking downstream VLM compatibility?
Methods
The authors propose ComCLIP, a single-epoch post-training recipe. Crucially, they freeze CLIP’s text encoder and only update the vision encoder. Because the text space never moves, the refined vision encoder remains a strict drop-in replacement for existing VLMs with zero added inference cost.
ComCLIP shapes the vision encoder's output embeddings using one core principle—refine relative structure while anchoring absolute geometry—via three losses:
- Properly-Tempered Contrastive Loss (The twist on a standard tool): Standard InfoNCE loss, but with the temperature parameter $\tau$ lowered from CLIP's pretraining default ($\approx 0.07$) down to $0.01$.
- MSE Anchoring Loss: Mean squared error between the trainable vision encoder and a frozen copy of the original CLIP vision encoder, preventing the feature space from drifting.
- Relational Distillation from DINOv2: DINOv2 is a self-supervised vision model with rich visual structure. Instead of forcing CLIP embeddings to match DINOv2 coordinates directly (which ruins text alignment), ComCLIP uses KL divergence to match their batch-wise similarity matrices—teaching CLIP which images look similar to each other according to DINOv2.
Datasets
No new benchmarks are introduced.
- Post-training: Conceptual Captions 3M (CC3M, default), CC12M, and human-annotated COCO Caption (591K pairs), plus ImageNet-1K for baselines.
- Evaluation: Zero-shot classification across 12 datasets, image-text retrieval on MS COCO and Flickr30K, linear probing (training a simple linear classifier on frozen features) across 5 datasets, fine-grained perception on MMVP (135 image pairs), and 8 VLM benchmarks (including AI2D, POPE, MME, TextVQA, and OCRBench) using LLaVA-1.5-7B.
Key Insights and Ideas
- Temperature, not batch size, caused "forgetting": In a pretrained CLIP, most image-text pairs are already well-separated. In the InfoNCE gradient math, the update weight on a negative pair decays exponentially based on its margin divided by temperature $\tau$. At $\tau = 0.07$, already-correct pairs still receive noticeable gradients, pushing CLIP to overfit the small dataset. Lowering $\tau$ to $0.01$ makes gradients on easy pairs vanish, leaving existing knowledge intact and focusing updates strictly on hard mistakes.
- Different losses govern separable skills: Ablations show a remarkably clean division of labor. Tempered contrastive loss boosts zero-shot classification and retrieval; MSE anchoring preserves transferable visual features; and DINOv2 relational distillation gives linear-probe transferability an extra push.
Key Results
Tested on ViT-B/16 and ViT-L/14 backbones, ComCLIP improves all four core evaluation dimensions over the original OpenAI CLIP.
- Temperature rescue: On ViT-B/16 (CC3M), naive contrastive post-training at $\tau = 0.07$ drops zero-shot accuracy from $61.82\%$ to $57.90\%$. Changing only $\tau$ to $0.01$ flips that loss into a gain ($62.90\%$).
- Trade-offs vs. self-distillation (CLIP-Refine): Over 3 seeds on ViT-B/16, ComCLIP matches CLIP-Refine on zero-shot accuracy ($63.00\%$ vs. $62.87\%$) and trails on retrieval, but dramatically outperforms it on visual feature transferability via linear probing ($48.99\%$ vs. $42.28\%$; CLIP-Refine actually degrades below original CLIP's $44.70\%$). On ViT-L/14, ComCLIP also beats CLIP-Refine on MMVP ($24.20\%$ vs. $19.01\%$).
- Drop-in VLM compatibility: Swapping ComCLIP into LLaVA-1.5-7B without retraining the projector or LLM yields $+0.02\%$ mean relative change across 8 benchmarks—confirming it doesn't break the frozen VLM, whereas baselines slightly degrade performance ($\approx -1\%$).
Limitations and Future Work
- Compatibility $\neq$ instant VLM gains: Swapping ComCLIP into a frozen LLaVA preserves performance rather than improving it; whether re-aligning the projector unlocks ComCLIP's better visual features for VLM tasks remains untested.
- Scope of math and metrics: The temperature gradient analysis applies specifically to InfoNCE, not KL self-distillation or SigLIP’s sigmoid loss. Also, ComCLIP isn't designed to maximize fine-grained perception like heavy generative-model methods do, and MMVP's tiny size (135 pairs) causes high seed variance.
- Data scaling: More data isn't automatically better—12M pairs (CC12M) did not consistently beat 3M pairs (CC3M) in single-epoch training, leaving the exact interplay of data quality and training dynamics an open question.
Summary updated