Data Determines Distributional Robustness in Contrastive Language Image Pre-training (CLIP)

Alex Fang, Gabriel Ilharco, Mitchell Wortsman, Yuhao Wan, Vaishaal Shankar, Achal Dave, Ludwig Schmidt

Introduction

This research provides a rigorous post-mortem of one of the most influential AI models of recent years: OpenAI’s CLIP. Upon its release, CLIP demonstrated a seemingly "superhuman" ability to handle distribution shifts—recognizing a sketch of a banana as easily as a high-quality photograph. However, the community lacked a clear understanding of why CLIP was so resilient. This paper systematically deconstructs the model to isolate the "secret sauce" of its robustness, ultimately revealing that the power lies in the training data itself, rather than the model's architecture or language-based supervision.

The Mystery of CLIP's Robustness

Computer vision models are notoriously brittle. A model trained on high-quality photos of objects often fails dramatically when tested on sketches, blurred images, or objects in unusual settings (known as distribution shifts).

CLIP broke this trend by exhibiting "effective robustness." This means it performed significantly better on out-of-distribution (OOD) datasets than its baseline ImageNet accuracy would predict. However, CLIP introduced several new variables simultaneously:

  1. A massive, uncurated dataset (400 million images).
  2. Natural language supervision (using captions instead of strict class labels).
  3. A contrastive loss function.
  4. Zero-shot prompting at test time.

The authors set out to untangle these variables and determine which factor actually drives the model's ability to generalize.

Experimental Design: Isolating the Variables

To isolate the effect of language supervision from the effect of the data distribution, the authors employed a controlled experiment approach. They needed datasets that provided both traditional class labels and original natural language captions for the exact same images.

To achieve this, they utilized two primary datasets:

  • ImageNet-Captions (New): The authors recovered the original Flickr titles, tags, and descriptions for approximately 463,000 images from the original ImageNet 2012 training set. This allowed them to compare standard "Label Training" against CLIP-style "Caption Training" without changing the underlying image pixels.
  • YFCC-15M: A subset of the Yahoo Flickr Creative Commons dataset, used to test the impact of a more diverse, "unfiltered" data distribution.
Dataset creation methodology

To test if language is necessary at all, they also created a baseline called NoCLIP. They pre-trained a model using SimCLR (a self-supervised method that only looks at images, ignoring text entirely) on the YFCC-15M dataset, followed by a simple text-matching strategy for classification.

Key Findings: Data Distribution is King

The study's evaluations across five major distribution shifts (ImageNet-V2, ImageNet-R, ImageNet-Sketch, ObjectNet, and ImageNet-A) yielded surprising insights that challenge prevailing assumptions about multimodal learning.

1. The "ImageNet-Captions" Reveal When the authors trained a CLIP-style model on their new ImageNet-Captions dataset, it showed zero effective robustness gains. It remained just as brittle as a standard supervised model. Because 94% of these images contained the class label somewhere in the recovered metadata, the captions provided high-quality signal. Yet, the contrastive loss and the use of text failed to produce the "magic" robustness seen in OpenAI's CLIP.

2. Language is Merely a Scaling Tool The study found that language supervision doesn't inherently make a model robust. Instead, language is a practical tool that allows researchers to leverage massive, uncurated web datasets. It is simply much easier to scrape images with existing alt-text than to pay humans to manually label 400 million images into strict categories.

3. Robustness Stems from Diverse Data Robustness only appeared when the training set shifted from the highly curated ImageNet distribution to the more diverse YFCC distribution.

Effective robustness plot showing data distribution drives robustness

As seen in the effective robustness evaluations, the "NoCLIP" model (image-only pre-training on YFCC) achieved effective robustness nearly identical to the full CLIP model. On YFCC-15M, a CLIP model achieved 37.9% ImageNet accuracy, while the NoCLIP baseline achieved 35.7%. Crucially, both models sat on the exact same high-robustness trajectory, far above standard ImageNet-trained models. This proves that the "multimodal" nature of CLIP is not the primary driver of its generalization.

Conclusion and Future Directions

While clever "prompt engineering" can improve a model's raw accuracy, it does not change its underlying robustness profile. The evidence points to a single, powerful conclusion: data determines distributional robustness.

Because the authors could not fully replicate OpenAI's proprietary 400M image dataset (WIT), the exact "recipe" for the ultimate robust distribution remains a trade secret. Furthermore, while "diverse distributions" clearly cause robustness, mathematically defining what makes a distribution diverse enough to trigger these gains remains an open challenge.

Ultimately, this research suggests a paradigm shift for the machine learning community: to achieve the next breakthrough in robust AI, researchers should focus less on designing novel loss functions and more on the science of dataset design and curation.

Summary updated

BibTeX
@inproceedings{fang2022data,
  author = {Alex Fang and Gabriel Ilharco and Mitchell Wortsman and Yuhao Wan and Vaishaal Shankar and Achal Dave and Ludwig Schmidt},
  title = {{Data Determines Distributional Robustness in Contrastive Language Image Pre-training (CLIP)}},
  booktitle = {International Conference on Machine Learning},
  year = {2022},
  url = {https://openreview.net/forum?id=7Gomql8x8ln},
}
Figure