CLIPLoss and Norm-Based Data Selection Methods for Multimodal Contrastive Learning

Yiping Wang, Yifang Chen, Wendan Yan, Alex Fang, Wenjing Zhou, Kevin G. Jamieson, Simon S. Du

The Data Selection Bottleneck

Training powerful vision-language models like CLIP requires massive amounts of data, usually scraped from the web. Unfortunately, web data is incredibly noisy—images and captions often do not match, or the captions are generic and uninformative. Selecting the "right" subset of data from billions of pairs is a critical bottleneck for model performance.

Current solutions typically fall into two computationally expensive camps: using heavy external models (like OCR or captioning models) to filter data, or training specialized "teacher" models on high-quality datasets to act as better judges. This paper explores a third, highly efficient path: designing better metrics that work with any existing CLIP embedding. By fixing systematic biases in standard metrics and tailoring selection to specific downstream tasks, the authors achieve state-of-the-art results without the overhead of external models.

Proposed Methods: negCLIPLoss and NormSim

The authors propose two main innovations to improve data selection:

1. negCLIPLoss

The standard metric for data filtering, CLIPScore, evaluates how well a single image matches its specific caption. However, generic text or simple images (like a "Photo Coming Soon" placeholder) can "cheat" this metric, leading to artificially high scores.

To address this, the authors introduce negCLIPLoss. Inspired by the actual CLIP training loss, this metric subtracts a "normalization term" that accounts for how well a sample matches other random samples in a batch. It acts as a curve-grader, penalizing samples that are too easy to match with random noise.

Examples showing how standard CLIPScore overestimates the quality of generic or uninformative images, a bias corrected by negCLIPLoss.

2. NormSim

When the downstream tasks a model will perform are known (e.g., classifying ImageNet), that knowledge can be leveraged during pretraining. NormSim measures the similarity between pretraining data and a small "target" dataset. Interestingly, the authors found that using vision-only embeddings for this similarity check is often more effective than using both image and text, likely because web-crawled text is frequently too brief or noisy to accurately represent the target distribution. By using a $p$-norm of inner products, NormSim selects training samples most relevant to the target tasks.

Key Insights and Results

The primary testbed for these methods is the DataComp benchmark (medium scale, containing 128 million image-text pairs). The models were evaluated across 38 downstream tasks, including ImageNet-1k, VTAB datasets, and retrieval tasks like Flickr30k and MSCOCO.

  • Significant Baseline Boost: Using only standard OpenAI CLIP-L/14 embeddings, the proposed methods improved ImageNet-1k accuracy by 5.3% and average performance across all 38 tasks by 2.8% compared to the best baseline.
  • Consistent Superiority: As shown below, negCLIPLoss consistently outperforms standard CLIPScore across various data downsampling ratios.
Performance comparison on ImageNet-1k showing negCLIPLoss consistently outperforming standard CLIPScore across different downsampling ratios.
  • Orthogonality and New State-of-the-Art: These new metrics do not replace existing high-end methods like Data Filtering Networks (DFN); they complement them. By combining negCLIPLoss and NormSim with current top-tier methods (DFN and HYPE), the authors boosted average downstream performance by an additional 0.9%, setting a new state-of-the-art on the DataComp-medium benchmark.
  • High Efficiency: Unlike methods requiring heavy models like LLaVA to evaluate every image, negCLIPLoss and NormSim are calculated directly from pre-computed embeddings, making them orders of magnitude faster.

Limitations and Future Work

While highly effective on the "medium" scale of DataComp, the performance of these metrics on "large" or "xlarge" scales (billions of samples) remains to be fully explored. Additionally, finding the absolute optimal strategy for merging different data selection techniques is an open challenge. Future work may also involve integrating these metrics dynamically into the training process (data scheduling) rather than relying on them solely for a one-time pre-filtering step.

Summary updated

BibTeX
@inproceedings{wang2024cliploss,
  author = {Yiping Wang and Yifang Chen and Wendan Yan and Alex Fang and Wenjing Zhou and Kevin G. Jamieson and Simon S. Du},
  title = {{CLIPLoss and Norm-Based Data Selection Methods for Multimodal Contrastive Learning}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=TJ49WYbbkT},
}
Figure