Manuscript Offprint

arXiv:2609.07540

TeMo: Temperature Modulation for Multimodal Contrastive Learning

Dhimitrios Duka, Bernt Schiele, Hilde Kuehne, Anna Kukleva

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

Abstract

Contrastive learning approaches achieve strong performance by training models to bring similar samples closer while pushing dissimilar samples apart. A crucial component of contrastive learning is the temperature hyperparameter τ\tau, which controls the penalty strength applied to negative samples. However, most existing methods either fix this hyperparameter or learn a global value during training. In this paper, we introduce TeMo, Temperature Modulation framework, a similarity-based modulation approach that adaptively adjusts the temperature for each positive-negative pair according to their similarity, enabling more fine-grained multimodal contrastive learning. Our approach seamlessly integrates temperature-modulated multimodal and unimodal losses with the standard multimodal contrastive loss by gradually transitioning between them. This design allows the model to capture both coarse- and fine-grained semantics at different training stages. Extensive experiments demonstrate that each component of TeMo consistently enhances performance across diverse zero-shot retrieval and classification tasks, establishing new state-of-the-art results.

1. Introduction

Contrastive Learning (CL) has become one of the most relevant self-supervised representation learning paradigms, allowing the training of high performing models on large amounts of unlabeled data. It facilitates the learning of robust unimodal [2, 14] and multimodal [5, 31, 44, 50] representations by encouraging matching pairs to be close in the embedding space, while pushing nonmatching pairs farther apart. One of the most important parameters that affect the structure of the learned representations is the temperature τ\tau. In unimodal learning, τ\tau plays a key role in controlling the spread of concepts [21, 42]: a higher temperature tolerates semantically similar samples and forms coarser, group-wise clusters, whereas a lower temperature sharpens the objective into a more uniform, instance-level representation space that preserves fine-grained per-sample detail. In multimodal learning, however, τ\tau mainly controls the so-

called modality gap [24, 42] that separates the vision and language modalities. Varying the temperature directly affects the gap: a high temperature closes it and can even eliminate it, whereas a lower temperature drives the modalities farther apart [24]. Whereas in this work, we integrate both multimodal and unimodal losses within a unified temperature modulation framework, enabling fine-grained control over the learning dynamics of both multimodal and unimodal representations. We show that this joint modulation not only enhances alignment between modalities by reducing the modality gap, but also improves the structure of unimodal embeddings.

Most of the existing methods [3, 14, 26, 31, 40] use a global learnable temperature parameter shared across all pairs. Consequently, the model seeks an overall balance among different semantic classes by applying similar repulsive forces to diverse negative samples. However, in certain scenarios, such as long-tail datasets, it is more desirable to allow fine-grained control over local structures and under-represented classes in the embedding space [21]. Building on this, variable temperature schemes have been proposed to improve representation learning based on temperature alternations [18, 19, 21, 23, 30, 42, 43, 53].

To this end, we propose Temperature Modulation (TeMo), a novel multimodal contrastive learning framework that leverages combined multimodal and unimodal temperature modulation to enhance multimodal representation learning. Unlike prior methods that use a globally assigned temperature [21, 30, 42], TeMo adaptively modulates the temperature for each positive-negative pair individually. The per-pair temperature strategy enables more precise control over the contrastive objective, allowing the model to dynamically adjust its learning signals based on the similarity of individual paired samples. Additionally, temperature-modulated unimodal losses improve local structure within each modality. We integrate the modulated multimodal and unimodal contrastive losses into a standard CL framework through progressive scheduling. This scheduling enables the model to initially capture instance-level semantic details using a lower temperature, while our adaptive temperature modulation gradually guides sample representations toward coarser semantic groupings.

We evaluate TeMo on two standard tasks: multimodal zero-shot retrieval on MSCOCO and Flickr30k, and zero-shot classification across a diverse set of datasets, including CIFAR10, CIFAR100, and ImageNet-1k, with models pretrained on CC3M or CC12M. Across tasks and datasets, TeMo consistently outperforms existing temperature-adaptation baselines. We summarize our contributions as follows:

  • We propose TeMo, a novel temperature modulation framework for multimodal contrastive learning, which introduces a per pair temperature modulation based on the similarity of each pair for both unimodal and multimodal losses, enabling more precise control over the learned representation space;

  • We show that combining multimodal and unimodal contrastive losses is particularly effective when used with our temperature modulation approach;

  • We provide an in-depth evaluation of the characteristics of the proposed system and show that TeMo outperforms prior temperature adaptation approaches on zero-shot retrieval and classification benchmarks.

References (49)

  • Conceptual 12M: Pushing web-scale image-text pre-training to recognize long-tail visual concepts
  • A simple framework for contrastive learning of visual representations
  • Improved baselines with momentum contrastive learning (opens arXiv in a new tab)
  • CLIP benchmark, 2025
  • Reproducible scaling laws for contrastive language-image learning
  • Democratizing contrastive language-image pretraining: A CLIP benchmark of data, model, and supervision (opens arXiv in a new tab)
  • ImageNet: A large-scale hierarchical image database
  • An image is worth 16x16 words: Transformers for image recognition at scale
  • Improving CLIP training with language rewrites
  • SoftCLIP: Softer cross-modal alignment makes CLIP stronger
  • CyCLIP: Cyclic contrastive language-image pretraining
  • RWKV-CLIP: A robust vision-language representation learner
  • Deep residual learning for image recognition
  • Momentum contrast for unsupervised visual representation learning
  • Model-aware contrastive learning: Towards escaping the dilemmas
  • Hard negative mixing for contrastive learning
  • Deep visual-semantic alignments for generating image descriptions
  • Dynamic temperature scaling in contrastive self-supervised learning for sensor-based human activity recognition
  • Temperature-free loss function for contrastive learning
  • Temperature schedules for self-supervised contrastive methods on long-tail data
  • Supervision exists everywhere: A data efficient contrastive language-image pre-training paradigm
  • Curriculum temperature for knowledge distillation
  • Mind the gap: Understanding the modality gap in multi-modal contrastive representation learning
  • Dynamically scaled temperature in self-supervised contrastive learning
  • SLIP: Self-supervision meets language-image pretraining
  • SILC: Improving vision language pretraining with self-distillation
  • Representation Learning with Contrastive Predictive Coding
  • DINOv2: Learning robust visual features without supervision
  • To cool or not to cool? Temperature network meets large foundation models via DRO. In ICML, pages 41604–41643, 2024
  • Sentence-BERT: Sentence embeddings using siamese BERT-networks
  • Contrastive learning with hard negative samples
  • DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lighter
  • An open large-scale dataset for training next generation image-text models
  • Conceptual captions: A cleaned, hypernymed, image alt-text dataset for automatic image captioning
  • MM-TS: Multi-modal temperature and margin schedules for contrastive learning with long-tail data
  • CWCL: Cross-modal transfer with continuously weighted contrastive loss
  • EVA-CLIP: Improved training techniques for CLIP at scale (opens arXiv in a new tab)
  • TULIP: Contrastive image-text learning with richer vision understanding
  • Understanding the behaviour of contrastive loss
  • Contextual temperature for language modeling (opens arXiv in a new tab)
  • Demystifying CLIP data
  • FILIP: Fine-grained interactive language-image pre-training
  • Explaining and mitigating the modality gap in contrastive multimodal learning
  • Decoupled contrastive learning
  • From image descriptions to visual denotations: New similarity metrics for semantic inference over event descriptions
  • Provable stochastic optimization for global contrastive learning: Small batch does not harm performance
  • Sigmoid loss for language image pre-training
  • Dual temperature helps contrastive learning without many negative samples: Towards understanding and simplifying MoCo
  • PEGASUS: Pre-training with extracted gap-sentences for abstractive summarization