Learning Transferable Visual Models From Natural Language Supervision
Learn vision from 400 million captions and classify anything zero-shot
Learning Transferable Visual Models From Natural Language Supervision
Vision models only knew their fixed label set
Train on 1,000 ImageNet classes, then collect labeled data for every new task. The model cannot name concepts it was never labeled with.
Learn which caption goes with which image across 400M web pairs. Any new class becomes a text prompt, so recognition needs no new labels.
Natural language becomes the label space.
Contrastive pretraining, then classify with text prompts

Matching image-text pairs sit on the diagonal of a similarity matrix. At test time, class names become prompts like 'a photo of a dog', and the closest prompt wins.
Training on batches of 32,768 pairs
- 1
Encode both sides
An image encoder, ResNet or ViT, and a text Transformer map inputs into one shared embedding space.
- 2
Score every pairing
Compute cosine similarity between all images and all captions in the batch.
- 3
Contrast
A symmetric cross-entropy pushes each true pair up and every other pairing in the batch down.
One cross-entropy over rows, one over columns
Each image should pick its own caption out of the batch, and each caption its own image. The diagonal of the logit matrix holds the right answers.
- Ie
- L2-normalized image embeddings
- Te
- L2-normalized text embeddings
- t
- Learned temperature scaling the logits
- CE
- Cross-entropy with the diagonal as targets
Lower ImageNet score, sturdier under shift
Top-1 accuracy (%). Zero-shot CLIP never sees ImageNet training labels.
Zero-shot has blind spots
Weak on abstract tasks
Struggles with counting objects and fine-grained classes like car models or flower species.
Truly unseen data
On MNIST handwritten digits, zero-shot CLIP reaches only 88%, below logistic regression on raw pixels.
Inherits web biases
Trained on unfiltered internet pairs, it absorbs social biases; the paper documents harmful misclassifications.
Why it matters
- Contrastive image-text pretraining turns any class name into a classifier with no labeled examples.
- Zero-shot models hold up far better under distribution shift than ImageNet-tuned ones.
- CLIP encoders sit inside Stable Diffusion, DALL·E 2 and many vision-language models.
23 upvotes on Hugging Face 8 slides, 2 min
26 Feb 2021