FDEInterviews logo
ICML 2021

Learning Transferable Visual Models From Natural Language Supervision

Train an image encoder and a text encoder so each photo lands next to its own caption. The result classifies images from a list of class names, with no labeled training data.

Breakdown by FDE Interviews · 19 min read · Updated

About the original · 2021
AUTHORS
Radford, Kim, Hallacy, Ramesh, Goh, Agarwal, Sastry, Askell, et al.
FROM
OpenAI
PUBLISHED
Feb 2021 · ICML 2021
CITED BY
57,887Semantic Scholar · Oct 2026
IN THIS BREAKDOWN · 10 SECTIONS

You can read 14% of this breakdown.

01

The paper in one minute

Before CLIP, a vision model learned a fixed list of labels. A model trained on ImageNet knew 1,000 categories, and adding a 1,001st meant collecting labeled photos and training again. CLIP (Contrastive Language-Image Pre-training), from Alec Radford, Jong Wook Kim and colleagues at OpenAI, replaced the label list with language. The authors gathered 400 million image and text pairs from the public internet, searched with 500,000 queries built from words common in Wikipedia, and trained two encoders, one for images and one for text, so that matching pairs land close together in a shared embedding space.

The training task is a matching game. Take a batch of N images and their N captions. Compute every image-caption similarity, an N × N grid, and train both encoders so each image scores highest with its own caption, and each caption with its own image. The real pairs sit on the diagonal; every other cell is a negative. The batch size was 32,768, so every image competed against 32,767 wrong captions per step.

Classification then needs no training at all. Write each class name into a sentence such as "A photo of a dog.", embed the sentences with the text encoder, and assign each image to the nearest one. That is what "zero-shot" means here: the classifier is built from words, and the target dataset's training labels are never used. On ImageNet the best model reached 76.2% top-1, the accuracy of the original fully supervised ResNet-50, where the previous zero-shot method managed 11.5%.

THE IDEA, VISUALLY
TRAIN: EACH IMAGE PICKS ITS OWN CAPTION image enc. text enc. 400M web pairs texts → I1 I2 I3 I4 N × N similarities diagonal: real pairs everything else: N² − N negatives cross-entropy both ways batch N = 32,768; only linear projections into the shared space TEST: A CLASSIFIER WRITTEN IN WORDS “a photo of a dog.” “a photo of a cat.” “a photo of a crane.” text enc. nearest class wins Prompt template: +1.3 points on ImageNet; 80-prompt ensemble: +3.5 more. No ImageNet training labels used: 76.2% top-1. SAME IMAGENET SCORE, VERY DIFFERENT UNDER SHIFT top-1 %, Figure 13; both models score 76.2 on ImageNet ImageNetV2 64.3 70.1 ImageNet-R 37.7 88.9 ObjectNet 32.6 72.3 ImageNet Sketch 25.2 60.2 ImageNet-A 2.7 77.1 ResNet-101, trained on ImageNet zero-shot CLIP, best model (no ImageNet labels)
CLIP learns one space for images and text by matching each image to its own caption within a batch. A classifier then becomes a list of written class names, and that classifier held up far better under distribution shift than an ImageNet model with the same ImageNet score.
Research notes: the problem, approach and results
76.2%

zero-shot ImageNet top-1, with no ImageNet training labels; prior zero-shot best was 11.5%

77.1%

on ImageNet-A, where a ResNet-101 with the same ImageNet score gets 2.7%

4×

faster zero-shot learning from the contrastive objective than predicting a bag of words, itself 3× faster than captioning

THE PROBLEM

Vision models were trained on fixed label sets such as ImageNet's 1,000 classes. Every new category needed new labeled data, and accuracy fell sharply when the images looked different from the training set.

THE IDEA

Collect 400 million image and caption pairs from the web and train an image encoder and a text encoder contrastively: within each batch, every image must pick out its own caption. Classes are then described in words instead of labeled examples.

THE RESULT

Zero-shot CLIP matched the original ResNet-50 on ImageNet (76.2%) without any of its 1.28 million training labels, beat a supervised linear probe on ResNet-50 features on 16 of 27 datasets, and cut the accuracy drop under natural distribution shift by up to 75%.

02

Why it matters to an FDE

CLIP and its descendants sit inside most production image search, multimodal retrieval and visual tagging systems built since 2021. When a customer asks for "find every photo of a damaged pallet" or "tag our product catalog", a contrastive image-text model is usually the first thing to try, because it needs a list of words instead of a labeled dataset.

You can prototype a classifier in an afternoon. Write the customer's categories as short descriptions, embed them, and score a sample of their images. That gives a baseline before anyone labels anything, and it tells you which categories are easy and which need data.

The wording of the classes is part of the model. Changing "crane" to "a photo of a crane, a type of bird" changes the result. The paper got almost 5 points on ImageNet from prompt templates and ensembling alone. Treat class descriptions as configuration that is tested and versioned.

Zero-shot is a starting point, and a demo can flatter it. CLIP was near chance on some tasks, such as distances in driving photos, and weak on fine-grained ones like aircraft variants. Score it on the customer's own images before promising anything.

The same embeddings power search. Text-to-image and image-to-image retrieval use the shared space directly, so one model serves both classification and search, stored in an ordinary vector database.

It carries the web's biases. The authors found harmful associations in face classification probes, and showed that adding one class to the label list changed who was misclassified. A deployment that classifies people needs its own audit.

THE FULL BREAKDOWN

Understand the mechanism. Try it on a real problem.

Unlock this breakdown and 49 more papers.

Premium opens every paper in full, plus every answer, concept, course and guide on the site. One payment for six months of access.

6 months · One payment · No auto-renewal

Get Premium · ₹2,000 / $25
  • ◇1 architecture diagram
  • </>1 runnable code experiment
  • ▦3 results tables
  • ?5 interview questions with answers
  1. 03Key takeaways

    How CLIP was built, why contrastive training won, what zero-shot really bought, and the misreadings

    Free account
  2. 04How it works

    The contrastive objective, the encoders, prompt ensembling and how the classifier is built

    Premium
  3. 05The numbers that matter

    Zero-shot accuracy, data efficiency, robustness, the human comparison and the bias probes

    Premium
  4. 06Try it yourself

    Train two tiny encoders contrastively, build a classifier from words, watch shared names break it

    Premium
  5. 07Where it breaks

    The limits the paper reports, and what its evaluation cannot tell you

    Premium
  6. 08Using it on a deployment

    Scoping, prompting, evaluating and shipping a CLIP-style classifier or search system

    Premium
  7. 09Interview angles

    Five questions this paper prepares you for, with answer hints

    Premium
Back to the paper library →