Manuscript Offprint

arXiv:2610.11374

Rethinking Contrastive Loss in CLIP Post-training: A Complementary Framework with Frozen Text Encoder

Zidan Wang, Yaqian Li, Xiaokai Zhang, Kaiwen Long, Kun He, Hanpeng Liu

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

Abstract

CLIP serves as a foundational vision-language model and the de facto vision encoder for downstream VLMs such as LLaVA. Post-training offers a lightweight route to refine CLIP, but recent work argues that the standard contrastive loss is unsuitable for post-training due to catastrophic forgetting under small batches, motivating designs that abandon the contrastive objective in favor of distillation. We revisit this premise and find that, for the InfoNCE objective, the reported forgetting is driven primarily not by insufficient negatives but by an inappropriate magnitude of the contrastive temperature τ\tau: with τ\tau set sufficiently small, contrastive post-training improves rather than degrades the pretrained CLIP, which we explain through the temperature dependence of the InfoNCE gradient. Building on this finding, we propose ComCLIP, a lightweight single-epoch post-training recipe that freezes CLIP's text encoder—so the refined vision encoder is a drop-in replacement with unchanged architecture and inference cost—and trains the vision encoder with a properly-tempered contrastive loss, an MSE anchoring loss against the original CLIP, and a relational distillation loss from DINOv2. Over multiple seeds, ComCLIP matches the self-distillation baseline CLIP-Refine on zero-shot classification while significantly improving the transferability of visual features, measured by linear probing (48.99 vs. 42.28 on ViT-B/16), and on ViT-L/14 it also improves MMVP over CLIP-Refine (24.20 vs. 19.01); CLIP-Refine remains stronger on image-text retrieval. Used as a drop-in vision encoder for LLaVA-1.5-7B without realigning the projector or LLM, ComCLIP yields no net change across 8 VLM benchmarks, i.e., the refinement does not break downstream compatibility. Code and models are available at https://github.com/showstarpro/ComCLIP.git.

1 Introduction

Vision-language foundation models, particularly CLIP (Radford et al., 2021), serve as the de facto vision encoder for modern vision-language models (VLMs) such as LLaVA (Liu et al., 2024a). Despite its success, CLIP exhibits residual issues including the modality gap (Liang et al., 2022) and systematic visual blindness on fine-grained pairs (Tong et al., 2024), which propagate into downstream VLMs. Re-training CLIP from scratch (Zhai et al., 2023; Sun et al., 2023) is prohibitively expensive and breaks compatibility with the existing CLIP-based ecosystem. Post-training—refining a pretrained CLIP on a small dataset with limited compute—offers a pragmatic alternative. We target a developer who upgrades the vision encoder of a CLIP-based VLM without retraining its projector or LLM: the refined encoder must stay in the original CLIP image-text space, and the visual features the VLM consumes should become more transferable.

Existing CLIP post-training methods fall into two categories: self-distillation methods such as CLIP-Refine (Yamaguchi et al., 2025) that use image-text soft labels, and external-teacher distillation

∗^{*}Corresponding authors.

†^{\dagger}Work done during a research internship at Li Auto Inc.

40th Conference on Neural Information Processing Systems (NeurIPS 2026).

methods such as KUEA (Gong et al., 2025) that align the geometric structure of CLIP's visual representations with DINOv2's (Oquab et al., 2024) via kernel-based methods. Notably, both lines deliberately avoid the standard image-text contrastive loss—the very objective that produced CLIP. CLIP-Refine, for instance, argues that contrastive post-training is fundamentally limited by the small batch sizes affordable in this regime, which provide insufficient negative samples and lead to catastrophic forgetting; they report that even scaling the batch size up to 2,048—near the practical ceiling for post-training—still fails to recover the zero-shot performance of the original CLIP. This pessimistic conclusion about contrastive loss has shaped subsequent designs that rely on distillation rather than direct contrastive learning.

Finding 1: Contrastive temperature is a major underappreciated factor in CLIP post-training. We revisit this premise and find that, for the InfoNCE objective, the reported forgetting is driven primarily not by insufficient negatives in small batches but by an inappropriate magnitude of the contrastive temperature τ\tau. Directly inheriting the pretraining initialization τ≈0.07\tau \approx 0.07 (i.e., 1/τ≈141/\tau \approx 14) leads to performance degradation, whereas a substantially smaller τ=0.01\tau = 0.01 (i.e., 1/τ=1001/\tau = 100) does not. The mechanism is visible in the InfoNCE gradient: the gradient on a negative pair decays as exp⁡(−(sii−sij)/τ)\exp(-(s_{ii} - s_{ij})/\tau) in its margin to the positive. Because a pretrained CLIP already separates matched from mismatched pairs, a small τ\tau makes the gradient on easy pairs vanish, so the pretrained geometry is left largely intact, and concentrates the update on the few hard negatives, which refines it (Sec. 3.3). On ViT-B/16 (CC3M, 1 epoch, batch size 1,024), naive contrastive post-training with τ=0.07\tau = 0.07 drops 12-dataset zero-shot accuracy from 61.82 to 57.90, reproducing prior reports; with τ=0.01\tau = 0.01, the same

Figure

Figure 1: Multi-dimensional comparison on ViT-L/14 (values from Table 1). Relative to the original OpenAI CLIP, ComCLIP improves all four evaluation dimensions (zero-shot classification, retrieval, linear probing, MMVP), whereas prior post-training methods exhibit characteristic trade-offs. Each axis is min-max normalized per metric; ComCLIP's MMVP is the 3-seed mean (Sec. 4.3).

objective improves zero-shot accuracy to 62.90 under the same compute budget.

Finding 2: Different post-training objectives act on separable metric families. While properly-tempered contrastive loss alone is beneficial, it leaves the transferability of visual features, measured by linear probing, essentially unchanged. Our loss-decoupling ablation shows that the objectives we consider act on largely separable groups of metrics: the contrastive loss drives zero-shot classification and retrieval, anchoring to the pretrained encoder preserves transferable visual features, and relational distillation from DINOv2 adds further linear-probe transferability. We do not claim this is a unique or exhaustive decomposition of post-training failure modes; it is the empirical basis for combining the objectives. Building on these findings, we propose ComCLIP, a lightweight single-epoch post-training recipe that freezes the text encoder—so the refined vision encoder is a drop-in replacement with unchanged architecture and inference cost—and trains the vision encoder under three losses that follow one principle, refine relative structure while anchoring absolute geometry: a properly-tempered contrastive loss for alignment, an MSE anchoring loss against the original CLIP, and a relational distillation loss from DINOv2.

On ViT-B/16 and ViT-L/14 with one epoch on CC3M or COCO Caption, ComCLIP and the self-distillation baseline CLIP-Refine sit at different points of a trade-off. Over three seeds on ViT-B/16, the two are at parity on 12-dataset zero-shot accuracy (63.00±0.13 vs. 62.87±0.11, not significant), CLIP-Refine is ahead on image-text retrieval, and ComCLIP is substantially ahead on linear probing (48.99±0.35 vs. 42.28±0.62, p < 0.001), an advantage that also holds when both methods use the same post-training data. On ViT-L/14, ComCLIP additionally improves MMVP over CLIP-Refine trained on the same data (24.20±0.86 vs. 19.01±1.86). Swapped into LLaVA-1.5-7B without any re-alignment, ComCLIP yields no net change across 8 VLM benchmarks: the refinement preserves downstream compatibility rather than improving downstream accuracy.

Contributions. (1) We show that, for InfoNCE, the failure of contrastive post-training reported in prior work is driven primarily by the magnitude of τ\tau rather than by batch size, isolate this effect from batch size and temperature learnability, and explain it through the temperature dependence of the InfoNCE gradient. (2) We propose ComCLIP, a lightweight single-epoch post-training recipe with a frozen text encoder that combines a properly-tempered contrastive loss with anchoring and relational distillation. (3) With multi-seed statistics, we show that ComCLIP significantly improves linear-probe transferability over CLIP-Refine at zero-shot parity on ViT-B/16 and ViT-L/14, improves MMVP over CLIP-Refine on ViT-L/14, and serves as a drop-in vision encoder for LLaVA-1.5-7B without degrading downstream performance.

References (71)

  • Conceptual 12m: Pushing web-scale image-text pre-training to recognize long-tail visual concepts
  • Microsoft coco captions: Data collection and evaluation server (opens arXiv in a new tab)
  • Remote sensing image scene classification: Benchmark and state of the art
  • Describing textures in the wild
  • Imagenet: A large-scale hierarchical image database
  • Improving CLIP training with language rewrites
  • Learning generative visual models from few training examples: An incremental bayesian approach tested on 101 object categories
  • MME: A Comprehensive Evaluation Benchmark for Multimodal Large Language Models
  • Kernel-based unsupervised embedding alignment for enhanced visual representation in vision-language models
  • A report on three machine learning contests
  • Eurosat: A novel dataset and deep learning benchmark for land use and land cover classification
  • Natural adversarial examples
  • Clevr: A diagnostic dataset for compositional language and elementary visual reasoning
  • A diagram is worth a dozen images
  • An inverse scaling law for CLIP training
  • Evaluating object hallucination in large vision-language models
  • un $^{2}$clip: Improving clip's visual detail capturing ability via inverting unclip (opens arXiv in a new tab)
  • Promptkd: Unsupervised prompt distillation for vision-language models
  • Mind the gap: Understanding the modality gap in multi-modal contrastive representation learning
  • Microsoft coco: Common objects in context
  • Learning customized visual models with retrieval-augmented knowledge
  • Improved baselines with visual instruction tuning
  • Ocrbench: on the hidden mystery of ocr in large multimodal models
  • Decoupled weight decay regularization
  • Learn to explain: Multimodal reasoning via thought chains for science question answering
  • Genhancer: Imperfect generative models are secretly strong vision-centric enhancers
  • Generation and comprehension of unambiguous object descriptions
  • Representation Learning with Contrastive Predictive Coding
  • Dinov2: Learning robust visual features without supervision
  • Relational knowledge distillation
  • Cats and dogs
  • Learning transferable visual models from natural language supervision
  • Conceptual captions: A cleaned, hypernymed, image alt-text dataset for automatic image captioning
  • Towards vqa models that can read
  • The German Traffic Sign Recognition Benchmark: A multi-class classification competition
  • EVA-CLIP: improved training techniques for CLIP at scale (opens arXiv in a new tab)
  • Eyes wide shut? exploring the visual shortcomings of multimodal llms
  • Similarity-preserving knowledge distillation
  • Rotation equivariant cnns for digital pathology
  • Understanding the behaviour of contrastive loss
  • Learning robust global representations by penalizing local predictive power
  • Diffusion feedback helps CLIP see better
  • V?: Guided visual search as a core mechanism in multimodal llms
  • Post-pre-training for modality alignment in vision-language foundation models
  • From image descriptions to visual denotations: New similarity metrics for semantic inference over event descriptions
  • Lit: Zero-shot transfer with locked-image text tuning
  • Sigmoid loss for language image pre-training
  • ReSSL: Relational self-supervised learning with weak augmentation
  • >Method</td><td rowspan=
  • >Batch Size</td><td rowspan=
  • All experiments are conducted on the pre-trained OpenAI CLIP ViT-B/16 model, utilizing exclusively the CLIP loss ($\lambda_{\mathrm{clip}} = 1.0$, $\lambda_{\mathrm{mse}} = 0.0$, $\lambda_{\mathrm{rkd}} = 0.0$)
  • >Dataset</td><td rowspan=
  • Top: adding $\mathcal{L}_{\mathrm{rkd}}$ (DINov2-Large teacher) to $\mathcal{L}_{\mathrm{clip}} + \mathcal{L}_{\mathrm{mse}}$, linear probe (5-dataset average), mean $\pm$ standard deviation over 3 seeds, CC3M, 1 epoch; $p$: two-sided Welch $t$-test
  • The two variants perform comparably: differences on zero-shot classification, retrieval and linear probing are within $\sim 0.8$ points, and the MMVP difference is within seed-to-seed variance (Table 2), so we draw no conclusion from it
  • >Loss Weights</td><td rowspan=
  • Temperature $\tau$: Selected via the sweep in Table 5
  • Taking the CLIP loss as our primary objective ($\lambda_{\mathrm{clip}} = 1.0$), we systematically vary the scales of $\lambda_{\mathrm{mse}}$ and $\lambda_{\mathrm{rkd}}$ to observe their collective impact on model performance
  • The variation across ratios is small: within 0.4 points on zero-shot classification and within 0.6 points on retrieval
  • Table 12 indicates that extending the training duration did not yield a significant improvement in overall performance, so we use a single epoch throughout
  • A lower KL divergence indicates that the manifold of image-text feature in contrastive space has been better preserved
  • small $\tau$
  • On ViT-B/16, ComCLIP and CLIP-Refine (COCO Caption) are at parity in average zero-shot accuracy; over three seeds the difference $(63.00_{\pm 0.13}$ vs. $62.87_{\pm 0.11})$ is not significant (Table 2)
  • The best and second-best results in each model block are highlighted in bold and underline, respectively
  • On ViT-L/14, ComCLIP achieves higher retrieval than KUEA and CLIP-Refine (COCO Caption) in these single runs
  • The figures we report are the multi-seed means in Table 2: on ViT-B/16, ComCLIP (14.81±2.97) and CLIP-Refine (16.05±1.14) are indistinguishable; on ViT-L/14, ComCLIP (24.20±0.86) is above CLIP-Refine trained on the same data (19.01±1.86)
  • A matched retraining
  • $\dagger$ : per-category breakdown of one seed; on ViT-B/16 this seed is the maximum of three (3-seed mean $14.81_{\pm2.97}$ ), and on ViT-L/14 it is one of three seeds (3-seed mean $24.20_{\pm0.86}$ )
  • Evaluation protocols and base values differ across papers (e.g., retrieval R@1 base values), so the rows are not strictly comparable; each row should be read as the change relative to its own base
  • Because the text encoder is frozen, ComCLIP can be dropped into existing CLIP-based systems such as LLaVA without re-training them; more transferable visual features may benefit downstream applications such as accessibility tools and visual question answering
  • Code and post-trained checkpoints are released at
  • Remaining ablations are single runs because of compute cost; they are labelled as such, and we draw no conclusions from differences within seed variance (Section 4.5)