CLIP, SigLIP & BLIP

These three lines of work produced the components almost every model in the comparison table is built from. CLIP established that language is a usable supervision signal for vision; SigLIP fixed the objective's engineering; BLIP attacked the data problem and then the connector problem. This page derives each objective, states precisely what it does and does not learn, and is explicit about the failure that all of them inherit.

Symbols used on this page are defined in the Nomenclature → learning.

Why these are worth deriving rather than just citing. The objective determines the failure mode. CLIP's loss has no term that depends on word order, so CLIP-family models are near-blind to it — and that blindness propagates into every VLM that uses a CLIP tower and every generator that uses CLIP text conditioning. If you want to understand why current models fail at spatial relations, the explanation is in the loss function on this page, not in the architecture.

1 · CLIP

1.1 The idea

Supervised vision needs labels, and labels bound you to a fixed vocabulary. CLIP's move was to train on 400 million image–text pairs scraped from the web with no manual labelling, using a task that needs no labels: given a batch of images and a batch of captions, match them up.

Two encoders map into a shared $d$-dimensional space, and both outputs are $L^2$-normalised so that the inner product is a cosine:

$$ \mathbf u_i = \frac{f_{\text{img}}(\mathbf x_i)}{\|f_{\text{img}}(\mathbf x_i)\|}, \qquad \mathbf v_j = \frac{f_{\text{txt}}(\mathbf t_j)}{\|f_{\text{txt}}(\mathbf t_j)\|}, \qquad s_{ij} = \mathbf u_i^{\mathsf T}\mathbf v_j \in [-1, 1] $$
CLIP architecture: an image encoder and a text encoder project into a shared embedding space; the batch similarity matrix is trained to be high on the diagonal and low elsewhere.
The dual-encoder arrangement, redrawn. The matrix on the right is the object the loss acts on — and the two callouts are the consequences derived in §1.5 and §1.6: the batch is the negative set, and nothing in the loss depends on word order. Architecture after Radford et al., CLIP (ICML 2021).

1.2 The InfoNCE objective, derived

In a batch of $B$ pairs, treat matching as $B$-way classification — twice, once in each direction. For the image-to-text direction, the probability that image $i$ matches caption $j$ is a softmax over the row of the similarity matrix, scaled by a temperature $\tau$:

$$ p(j \mid i) = \frac{\exp(s_{ij}/\tau)}{\sum_{k=1}^{B}\exp(s_{ik}/\tau)} $$

The loss is the symmetric cross-entropy against the identity assignment:

$$ \mathcal L_{\text{CLIP}} = -\frac{1}{2B}\sum_{i=1}^{B}\Big[ \log p(i \mid i)_{\text{img}\to\text{txt}} + \log p(i \mid i)_{\text{txt}\to\text{img}}\Big] $$

In code this is strikingly short, which is part of why it spread so fast:

logits = (img_emb @ txt_emb.T) * logit_scale.exp()   # (B, B)
labels = torch.arange(B, device=logits.device)
loss   = 0.5 * (F.cross_entropy(logits, labels)
              + F.cross_entropy(logits.T, labels))

1.3 The learned temperature, and why it is stored as a log

$\tau$ controls how sharply the model is required to discriminate. It is learned, not fixed, and it is parameterised as $\log(1/\tau)$ — a "logit scale" — for two reasons: the parameterisation keeps $\tau > 0$ automatically, and it makes the optimisation well-conditioned, since the useful range spans orders of magnitude.

RegimeEffect on the lossConsequence
$\tau$ large (soft)Logits flattened; all pairs look similar Weak gradient; the model under-discriminates
$\tau$ small (sharp)Loss dominated by the single hardest negative Sensitive to label noise — and web data is very noisy
Learned, then clippedConverges to roughly 0.01 CLIP clamps the logit scale at 100 because unconstrained training drove it there and destabilised
That clamp is a diagnostic worth noticing. The optimiser pushes the temperature toward maximum sharpness because sharper logits reduce the training loss — but on noisy web pairs, maximum sharpness means fitting mislabelled pairs. The clamp is an admission that the objective's optimum is not the thing we wanted. Approaches that re-weight or filter noisy pairs instead of clamping are under-explored.

1.4 Zero-shot classification as retrieval

CLIP has no classifier head. Classification is performed by writing the classes as sentences and retrieving the nearest one:

$$ \hat y = \arg\max_{c \in \mathcal C}\; \mathbf u^{\mathsf T}\, \mathbf v_c, \qquad \mathbf v_c = \text{normalise}\!\left(\frac{1}{|T|}\sum_{t \in T} f_{\text{txt}}\big(t(c)\big)\right) $$

where $T$ is a set of prompt templates — "a photo of a {}", "a blurry photo of a {}", and so on — whose embeddings are averaged into one class vector. This prompt ensembling is worth several points of accuracy, which is an early instance of a theme that recurs throughout this section: a meaningful fraction of reported capability lives in the prompt rather than the weights. See VQA §3 for the same effect, less benignly.

1.5 The failure: a bag of words

Look again at the loss. The gradient pushes matched pairs together and mismatched pairs apart — and nothing else. Consider the caption "a dog chasing a cat". For the model to be penalised for confusing it with "a cat chasing a dog", the batch would have to contain the reversed caption paired with a different image. In a random batch drawn from web data, it essentially never does.

So word order is free, and the model learns to ignore it. The representation that minimises the loss is one that encodes which concepts are present, because that is sufficient to solve every batch it ever sees. This is not a training bug or a capacity limit — it is the objective's actual optimum. The evidence is documented in ARO and Winoground, where strong models score at or below chance on word-order-sensitive pairs, and it is the root cause of the relational failures on VQA. The structural fix — hard negatives constructed by permuting word order — helps on the probes but transfer remains an open question; see research §4.

1.6 Batch size is part of the objective

The denominator in the softmax is the batch. The batch is the negative set, so batch size is not merely a throughput knob — it sets the difficulty of the task. CLIP trained at $B = 32{,}768$, which requires sharding across many devices and then an all-gather of every embedding so each device can compute a full row of the similarity matrix.

$$ \text{memory for logits} = O(B^2), \qquad \text{communication per step} = O(B \cdot d) $$

This is the engineering burden SigLIP removes.

2 · SigLIP

2.1 The pairwise sigmoid objective

Replace one $B$-way classification with $B^2$ independent binary ones. Every cell of the similarity matrix is asked a yes/no question: is this pair matched?

$$ \mathcal L_{\text{SigLIP}} = \frac{1}{B}\sum_{i=1}^{B}\sum_{j=1}^{B} \log\!\Big(1 + \exp\big(z_{ij}(-t\,s_{ij} + b)\big)\Big), \qquad z_{ij} = \begin{cases}+1 & i=j\\ -1 & i\neq j\end{cases} $$

This is just the logistic loss, $\log(1 + e^{-z\cdot\text{logit}})$, with logit $= t\,s_{ij} - b$. Two learned scalars: $t$ a temperature as before, and $b$ a bias.

2.2 Why the bias term is necessary, not cosmetic

The pair matrix is extremely imbalanced: $B$ positives against $B^2 - B$ negatives. At $B = 16{,}384$ that is one positive per 16,383 negatives. Initialised at $b = 0$, every pair starts at probability $\tfrac12$, so the loss is dominated by the enormous negative mass and the model's fastest descent direction is to call everything a non-match — which collapses the embedding.

Initialising $b$ strongly negative encodes the correct prior ("pairs are almost never matched"), so gradients from the rare positives are not drowned. This is the same reasoning as the prior-probability initialisation in focal loss for dense detection.

2.3 The comparison, and the result that mattered

InfoNCE (CLIP)Sigmoid (SigLIP)
NormalisationSoftmax over the full batchNone — each pair independent
Needs all-gatherYesNo — compute local chunks and sum
Logit memory$O(B^2)$ materialised$O(B^2)$ but chunkable
Small batchesDegrades badlyWorks — usable at a few thousand
Very large batchesKeeps helpingSaturates ~32K
Extra parameters$\tau$$t$ and $b$
The important finding was negative, and it changed practice. Scaling the batch beyond roughly 32K buys almost nothing. A great deal of CLIP-era distributed-training complexity existed to chase ever-larger batches on the assumption that bigger was simply better. Removing the global softmax removed the reason for that complexity — which is why SigLIP, not CLIP, is the vision tower in most 2024–2025 models in the comparison table. The lesson generalises: an ablation showing a knob does not matter can be worth more than one showing it does.

SigLIP 2 extends the same objective with multilingual data, captioning and self-distillation objectives alongside the contrastive term, and variable-resolution variants — but the loss is unchanged.

3 · The BLIP family

BLIP's contributions are best understood as two separate attacks on two separate problems: BLIP-1 on data quality, BLIP-2 on connecting frozen models.

3.1 BLIP-1 — the captioner–filter bootstrap

Web alt-text is noisy: much of it is SEO keywords, filenames or boilerplate that describes nothing in the image. CLIP's answer was to drown the noise in scale. BLIP's answer was to clean the data using the model being trained:

CapFilt — bootstrapping the captions 1. train a base model on noisy web pairs (I_web, T_web) 2. finetune a CAPTIONER on a small clean set (COCO) 3. finetune a FILTER on the same clean set 4. captioner: generate a synthetic caption T_syn for each web image 5. filter: score (I, T_web) and (I, T_syn); KEEP only pairs it judges matched 6. retrain on { kept web pairs } + { kept synthetic pairs } + clean

The synthetic captions frequently describe the image better than the human alt-text did, and retraining on the filtered mixture improves results measurably. This is the direct ancestor of the recaptioning strategies that later drove DALL·E 3 and several models in the table — the lineage is why "better captions" is now considered as strong a lever as "more data".

BLIP-1's architecture, the MED (multimodal mixture of encoder–decoder), shares one parameter set across three roles selected by attention masking, trained with three losses at once:

ModeLossPurpose
Unimodal encoderITC — image-text contrastive Align the two spaces, as in CLIP
Image-grounded encoderITM — image-text matching, binary A fusion classifier; catches hard negatives the cosine misses
Image-grounded decoderLM — captioning Generation, which is what makes the captioner possible
Why ITM exists alongside ITC. ITC compares two independently-computed vectors, so it can only measure global agreement — it cannot check whether the specific relations in the sentence hold in the image. ITM runs cross-attention before deciding, so it can. The standard trick is to mine hard negatives using ITC's cheap similarity, then let ITM adjudicate them. That division — cheap retrieval, expensive verification — recurs all over multimodal systems.

3.2 BLIP-2 — the Q-Former

By 2023 there were excellent frozen vision encoders and excellent frozen LLMs, and training either from scratch was wasteful. BLIP-2's question was how to connect them while training as little as possible. Its answer, the Q-Former, is a small transformer holding $k = 32$ learned query vectors:

frozen ViT ──> image features (e.g. 257 x 1408) │ │ cross-attention v 32 learned queries ──> Q-Former ──> 32 output vectors │ linear v frozen LLM input embeddings trainable: the Q-Former and one linear layer. Everything else frozen.

Stage one trains the Q-Former against the frozen image encoder with BLIP-1's three objectives, each using a different attention mask over the queries and text. Stage two connects it to the frozen LLM and trains only on language modelling. The result is a fixed 32-token visual representation, independent of input resolution.

And that fixed budget is why the design was abandoned. Compressing 257 patch features into 32 vectors discards spatial detail irreversibly. For captioning that was acceptable; when the field moved to documents, charts and text-in-image, the bottleneck became the binding constraint, and a plain MLP passing all 576 tokens beat it. Note what this means: BLIP-2 optimised the wrong cost — parameters trained — while the cost that actually mattered turned out to be information retained. The connectors table shows where the field landed instead.
The clean experiment nobody has published. The Q-Former was dropped on aggregate benchmark scores, not on a characterisation of what its bottleneck destroyed. Train probes to recover specific attributes — count, relative position, colour, OCR content — from $k$ learned queries while sweeping $k$, and plot what survives against $k$. It is cheap, it is inference-plus-probe only, and it would answer a question the field has simply left open. See research §3.

4 · What each contributed, in one table

ModelProblem it attackedMechanism Still used?
CLIPLabels bound you to a fixed vocabulary Contrastive training on 400M web pairs; zero-shot via prompts Yes — vision towers, text conditioning, CLIP score
ALIGNIs careful curation necessary? 1.8B minimally-filtered pairs As a result, not a component: scale substitutes for curation
SigLIPThe global softmax is a distributed-systems burden Pairwise sigmoid with a learned bias Yes — the current default vision tower
BLIP-1Web captions are noisy CapFilt — generate and filter captions with the model itself As a practice: recaptioning is now standard
BLIP-2Connect frozen towers cheaply Q-Former, 32 learned queries, two-stage training Largely not — superseded by MLP connectors
CoCaContrastive and generative were separate models One decoder, split into unimodal and multimodal halves As an idea — unified models are the current direction

5 · SOTA comparison — contrastive encoders

Zero-shot ImageNet top-1 is the standard yardstick for this family, because it requires no fine-tuning and therefore measures the representation itself. The caveat from the model table applies in full: these are author-reported figures under differing protocols, so read tiers, not ranks.

ModelBackboneResTraining pairs IN-1k 0-shotObjectiveOpen data?
CLIPViT-B/32224400M (WIT)~63% InfoNCENo
CLIPViT-L/14336400M (WIT)~76% InfoNCENo
ALIGNEfficientNet-L22891.8B noisy~76% InfoNCENo
OpenCLIPViT-H/14224LAION-2B~78% InfoNCEYes
OpenCLIPViT-G/14224LAION-2B~80% InfoNCEYes
EVA-CLIPEVA ViT-g224~2B merged~82% InfoNCE, MIM initMostly
CoCaViT-g288JFT-3B + ALIGN ~86%†Contrastive + captionNo
SigLIPSo400m/14384WebLI ~10B~83% Pairwise sigmoidNo
SigLIP 2So400m384+WebLI, multilingual~85% Sigmoid + caption + distilNo

† CoCa's usually-quoted 86% is fine-tuned, not zero-shot, so it does not belong in this column at all. It is included precisely because it is the number normally cited for that model — exactly the apples-to-oranges comparison this section warns about.

Two readings the papers tend not to foreground. First, data beats objective: OpenCLIP reproduced CLIP with the same loss on open data, and subsequent gains track corpus scale and curation far more tightly than loss design. Second, SigLIP's accuracy advantage over a comparable OpenCLIP is a few points — real, but far smaller than the engineering advantage of dropping the all-gather. It won on cost, not on accuracy, and saying so plainly is more useful than the usual framing.

5.1 Where the ranking changes

Zero-shot classification is one task. On the probes that isolate specific abilities, the ordering is not the same — which is the practical argument against choosing an encoder on IN-1k alone.

ProbeWhat it measuresHow this family does
COCO / Flickr retrievalImage–text matching in both directions Tracks IN-1k closely — same objective, same skill
WinogroundWord order and relational structure At or below chance at group level, across the whole family, regardless of scale (§1.5)
AROAttribution, relation, order Near-chance on relation and order subsets; scale does not rescue it
MMVP pairsVisually distinct images with near-identical embeddings Collapses pairs that a self-supervised encoder such as DINOv2 separates
Fine-grained (CUB, Cars)Subordinate categories Weaker than supervised baselines; the caption distribution simply lacks the vocabulary
OCR / text-in-imageReading Bounded by resolution, so a 384 px tower beats a larger 224 px one
The headline metric hides the defect it should be exposing. An encoder can gain points of zero-shot accuracy while remaining exactly as blind to word order, because the two abilities are unrelated under this objective (§1.5). Any paper selecting an encoder on IN-1k alone, or claiming general improvement from it, is measuring the one axis on which the family was never deficient.

6 · Using them in practice

TaskUseCaution
Retrieval / embedding indexSigLIP 2, or OpenCLIP ViT-G Normalise before indexing; cosine only means anything on the unit sphere
Zero-shot classificationAny CLIP-family model with prompt ensembling Report the template set — it is worth several points
Scoring generated imagesCLIP score, directional CLIP Gameable: see editing §8
Vision tower for a VLMSigLIP-So400m or CLIP ViT-L/14-336 Resolution is the ceiling on text-in-image — choose it first
Anything relational or compositional— Do not rely on a contrastive model. Word-order blindness is in the objective (§1.5)
Open-vocabulary detectionThe alignment idea, per region See GroundingDINO

7 · References

The figures on this page are original redrawings in the site's palette, not reproductions — the architectures are credited to the papers below. Where a blog post is the clearest explanation of something, it is cited as such.

7.1 Primary sources

  • Radford et al., Learning Transferable Visual Models From Natural Language Supervision (CLIP, ICML 2021).
  • Jia et al., Scaling Up Visual and Vision-Language Representation Learning With Noisy Text Supervision (ALIGN, ICML 2021).
  • Zhai et al., Sigmoid Loss for Language Image Pre-Training (SigLIP, ICCV 2023).
  • Li et al., BLIP (ICML 2022) and BLIP-2 (ICML 2023).
  • Yu et al., CoCa: Contrastive Captioners are Image-Text Foundation Models (2022).
  • Cherti et al., Reproducible scaling laws for contrastive language-image learning (OpenCLIP, CVPR 2023).
  • Sun et al., EVA-CLIP (2023).

7.2 On the bag-of-words failure

  • Thrush et al., Winoground (CVPR 2022).
  • Yuksekgonul et al., When and why vision-language models behave like bags-of-words, and what to do about it? (ICLR 2023).
  • Tong et al., Eyes Wide Shut? Exploring the Visual Shortcomings of Multimodal LLMs (MMVP, CVPR 2024).

7.3 Useful secondary explanations

  • Oord et al., Representation Learning with Contrastive Predictive Coding (InfoNCE, 2018) — the origin of the loss CLIP uses.
  • Lin et al., Focal Loss for Dense Object Detection (ICCV 2017) — the prior-initialisation argument that explains SigLIP's bias term.

Related: Architecture modules · Model comparison table · Stable Diffusion deep dive · Visual question answering · Open problems · DINOv2 (vision without language)