
Generative Models · v1.0.8
2026-11-24 16:44:03
A fixed category set limits generality: every new concept needs new labelled data.
Natural language supervision — learn perception from the text already paired with the image.
A closed label set bounds what a model can ever say.
The record
Li reaches 11.5% on ImageNet, against 88.4% for the state of the art.
The diagnosis: scale, not principle
WIT — 400M (image, text) pairs from public internet sources.
Word count comparable to WebText, the GPT-2 training set.

From a batch of \(N\) (image, text) pairs, predict which of the \(N \times N\) pairings occurred.
The negatives are the rest of the batch, so a larger batch is a harder task.
Encode, project by a learned linear map, L2-normalise:
\[ \mathbf{u}_i = \frac{W_I\, f_I(x_i)}{\lVert W_I\, f_I(x_i) \rVert}, \qquad \mathbf{v}_j = \frac{W_T\, f_T(t_j)}{\lVert W_T\, f_T(t_j) \rVert} \tag{1} \]
Logits: pairwise cosine similarity, scaled by a learned temperature:
\[ s_{ij} = \class{hg-key}{\mathbf{u}_i^{\top}\mathbf{v}_j} \cdot \class{hg-alt}{\exp(t)}, \qquad \exp(t) = 1/\tau \tag{2} \]
Row \(i\)’s label is column \(i\). Cross-entropy once across rows, once down columns:
\[ \begin{aligned} \mathcal{L}_{\text{image}} &= -\frac{1}{N}\sum_{i=1}^{N} \log \frac{\exp(s_{ii})}{\sum_{j} \exp(s_{ij})} \\[3pt] \mathcal{L}_{\text{text}} &= -\frac{1}{N}\sum_{j=1}^{N} \log \frac{\exp(s_{jj})}{\sum_{i} \exp(s_{ij})} \\[3pt] \mathcal{L} &= \tfrac{1}{2}\left(\mathcal{L}_{\text{image}} + \mathcal{L}_{\text{text}}\right) \end{aligned} \tag{3} \]
Averaging the two makes the loss symmetric in the modalities.

\(N\) outlined targets; \(N^2 - N\) negatives.

# extract feature representations of each modality
I_f = image_encoder(I) # [n, d_i]
T_f = text_encoder(T) # [n, d_t]
# joint multimodal embedding [n, d_e]
I_e = l2_normalize(np.dot(I_f, W_i), axis=1)
T_e = l2_normalize(np.dot(T_f, W_t), axis=1)
# scaled pairwise cosine similarities [n, n]
logits = np.dot(I_e, T_e.T) * np.exp(t)
# symmetric loss function
labels = np.arange(n)
loss_i = cross_entropy_loss(logits, labels, axis=0)
loss_t = cross_entropy_loss(logits, labels, axis=1)
loss = (loss_i + loss_t)/2Paper Figure 3. Labels are np.arange(n): image \(i\) belongs with text \(i\).
The set is large enough that over-fitting is not a concern, so Zhang et al. (2020) is simplified.
Modified ResNet — ResNet-D, antialiased rect-2 blur pooling, and attention pooling in place of global average pooling
One layer of transformer-style multi-head QKV attention, the query conditioned on the global average-pooled image
Vision Transformer — Dosovitskiy et al. (2020), plus a layer norm on the combined patch and position embeddings
A Transformer, modified after Radford et al. (2019).
[EOS] activations at the top layer are the text feature — layer normalised, then linearly projectedThe only cross-modal interaction: a single dot product in the joint space.
This is the property the next unit turns into a guidance signal.
Scaling
Training

\[ \begin{aligned} Pr(y = c \mid x) &= \frac{\exp\!\left(\class{hg-key}{\mathbf{u}^{\top}\mathbf{w}_c} / \tau\right)} {\sum_{c'=1}^{C} \exp\!\left(\mathbf{u}^{\top}\mathbf{w}_{c'} / \tau\right)} \\[3pt] \mathbf{w}_c &= \frac{W_T\, f_T\!\left(\text{prompt}(c)\right)} {\lVert W_T\, f_T\!\left(\text{prompt}(c)\right) \rVert} \end{aligned} \tag{4} \]
Multinomial logistic regression: normalised inputs and weights, no bias, temperature scaling.
Released class names are often unhelpful.
boxer is a breed, not an athlete"A photo of a {label}." — +1.3% alone. Task context adds more: a type of pet, a satellite photo of, quotes for OCR.
\(K\) prompts combined in embedding space, not probability space:
\[ \mathbf{w}_c \;\propto\; \frac{1}{K}\sum_{k=1}^{K} \frac{W_T\, f_T\!\left(\text{prompt}_k(c)\right)} {\lVert W_T\, f_T\!\left(\text{prompt}_k(c)\right) \rVert} \tag{5} \]
Engineering plus ensembling: almost 5%, comparable to 4x the compute, free once cached.


Effective robustness: the vertical distance above the trend. Relative robustness: any gain at all.

A logistic probe on CLIP features: ImageNet +9.2%, to 85.4%, about three years of progress. Accuracy under shift slightly decreases.
Effective robustness follows from minimising distribution-specific training data.
CLIP assumes a large enough dataset makes everything in-distribution; MNIST violates it.
\[ \nabla_{x}\,\class{hg-key}{\mathbf{u}(x)^{\top}\mathbf{v}(\text{prompt})} \tag{6} \]
Next: CLIP Guided Image Diffusion — classifier-guided diffusion, then GLIDE, comparing CLIP guidance against classifier-free.
A CLIP score is optimisable, and a generator optimising it can find samples that score well and look wrong.