arXiv:2609.06967cs.CVSep 2026

Manuscript Offprint

arXiv:2609.06967

Re-calibrated Contrastive Loss for Transformation-Aware Prompt Conditioning in Vision-Language Models

Seungmin Oh, Seunghun Kang, Jongbin Ryu

Abstract

Ensuring effective transfer learning for vision-language models without compromising their generalization performance is crucial. However, many existing methods overlook data characteristics and simply reuse the training strategies adopted during pre-training. Specifically, they treat same-class samples as distinct instances and transform images independently of their paired text prompts, which makes model learning more difficult. We address these limitations through transformation-aware prompt conditioning and a re-calibrated contrastive loss. Fixed text descriptors identify the transformations applied to paired images, providing transformation-level consistency without altering class semantics. This design aligns the image and text branches at the transformation level, enabling richer representations while preserving the models' ability to generalize. In addition, our loss function mitigates positive-gradient dilution in soft-target cross-entropy when each anchor has multiple valid positives. During transfer, our approach treats same-class samples as positives rather than distinct instances, enabling the model to learn domain-specific features more effectively. Experiments across distribution shift, transfer learning, and few-shot settings demonstrate consistent improvements over existing approaches. Source code for our method is available at https://github.com/SoongE/ReCalCon.

Introduction

Interest in Vision-Language Models (VLMs) has increased due to their capacity for generalized vision-language representation. This capability enables efficient adaptation to target domains through fine-tuning [15, 16, 27, 42, 48, 49, 50]. However, it is important to point out that the current transfer learning approach presents two challenges: 1) overfitting to the target domain and 2) a discrepancy between augmented images and their text prompts. The first problem arises when fine-tuning the pre-trained model to a specific domain, as this may result in subpar performance in other domains due to distribution shifts, as shown in Figure 1.

© 2026. The copyright of this document resides with its authors. It may be distributed unchanged freely in print or electronic forms.

  • Corresponding author.

2 OH, KANG, RYU: RE-CALIBRATED CONTRASTIVE LOSS FOR PROMPT CONDITIONING

Full fine-tuning (FFT) of zero-shot models can create a trade-off between in-distribution (ID) and out-of-distribution (OOD) accuracy. For several transfer baselines, this trade-off becomes more pronounced as training continues. The second challenge arises because text prompts often do not describe image transformations. Most models directly adopt the contrastive learning approach used during pre-training, which is typically based on a single image-text positive pair. As a result, while images undergo various augmentations, text prompts either remain fixed, rely on generative models, or include meaningless random words. Consequently, visual data is typically trained using extensive augmentation techniques, whereas text prompts fail to reflect these augmentations accurately.

Figure

Figure 1: ID and OOD accuracy (%) of state-of-the-art models fine-tuned on the ImageNet dataset using CLIP ViT-B/16. Ours (red star) achieves the best ID-OOD performance.

We address this discrepancy by conditioning each text prompt on the transformation applied to its paired image. We call the method Transformation-Aware Prompt Conditioning. Transformation-level consistency pairs each augmented image with a fixed descriptor of the applied transformation without implying a change in class semantics. As shown in Figure 2, we expand the contrastive space to include augmented images and transformation-conditioned prompts. The expanded space contains four types of contrastive matches. While only the contrastive match between clean images and prompts (red in Figure 2) has been used in previous VLM transfer learning approaches, we exploit additional matches in the augmented space (blue in Figure 2). We also include cross-pairs between the clean and augmented data (yellow in Figure 2). These additional matches provide regularization during VLM transfer.

Expanding the contrastive space introduces multiple valid positives for each anchor, whereas the pre-training objective uses only one paired positive. A uniform soft target distributes the target probability mass equally across these positives. The learning signal assigned to each positive therefore decreases as the number of positives increases. We refer to this effect as positive-gradient dilution. To address this, we propose a Re-calibrated Contrastive Loss function that adds an adaptive positive-versus-negative evidence margin while leaving the normalized softmax distribution unchanged. Our loss function effectively accounts for multiple positive pairs within a single logit vector, enabling the learning of both symmetric and asymmetric contrastive matches. Together, the re-calibrated contrastive loss and transformation-aware prompt conditioning transfer VLMs to target domains, demonstrating strong performance on out-of-distribution data. We also show that our approach performs much better, as the networks are trained longer without overfitting the target training data. This is because our approach to VLM transfer learning effectively regularizes, leading to performance improvements on out-of-distribution data, even with longer training. We perform various experiments evaluating transfer learning using ImageNet [1] and iWildCam [2] datasets for in- and out-of-distribution data classification. We also provide experimental results for transfer learning and few-shot scenarios across diverse downstream datasets.

OH, KANG, RYU: RE-CALIBRATED CONTRASTIVE LOSS FOR PROMPT CONDITIONING 3

Figure

Figure 2: Overview of the proposed training scheme. Each clean image and prompt produces a transformed image and a transformation-conditioned prompt. The encoders extract four types of contrastive matches: clean features (FI,FT)(F_I, F_T) and augmented features (FI′,FT′)(F'_I, F'_T). These features construct an augmented contrastive space. We apply a re-calibrated contrastive loss to update the networks. In learnable text prompts, [ν1,ν2,…,νn][\nu_1, \nu_2, \ldots, \nu_n] and [a1,a2,…,ak][a_1, a_2, \ldots, a_k] denote learnable context vectors and fixed transformation descriptor embeddings, respectively.

References (47)