Skip to main content
QUICK REVIEW

[Paper Review] CWCL: Cross-Modal Transfer with Continuously Weighted Contrastive Loss

Rakshith Sharma Srinivasa, Jaejin Cho|arXiv (Cornell University)|Sep 26, 2023
Multimodal Machine Learning ApplicationsComputer Science5 citations
TL;DR

This paper proposes Continuously Weighted Contrastive Loss (CWCL), a novel contrastive learning objective that models similarity between cross-modal data as a continuous, rather than binary, measure. By leveraging all similar examples in a batch—not just positive/negative pairs—CWCL improves zero-shot transfer performance, achieving 6–8% absolute gains in image classification and 20–30% in speech-to-intent and keyword classification tasks over prior state-of-the-art methods.

ABSTRACT

This paper considers contrastive training for cross-modal 0-shot transfer wherein a pre-trained model in one modality is used for representation learning in another domain using pairwise data. The learnt models in the latter domain can then be used for a diverse set of tasks in a zero-shot way, similar to ``Contrastive Language-Image Pre-training (CLIP)'' and ``Locked-image Tuning (LiT)'' that have recently gained considerable attention. Most existing works for cross-modal representation alignment (including CLIP and LiT) use the standard contrastive training objective, which employs sets of positive and negative examples to align similar and repel dissimilar training data samples. However, similarity amongst training examples has a more continuous nature, thus calling for a more `non-binary' treatment. To address this, we propose a novel loss function called Continuously Weighted Contrastive Loss (CWCL) that employs a continuous measure of similarity. With CWCL, we seek to align the embedding space of one modality with another. Owing to the continuous nature of similarity in the proposed loss function, these models outperform existing methods for 0-shot transfer across multiple models, datasets and modalities. Particularly, we consider the modality pairs of image-text and speech-text and our models achieve 5-8% (absolute) improvement over previous state-of-the-art methods in 0-shot image classification and 20-30% (absolute) improvement in 0-shot speech-to-intent classification and keyword classification.

Motivation & Objective

  • To address the inefficiency of standard contrastive learning in extracting full supervision from pre-trained models during cross-modal alignment.
  • To improve zero-shot transfer performance in low-resource modalities like speech and medical imaging by leveraging pre-trained text models.
  • To develop a loss function that captures the continuous nature of similarity across cross-modal pairs, rather than treating it as binary (positive/negative).
  • To demonstrate the effectiveness of the proposed method across diverse modality pairs, including image-text and speech-text.
  • To enable data- and compute-efficient training by maximizing supervision from existing paired data.

Proposed method

  • Introduce a continuously weighted contrastive loss (CWCL) that assigns dynamic weights to negative samples based on their similarity to the anchor sample.
  • Use a similarity function to compute continuous similarity scores between the anchor and all other samples in a batch, replacing the binary positive/negative distinction.
  • Apply temperature scaling and learnable parameters to calibrate the weighting function, allowing the model to adaptively focus on the most informative similar samples.
  • Train the text encoder end-to-end while freezing the pre-trained image or speech encoder to preserve knowledge from the source modality.
  • Use template-based class embedding generation for zero-shot intent and keyword classification, improving alignment with pre-trained text representations.
  • Optimize the loss using stochastic gradient descent, with batch-level contrastive objectives that consider all samples in the batch.

Experimental results

Research questions

  • RQ1Can a continuous similarity measure improve zero-shot cross-modal transfer beyond standard contrastive learning?
  • RQ2How does CWCL perform compared to standard contrastive loss in image-text and speech-text alignment tasks?
  • RQ3To what extent can CWCL reduce data and compute requirements while maintaining or improving performance?
  • RQ4Does CWCL generalize across different modality pairs, including those with limited labeled data?
  • RQ5Can CWCL achieve performance comparable to fully supervised models in low-resource speech tasks?

Key findings

  • CWCL achieved a 6–8% absolute improvement in zero-shot image classification accuracy over the best baseline, with RoBERTa+S model reaching 63.80% on SLURP.
  • On the STOP dataset, CWCL improved zero-shot speech-to-intent classification by 20–30% absolute, reaching 87.87% accuracy with RoBERTa+S.
  • For keyword spotting on GSCV2, CWCL achieved 81.02% accuracy without templates and 82.77% with template-based class embeddings, outperforming the baseline.
  • The BART-based model with CWCL reached 89.43% accuracy on GSCV2 with templates, approaching supervised baselines that use task-specific training data.
  • CWCL models trained with fewer data samples achieved higher performance than standard contrastive learning, demonstrating data efficiency.
  • The method achieved near-supervised performance (e.g., 98.2% on GSCV2 with templates) without any task-specific fine-tuning, highlighting its zero-shot generalization capability.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.