DL0111 SigLIP vs CLIP

What are the differences between SigLIP and CLIP?

Answer

CLIP and SigLIP share the same dual-encoder architecture, the same cosine-similarity scoring, and the same zero-shot classification recipe; the substantive difference is the training objective. CLIP optimizes a softmax InfoNCE loss in which each image’s logit row is normalized over every text in the batch and each text’s column over every image, so the loss contribution of a single pair depends on the entire batch, and the distributed implementation needs an all-gather plus a global normalization pass. SigLIP replaces this with a pairwise sigmoid loss that treats each of the N^2 cells of the similarity matrix as an independent binary decision (“is this a real pair?”), using a shared learnable temperature plus a learnable bias b initialized to -10 to absorb the fact that only N of the N^2 pairs are positive. Because nothing is normalized across the batch, the loss decomposes into b \times b blocks, which lets SigLIP be implemented as a memory-efficient ring over devices and trained at batch sizes a softmax implementation cannot fit. Empirically the sigmoid loss is clearly better at small and moderate batch sizes, the two objectives converge above roughly 32k examples per step, and the million-example batch study SigLIP made possible showed that accuracy saturates long before that. That efficiency, plus the shape-optimized SoViT-400m/14 backbone released with it, is why SigLIP checkpoints became the default vision tower in many recent vision-language models such as PaliGemma.

(1) Loss Form: CLIP uses two symmetric softmax cross-entropies over the batch; SigLIP uses one binary logistic loss per pair, summed over the full N \times N grid.
(2) Batch Coupling: softmax logits are only meaningful after a global normalization, so every device must see all 2N embeddings; sigmoid logits are independent, so blocks can be scored and reduced locally.
(3) Extra Bias Parameter: the sigmoid objective faces an extreme N^2 - N negatives against N positives imbalance, which the learnable bias fixes by starting every logit near “not a pair”.
(4) Batch-Size Behavior: sigmoid wins at 4k to 16k, matches softmax above roughly 32k, and both saturate rather than improving toward one million.
(5) Everything Else Is Unchanged: image tower, text tower, unit-norm embeddings, and prompt-based zero-shot evaluation are identical, so SigLIP is effectively a drop-in replacement at the loss layer.
(6) Practical Differences In The Checkpoints: public English SigLIP models use a 32k SentencePiece vocabulary with a 64-token text context (the original paper’s initial experiments used 16, but the released checkpoints increased it to 64), shorter than CLIP’s 77-token BPE context, which matters when captions are long.

Two 4 by 4 image-text similarity matrices. On the left, arrows show softmax normalization along every row and every column, coupling all pairs. On the right, each cell is an independent binary label scored by a sigmoid with learnable temperature and bias.

Figure 1: Both objectives see the same similarity matrix. CLIP normalizes each row and column, so a single logit’s gradient depends on the whole batch; SigLIP scores each cell as an independent binary label with a shared temperature and bias, which removes the coupling entirely.

Mathematical Formulation:
s_{ij} = t\, x_i^{\top} y_j
\mathcal{L}_{\mathrm{i2t}} = -\frac{1}{N}\sum_{i} \log \frac{e^{s_{ii}}}{\sum_{j} e^{s_{ij}}}
\mathcal{L}_{\mathrm{t2i}} = -\frac{1}{N}\sum_{j} \log \frac{e^{s_{jj}}}{\sum_{i} e^{s_{ij}}}
\mathcal{L}_{\mathrm{CLIP}} = \tfrac{1}{2}\left(\mathcal{L}_{\mathrm{i2t}} + \mathcal{L}_{\mathrm{t2i}}\right)
\mathcal{L}_{\mathrm{SigLIP}} = \frac{1}{N}\sum_{i}\sum_{j}\log\left(1 + e^{-z_{ij}(s_{ij} + b)}\right)

Where:

  • x_i and y_j are the unit-norm image and text embeddings, so x_i^{\top} y_j is a cosine similarity in [-1, 1].
  • s_{ij} is the scaled logit and t = \exp(t') is the learnable temperature, parameterized in log space in both methods.
  • i, j \in \{1, \ldots, N\} index the global batch; the diagonal i = j holds the N true pairs and the off-diagonal holds N^2 - N negatives.
  • z_{ij} = +1 for a matched pair and z_{ij} = -1 otherwise, which is the binary label the sigmoid loss regresses on.
  • b is the learnable bias unique to SigLIP, with the required initialization b = -10 and t' = \log 10; CLIP has no analogue because its softmax is shift-invariant.

The engineering consequence is the part interviewers usually probe. In a softmax implementation the batch is a single indivisible unit: after the all-gather each of the D devices holds all 2N embeddings and materializes an N \times b logit slab, and the row and column sums must be reduced across devices before any gradient exists. SigLIP instead keeps each device’s image chunk local and passes text chunks around a ring, accumulating loss from one b \times b block at a time, so peak logit memory drops by a factor of D and no cross-device normalization is needed. This is exactly what allowed the authors to sweep batch size up to one million and demonstrate saturation, and it is also why the SigLiT variant, which locks a pretrained image tower and trains only the text side, reached 84.5% ImageNet zero-shot accuracy in two days on four TPUv4 chips. The trade-off is two extra hyperparameters to get right: a badly initialized bias makes the first thousands of steps a wasted fight against the negative-pair prior.

Top panel: four devices each holding a local chunk feed into an all-gather box where every device holds all N embeddings for a global softmax. Bottom panel: four devices keep their image chunk local while text chunks rotate around a ring, scoring one b by b block per step.

Figure 2: The softmax loss forces an all-gather and a global normalization, so each device carries an N \times b logit slab. The sigmoid loss decomposes, so a ring of D steps covers every pair while only b \times b logits exist at once.

PropertySigLIP (sigmoid loss)CLIP (softmax InfoNCE)
ObjectiveOne binary logistic loss per image-text pair over the full gridTwo symmetric cross-entropies over row-wise and column-wise softmax
Batch couplingNone; the loss is a sum of independent termsGlobal; every logit is normalized against the whole batch
Extra parametersLearnable temperature plus a learnable bias, initialized to log 10 and -10Learnable temperature only; a bias would cancel in the softmax
Distributed costChunked ring; peak logit memory b x b per device, no normalization reduceAll-gather of all embeddings plus an N x b logit slab per device
Small batch (4k to 16k)Clearly stronger zero-shot accuracy at equal examples seenDegrades noticeably; the normalization has few negatives to work with
Very large batchFeasible up to one million, but accuracy saturates near 32kComparable above roughly 32k, but memory-bound before that
Text context64 tokens (16 in the original paper), 32k SentencePiece in the English releases77 tokens, 49k byte-pair vocabulary
Typical role todayDefault frozen vision tower for many VLMs, notably SoViT-400m/14Legacy ecosystem: diffusion text conditioning, CLIPScore, many distilled models

Login to view more content


Log in to track your progress

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *