TL;DR
Is CLIP’s legendary ability to handle "out-of-distribution" (OOD) data just a result of its massive training set (LAION) already containing images very similar to the test sets? This paper proves the answer is a resounding no. Even when researchers "surgically" prune LAION to be as dissimilar to test sets as ImageNet is, CLIP still generalizes far better than models trained on ImageNet alone.
The Problem: Generalization vs. Data Density
Vision-language models like CLIP show stellar performance on OOD benchmarks—tasks like identifying sketches (ImageNet-Sketch) or artistic renditions (ImageNet-R) of objects. Traditionally, researchers have attributed this to the sheer scale and diversity of the training data.
However, a nagging skepticism has grown: Is it really "generalization" if the training set is so large that it likely contains near-duplicates or highly similar examples to the test set? If a web-scale dataset like LAION-400M already contains millions of sketches, then ImageNet-Sketch isn't truly "out-of-distribution" for CLIP; it’s just more of the same.
The authors set out to determine if CLIP’s performance is merely a "data density" trick or if the model is genuinely learning more robust, generalizable representations.
Methodology: Testing the Similarity Hypothesis
The researchers developed a rigorous framework to test whether high train-test similarity is the secret behind CLIP's success:
- Quantifying Similarity: They used perceptual similarity (cosine similarity in CLIP’s embedding space) to find the "nearest neighbor" in the training set for every image in a test set.
- The Similarity Gap: By defining the "similarity gap" as the distribution of these nearest-neighbor scores, they confirmed that LAION is significantly "closer" to OOD benchmarks than the standard ImageNet-Train set is.
- Surgical Pruning: To level the playing field, they created "corrected" versions of LAION. They removed every image from LAION that was more similar to a test set than the best match found in ImageNet-Train. This forced the pruned LAION split to have the exact same "distance" from the test set as ImageNet.
- Retraining from Scratch: They retrained CLIP on these pruned datasets to see if its performance would collapse to ImageNet-like levels.
- Core Set Discovery: Conversely, they also tried pruning the least similar images to see if they could maintain performance with a much smaller, "high-quality" subset.
Key Insights and Results
Similarity Isn't the Whole Story
While LAION does contain many near-duplicates of OOD test sets, removing them doesn't kill CLIP's performance. Pruning "highly similar" images from LAION resulted in only a 10.8% relative drop on ImageNet-Sketch and a 4.8% drop on ImageNet-R.
Even after this aggressive pruning, CLIP maintained a massive 30-percentage-point lead over ImageNet-trained models on OOD tasks. For example, on ImageNet-Sketch, a model trained on the "sketch-pruned" dataset still achieved ~44.8% accuracy. For comparison, an ImageNet-trained model with similar baseline accuracy would be expected to hit only ~14%.
The Power of Scale and Diversity
The results suggest that the scale and diversity of the data allow CLIP to learn fundamental, compositional features that generalize, rather than just memorizing specific styles or viewpoints.
The 100M Core Set
In an interesting twist, the authors discovered they could prune 75% of LAION (keeping only the 100M images most similar to the benchmarks) and match the performance of the full 400M model. This 100M "core set" outperformed other popular pruning methods like SemDeDup, maintaining nearly full performance while being a quarter of the size of the original dataset. This suggests that a huge portion of web-scale data might be "noise" relative to specific downstream tasks.
Furthermore, domain-specific pruning proved highly targeted. Pruning images similar to ImageNet-Sketch actually improved performance on totally unrelated tasks like MNIST, confirming that "near-pruning" specifically targets the domain of the test set rather than just deleting high-quality data globally.
Limitations and Future Work
- Defining "OOD": The authors acknowledge that defining what is "in" or "out" of distribution is increasingly difficult when training sets encompass the entire public internet.
- Compositionality: A remaining question is whether CLIP generalizes through compositionality (e.g., learning "sketch" from one context and "dog" from another to understand a "dog sketch"). The authors suggest this is a promising area for future study.
- Metric Bias: The study uses CLIP's own embeddings to measure similarity for pruning. While they ablated this using different model sizes, there is always a risk of model-specific bias in the similarity metric itself.
Summary updated