Zhai, Mustafa, Kolesnikov, Beyer (Google DeepMind) — ICCV 2023

SigLIP: Sigmoid Loss for Language-Image Pre-Training

CLIP's softmax contrastive loss couples every image to every text in the batch through a global normalization. SigLIP throws that away — it scores each image-text pair independently with a plain sigmoid, decoupling the loss, simplifying the implementation, and winning at small batch sizes.

Prerequisites: Dot products + Softmax & sigmoid + The CLIP idea (image & text encoders into a shared space). That's it.
10
Chapters
10+
Simulations
2
Code Labs

Chapter 0: The Softmax Tax

You want to train a CLIP-style model — an image encoder and a text encoder that map photos and captions into the same vector space, so that a picture of a corgi lands next to the words "a photo of a corgi." The standard recipe (Radford et al., 2021) is a contrastive loss: take a batch of n image-text pairs, compute the n × n matrix of image-text similarities, and train so the n matched pairs on the diagonal score high while the n² − n mismatched off-diagonal pairs score low.

Here is the catch that nobody puts on the poster. CLIP's loss is a softmax over each row and each column of that similarity matrix. A softmax has a denominator, and that denominator is a sum over every other entry in the row. To compute the loss for a single image, you need the similarity of that image to every caption in the batch. The loss is not a property of one pair — it is a property of the whole batch at once.

When the batch is split across, say, 256 accelerator chips for data parallelism, each chip holds only a few image-text pairs. But the softmax denominator needs all of them. So every step you must all-gather the full set of embeddings (or the full similarity matrix) across all chips, twice — once for the image-to-text softmax, once for the text-to-image softmax. That is a global synchronization barrier and an O(n²) communication cost, baked into the loss itself.

The Coupling: One Image Needs The Whole Batch

Top: the softmax loss for image 0 (warm) reaches across to every caption in the batch — that whole row is its denominator. Click "Animate" to watch the dependency sweep. Bottom: the sigmoid loss for the same pair touches only the single matched entry plus its own independent negatives. Notice the softmax needs the entire row before it can produce a single number.

Click to compare
PropertyCLIP (softmax contrastive)SigLIP (sigmoid)
Loss granularityPer row/column — needs whole batchPer pair — fully independent
NormalizationGlobal softmax over all candidatesNone — each pair is its own σ
Cross-device commsTwo all-gathers per step (O(n²))Cheap pairwise sums (O(n²) compute, no global softmax)
Small batchWeak — few negatives, noisy denominatorStrong — outperforms softmax
ImplementationSymmetric two-way softmax + syncA few lines of sigmoid cross-entropy
The Transformer-shaped bet, again. CLIP's authors believed the softmax — and therefore the global batch normalization — was load-bearing: the more candidates in the denominator, the better the contrast. SigLIP's question is the same one the Transformer asked of recurrence: what if we just delete it? Replace the batch-coupled softmax with a per-pair sigmoid binary classification. You lose the explicit "rank the right caption above all others" framing, but you gain a loss that is local, decoupled, sync-free, and — surprisingly — better at the batch sizes most people can actually afford.

What was actually broken

Two things. First, the engineering pain above: the softmax forces a global reduction, so scaling the batch means scaling expensive cross-device communication, and small-batch training is left in the cold. Second, a subtler statistical point. The softmax normalizes over the negatives, so its gradient signal per pair is entangled with however many negatives happen to be in the batch this step. SigLIP decouples the positive term from the negative terms entirely — each pair gets its own loss whose scale you control directly with a learnable temperature and bias, not implicitly through the batch size.

By the end of this chapter you will have run, in your browser, the exact two losses on the same similarity matrix and watched them produce different gradients. Let us first make sure the CLIP baseline is crisp.

Why does CLIP's softmax contrastive loss force a global synchronization across accelerator chips every training step?

Chapter 1: CLIP in One Page

To appreciate what SigLIP changes, we need the CLIP loss in our hands, exactly. Suppose a mini-batch of n image-text pairs. An image encoder f turns image i into a unit vector xi; a text encoder g turns caption j into a unit vector yj. Both live in the same d-dimensional space. (In the paper, image embeddings have shape [n, d] and text embeddings [n, d], with d typically 768 or 1152.)

The logit for pair (i, j) is their scaled dot product:

ij = t · xi · yj

where xi · yj is the cosine similarity (both vectors are L2-normalized) and t > 0 is a learnable temperature (CLIP parametrizes it as exp of a learnable scalar, clamped to avoid blow-up). Stack these into an n × n matrix of logits. The diagonal entries ℓii are the matched pairs; everything off-diagonal is a mismatch.

The two-way softmax

CLIP applies a softmax cross-entropy in both directions and averages. Reading along row i (image i against all n captions), the correct class is the diagonal:

Limg→txt = −1ni log exp(ℓii)j exp(ℓij)

Reading down column j (caption j against all n images), the correct class is again the diagonal:

Ltxt→img = −1nj log exp(ℓjj)i exp(ℓij)
LCLIP = 12 (Limg→txt + Ltxt→img)

The asymmetry between the two directions is the whole reason CLIP needs two softmaxes: the image-to-text denominator sums over a row, the text-to-image denominator sums over a column. Each is a different normalization of the same matrix.

A worked 2×2 by hand

Take n = 2 with the scaled logit matrix ℓ = [[4, 1], [0, 3]] (so ℓ00 = 4 and ℓ11 = 3 are the matched pairs, already including t). The image-to-text softmax for row 0 has denominator e4 + e1 = 54.60 + 2.72 = 57.32, so the matched probability is 54.60 / 57.32 = 0.953, and −log(0.953) = 0.049. Row 1 has denominator e0 + e3 = 1 + 20.09 = 21.09, matched prob 20.09 / 21.09 = 0.953, loss 0.049. So Limg→txt = (0.049 + 0.049)/2 = 0.049.

Now the columns. Column 0 has denominator e4 + e0 = 55.60, matched prob 54.60/55.60 = 0.982, loss 0.018. Column 1 has e1 + e3 = 22.81, matched prob 20.09/22.81 = 0.881, loss 0.127. So Ltxt→img = (0.018 + 0.127)/2 = 0.073. The total CLIP loss is (0.049 + 0.073)/2 = 0.061. Notice every one of those four denominators mixed entries from across the matrix — that mixing is exactly the coupling SigLIP will sever.

CLIP's Two-Way Softmax On The Similarity Matrix

A 5×5 image-text similarity matrix (diagonal = matched pairs, warm). Toggle which softmax direction is active. The highlighted band is the set of entries that go into one softmax denominator — the whole row (image→text) or the whole column (text→image). The loss for one pair is never local.

Row softmax: image attends to all captions
The key reading. A contrastive loss is a classification problem in disguise: "which of the n captions matches this image?" The softmax is the natural loss for an n-way classification, and its denominator — the partition function — is the sum over all candidate classes. That partition function is the global normalization. SigLIP's move is to stop treating it as n-way classification and treat each pair as its own binary classification: match or no match.

Hold onto the matrix picture. Both losses we compare in this lesson act on the very same n × n logit matrix ℓ = t · XYT. They differ only in how they turn that matrix into a scalar.

Why does the standard CLIP loss use two softmax terms (image→text and text→image) rather than one?

Chapter 2: The Sigmoid Loss, Derived

Here is SigLIP's entire idea. Forget "which caption out of n." Instead ask, for every entry of the n × n matrix independently: is this image and this text an actual pair, yes or no? That is a binary classification, and the loss for binary classification is the sigmoid (logistic) cross-entropy.

Define a label zij that is +1 if i and j are a true pair (the diagonal, i = j) and −1 otherwise (every off-diagonal mismatch). The logit for the pair, exactly as in CLIP, is ℓij = t · xi · yj + b, where t is the learnable temperature and b is a new learnable bias (Chapter 3 explains why we suddenly need a bias). The sigmoid loss is:

Lsig = −1ni=1nj=1n log 11 + exp(−zij(t · xi · yj + b))

Read the argument carefully. The quantity inside is zij · ℓij. For a positive pair z = +1, so we maximize σ(ℓij) — we want the matched logit high. For a negative pair z = −1, so we maximize σ(−ℓij) — we want the mismatched logit low. Each (i, j) cell contributes its own term, summed over the whole matrix. There is no denominator that mixes cells.

Why this is logistic regression, per cell

The standard binary cross-entropy with a ±1 label and logit ℓ is −log σ(z · ℓ). When z = +1 it is the "softplus" −log σ(ℓ) = log(1 + e−ℓ); when z = −1 it is log(1 + e+ℓ). So the SigLIP loss is just n² independent logistic regressions sharing the same encoders and the same (t, b). The diagonal supplies n positive examples; the off-diagonal supplies n² − n negatives.

The crucial structural difference. In softmax, the n negatives in a row compete with the positive for a fixed probability budget of 1 — pushing one negative down necessarily pulls others up. In sigmoid, each negative is judged on its own absolute scale; pushing one down does nothing to the others. That decoupling is exactly why SigLIP needs no global normalization, and why its gradient per pair does not depend on how many other pairs share the batch.

A worked 2×2 by hand (same matrix as Ch 1)

Use the raw similarity matrix s = [[4, 1], [0, 3]] (we will fold t and b into these for the example, so ℓ = s here). The labels are z = [[+1, −1], [−1, +1]]. Now compute z · ℓ for each cell: z0000 = +4, z0101 = −1, z1010 = 0, z1111 = +3.

The per-cell loss is log(1 + e−(zℓ)). Cell (0,0): log(1 + e−4) = log(1.0183) = 0.0181. Cell (0,1): log(1 + e+1) = log(3.718) = 1.313. Cell (1,0): log(1 + e0) = log(2) = 0.693. Cell (1,1): log(1 + e−3) = log(1.0498) = 0.0486. Sum = 2.073, divide by n = 2: Lsig = 1.036.

Compare to the CLIP loss on the same matrix from Chapter 1: 0.061. They are completely different numbers, and — more importantly — their gradients point in different directions. The sigmoid is screaming about cell (0,1) and (1,0) (the easy-to-improve negatives) in a way the softmax, with its competitive budget, partly masks. This is not a bug; it is the different inductive bias.

Per-Cell Sigmoid Loss: Each Entry Is Independent

The same 5×5 similarity matrix, now scored by the sigmoid loss. Each cell is shaded by its own loss value (brighter = higher loss), with NO reference to any other cell. Diagonal cells (positives, ringed warm) want a high logit; off-diagonal cells (negatives) want a low logit. Drag the slider to move every logit up or down and watch positives and negatives trade off.

Logit shift 0.0
python
# SigLIP loss vs CLIP loss on the SAME similarity matrix
import numpy as np

def sigmoid(z): return 1.0 / (1.0 + np.exp(-z))

# n image-text pairs, already L2-normalized embeddings
# logits[i,j] = t * (x_i . y_j) + b   (t,b folded in below)
logits = np.array([[4., 1.],
                   [0., 3.]])
n = logits.shape[0]

# z = +1 on the diagonal (true pairs), -1 off-diagonal
z = 2.0 * np.eye(n) - 1.0          # [[1,-1],[-1,1]]

# SigLIP: independent sigmoid per cell, averaged
L_sig = -np.mean(np.log(sigmoid(z * logits)).sum(axis=1))
# L_sig = 1.036

# CLIP: two-way softmax cross-entropy, averaged
def ce(M):
    lse = np.log(np.exp(M).sum(axis=1))   # row log-sum-exp
    return np.mean(lse - np.diag(M))   # -log p(diagonal)
L_clip = 0.5 * (ce(logits) + ce(logits.T))
# L_clip = 0.061  -- a different number AND a different gradient
Misconception: "sigmoid loss has no negatives, so the embeddings collapse." Not so. The off-diagonal cells are the negatives — n² − n of them per batch, each pushed toward a low logit by z = −1. SigLIP keeps every negative softmax keeps; it just scores each one independently instead of forcing them to compete inside a shared denominator. The fix for the real risk (a flood of easy negatives swamping the few positives at initialization) is the bias term, which is Chapter 3 — not the absence of negatives.
In SigLIP, what does the label zij = −1 do to an off-diagonal (mismatched) cell?

Chapter 3: The Temperature and the Bias

The sigmoid loss as written would fail catastrophically at the start of training, and the reason is a counting problem. Look at the matrix: there are n positives on the diagonal and n² − n negatives off it. For a batch of 16,384, that is 16,384 positives against roughly 268 million negatives. At initialization the encoders are random, so every logit is near zero, every σ is near 0.5, and the negative term −log σ(−ℓ) ≈ −log(0.5) is paid 16,000 times over for every single positive.

That overwhelming negative mass produces a huge initial gradient that simply shoves all logits as negative as possible — positives included. The model spends the early steps just learning "everything is a mismatch," which is a terrible, slow place to start. SigLIP's fix is a single learnable scalar.

The bias term b

Add a learnable bias b to every logit: ℓij = t · xi · yj + b. Initialize b to a large negative value (the paper uses binit = −10). With b = −10 at the start, every logit is around −10, so σ(−ℓ) for a negative is σ(10) ≈ 0.99995 — the loss on each negative is essentially zero. The model starts from the sensible prior "most pairs are mismatches" (which, in a random batch, is true: only the diagonal matches), so the early gradient is dominated by the few positives it needs to pull up rather than the flood of negatives it would otherwise fight.

binit = −10    ⇒    σ(ℓ) ≈ e−10 ≈ 0.000045 for an untrained pair

This is exactly the trick used to stabilize one-vs-all detectors with extreme class imbalance (the "prior bias" of focal-loss-era object detectors): bias the classifier toward the majority class at init so the rare positives are not drowned.

The temperature t

The temperature t scales the cosine similarity (which lives in [−1, 1]) up into a useful logit range. Like CLIP, SigLIP parametrizes t' = log t as the free variable and uses t = exp(t'), so t stays positive, and initializes t' = log 10 (so t starts at 10). As training proceeds the model learns how sharp it wants the decision boundary: a larger t makes σ steeper, so small cosine differences become confident yes/no decisions.

Why a bias here but not in CLIP? CLIP's softmax is shift-invariant: adding a constant to an entire row leaves the softmax probabilities unchanged (it cancels in numerator and denominator). So a bias term does literally nothing in a softmax — there is no imbalance to correct because the row is normalized to sum to 1. SigLIP's sigmoid is not shift-invariant; the absolute logit value matters, and that is precisely why it both can and must use a bias to set the operating point for a wildly imbalanced binary problem.

Worked example: bias at initialization

Take a tiny n = 4 batch at init with all cosine similarities ≈ 0 (random encoders) and t = 10, so the t-scaled term is ≈ 0. With b = 0: every logit is 0, every σ = 0.5. The total negative loss is (n² − n) · −log(0.5) = 12 · 0.693 = 8.32, while the positive loss is n · −log(0.5) = 4 · 0.693 = 2.77. Negatives outweigh positives 3:1 even at this toy size; at batch 16k it is 16,000:1.

Now with b = −10: every logit is −10. Negative loss per cell is −log σ(10) = −log(0.99995) = 0.000045, times 12 = 0.00055 — negligible. Positive loss per cell is −log σ(−10) = −log(0.000045) = 10.0, times 4 = 40.0. The loss landscape is now driven almost entirely by the positives the model must learn to recognize, exactly as desired. The model climbs out of the −10 prior only for genuine matches.

Bias At Initialization: Taming The Negative Flood

Drag the initial bias b. The two bars show the total loss mass coming from the n positives (warm) vs the n²−n negatives (teal) at initialization, for a batch of n shown by the second slider. Without a strongly negative bias, the negatives dominate by orders of magnitude; the paper's b = −10 flips control to the positives.

Init bias b -10.0
Batch n 64
python
import torch
import torch.nn as nn

class SigLIPHead(nn.Module):
    def __init__(self):
        super().__init__()
        # learnable log-temperature, init so t = exp(log 10) = 10
        self.t_prime = nn.Parameter(torch.tensor(2.3026))   # log(10)
        # learnable bias, init -10 to counter negative-pair flood
        self.b       = nn.Parameter(torch.tensor(-10.0))

    def forward(self, img_emb, txt_emb):
        # img_emb, txt_emb: [n, d], already L2-normalized
        t = self.t_prime.exp()                 # positive temperature
        logits = t * img_emb @ txt_emb.T + self.b  # [n, n]
        return logits
Misconception: "the bias is just another knob and could be folded into the temperature." No — t and b play different roles and are not interchangeable. t multiplies the similarity (controls the slope of the decision); b adds to it (controls the operating point, i.e. the default match probability for a random pair). You cannot fix a 16,000:1 class imbalance by sharpening the slope; you fix it by shifting the threshold so the default prediction is "no match." Different geometry, different parameter.
Why does SigLIP initialize the bias b to a large negative number like −10, while CLIP's softmax has no bias at all?

Chapter 4: No Global Sync — The Efficient Implementation

The single biggest systems payoff of the sigmoid loss is how it parallelizes. Because each cell is independent, the loss decomposes cleanly across devices, and the all-gather of the full batch that the softmax demanded simply disappears.

How softmax forces the all-gather

Suppose data parallelism over D devices, each holding a local chunk of b = n/D pairs. The softmax denominator for any image needs all n captions. So each device must receive the embeddings of every other device's text (and images) — an all-gather of the full [n, d] embedding tensors, every step, in both directions. Communication grows with the batch, and the loss cannot even start until the gather completes (a hard barrier).

SigLIP's chunked, swap-based loss

SigLIP computes the sigmoid loss as a sum over the matrix, and a sum can be reorganized however you like. The paper's trick: each device first computes the loss for its own diagonal block (its local images vs its local texts — including the positives). Then the devices pass their text representations around the ring of D devices, one hop at a time. On each hop, every device computes the loss between its local images and the incoming texts — all negatives — and adds it in. After D − 1 hops every image has seen every text, and the full loss is accumulated.

Step 0 — local block
Each device scores its own images × its own texts. Contains the positives (diagonal). No comms.
↓ pass texts one hop around the ring
Step k — incoming texts
Score local images × received texts (all negatives). Add into the running loss. Only one device's worth of text moves per hop.
↻ repeat D−1 times
Done
Every image has been scored against every text. Full loss accumulated with O(b) memory per device and O(b) comms per hop — never the whole [n,d] at once.

The key property that makes this legal is that the sigmoid loss is a plain sum of per-cell terms with no shared denominator. You could never reorganize a softmax this way — each row's normalizer needs the whole row simultaneously before any term is correct. The sigmoid's independence is what unlocks the memory-flat, communication-light implementation.

The concrete win. Memory per device stays O(b) (one local block plus one incoming text chunk) instead of O(n) (the full gathered batch). Communication is a sequence of small device-to-device sends, not a global all-gather. The paper reports this lets them push batch size far past what a naive softmax implementation fits — they even study up to a million examples — using only a handful of TPU chips.

Ring Pass: The Whole Matrix Without A Global Gather

Four devices, each owning one block of images (rows) and texts (columns). Click "Hop" to pass texts one step around the ring. The cells covered so far light up; the diagonal blocks (positives) are computed locally at step 0 with zero communication. After 3 hops the full matrix is covered — no device ever held more than two blocks at once.

Step 0/3 — local diagonal blocks only
Misconception: "SigLIP is cheaper because it skips the negatives." The compute is the same O(n²) matrix of logits in both losses — SigLIP scores every pair too. What it skips is the global softmax normalization, and that is what eliminates the all-gather barrier and the O(n) per-device memory. The savings are in communication and memory layout, not in the number of pairs evaluated.
What property of the sigmoid loss makes the chunked "ring pass" implementation possible, where a softmax loss cannot be reorganized the same way?

Chapter 5: The Batch Size Story

The headline empirical finding of the paper is about batch size, and it is genuinely surprising. Conventional CLIP wisdom said "bigger batch is always better" — more negatives in the softmax denominator means a harder, more informative contrast. SigLIP complicates that story in two directions.

Finding 1: at small and moderate batch, sigmoid beats softmax

When the batch is small (a few thousand or fewer), the softmax denominator has few candidates, so its normalization is noisy and the loss is weak. The sigmoid loss does not depend on a denominator at all — each pair's loss is well-defined regardless of how many other pairs are present. Across the small-to-moderate batch regime, SigLIP trains better than the equivalent softmax CLIP. This is the result that matters for practitioners who do not own thousands of accelerators.

Finding 2: the advantage shrinks as batch grows, and both saturate

As the batch grows into the tens of thousands, the softmax's denominator becomes rich and the gap between the two losses narrows; at very large batch the two perform comparably. More striking: both losses saturate. The paper finds performance keeps improving up to a batch of roughly 32k, but beyond that the gains flatten — a batch of 256k or even a million buys little over 32k. The community had assumed ever-larger batches were the road to better CLIP; SigLIP's controlled study shows there is a knee, and it is reachable.

The reframing. "Bigger batch is better" was conflated with "the softmax needs a big batch to have enough negatives." SigLIP separates those: the loss does not need a big batch to be well-behaved, and even when you can afford a big batch, ~32k is enough. The practical takeaway is that you can train strong image-text models at modest batch sizes on modest hardware — which is the democratizing punchline.

Worked intuition: why the softmax is noisy at tiny batch

Consider n = 2. The softmax denominator for image 0 is e00 + e01 — a single positive and a single negative. The "contrast" is against exactly one other caption, which may be trivially dissimilar (a corgi vs a rocket), giving almost no learning signal. The sigmoid loss for the same n = 2 still asks the absolute question "is (0,0) a match? is (0,1) a match?" and gets a meaningful gradient from each independently of how many negatives exist. As n grows, the softmax's single-positive-vs-many-negatives contrast sharpens and catches up.

Performance vs Batch Size (Schematic)

A schematic of the paper's central curve: zero-shot accuracy vs batch size for sigmoid (warm) and softmax (teal). At small batch sigmoid leads; the curves converge and both flatten past a knee near ~32k. Drag to mark a batch size and read off the gap. This is a qualitative reproduction of the trend, not exact numbers.

Batch size 8k
Batch regimeSoftmax (CLIP)Sigmoid (SigLIP)Who wins
Small (< ~4k)Noisy denominator, few negativesWell-defined per-pair lossSigmoid
Moderate (~8k–16k)ImprovingStill ahead, gap narrowingSigmoid (slightly)
Large (~32k)Near-saturatedNear-saturatedComparable
Huge (256k–1M)Saturated — little extra gainSaturated — little extra gainComparable; not worth the cost
Misconception: "SigLIP works at small batch because it is a smaller model." The architectures are identical — same image and text encoders, same dimensions. The only change is the loss function turning the n × n logit matrix into a scalar. The small-batch advantage is a property of the sigmoid loss's independence, not of any change to capacity or compute.
What is the paper's surprising finding about batch size?

Chapter 6: Results and Ablations

SigLIP is evaluated the standard CLIP way: zero-shot classification. After training only on image-text pairs (no labels), you classify an image by embedding the candidate class names as captions ("a photo of a {class}") and picking the one whose text embedding is closest to the image embedding. ImageNet zero-shot top-1 accuracy is the headline metric.

SigLiT: the locked-image variant

The paper's most efficient result uses SigLiT — sigmoid loss with a locked (frozen, pre-trained) image encoder and only the text tower trained, following the LiT recipe (Zhai et al., 2022). Because the image features are fixed, training is extremely cheap, and the sigmoid loss's small-batch strength shines: SigLiT reaches strong ImageNet zero-shot accuracy (in the mid-80s percent) after a short training run on only a few accelerator chips. The from-scratch SigLIP (both towers trained) is also competitive with, and at matched compute often better than, softmax CLIP.

The efficiency headline. The paper demonstrates training a strong sigmoid language-image model in roughly a couple of days on a small handful of TPUv4 chips — a regime where reproducing CLIP-scale softmax training would be far more painful. The combination of (a) frozen image tower, (b) sigmoid loss's small-batch competence, and (c) no all-gather barrier is what makes this accessible.

Ablation 1: the bias initialization matters

Removing the negative bias initialization (starting b near 0) hurts and slows training, exactly as the Chapter 3 imbalance argument predicts — the early gradient is dominated by the negative flood. A strongly negative binit (around −10) is important for stable, fast convergence. The temperature initialization (t around 10) follows CLIP and is similarly important for putting the cosine similarities into a usable logit range.

Ablation 2: sigmoid vs softmax, head to head

Holding everything else fixed and swapping only the loss, sigmoid matches or beats softmax across the batch sizes studied, with the largest margin at small batch (Chapter 5). This is the cleanest possible ablation because the only variable is how the logit matrix becomes a loss.

Ablation 3: robustness to noisy / few negatives

Because each negative is scored independently, the sigmoid loss is more tolerant of the small-batch regime where the softmax has too few negatives to form a sharp contrast. The paper also explores how the loss behaves as data and batch are varied, consistently finding the sigmoid loss a robust default.

SettingWhat is trainedCostImageNet zero-shot
SigLiTText tower only (image frozen)Very low (few chips, ~1–2 days)Strong (mid-80s %)
SigLIP (from scratch)Both towersModerateCompetitive with / better than softmax CLIP at matched compute
Softmax CLIP baselineBoth towersModerate–high (all-gather)Strong at large batch, weaker at small
Why the ablations are persuasive. The architecture, data, optimizer, and schedule are all held fixed; the loss is the lone moving part. So every difference in the results is attributable to the sigmoid-vs-softmax choice. That experimental cleanliness — change one thing, measure the effect — is what makes SigLIP a convincing paper rather than a grab-bag of tricks.
Zero-Shot Classification: Image → Nearest Caption

An image embedding (warm dot) is compared to several class-name text embeddings (teal). The bars are the sigmoid match scores σ(t·cos + b) — each independent. Drag to rotate which class the image is actually of and watch the matched bar rise while the others stay low (no competition, just absolute scores).

True class corgi
Misconception: "the sigmoid match scores in zero-shot must sum to 1 like softmax probabilities." They do not. Each σ(t·cos + b) is an independent probability that this specific image-caption pair is a match. Two classes could both score 0.9, or all could score 0.01. For top-1 classification you just take the argmax of the scores; you do not need them normalized. The freedom from normalization is the whole point.
What makes the SigLIP ablation comparing sigmoid to softmax especially convincing?

Chapter 7: The Loss Explorer (Showcase)

This is the payoff. You have a live 6 × 6 image-text similarity matrix. You control the temperature t, the bias b, and how strongly the diagonal (true pairs) separates from the off-diagonal. The panel computes both losses on the same matrix in real time, shows the resulting probability matrices side by side, and reports the two scalar losses. Play until you can predict how each control moves each loss.

SigLIP vs CLIP — Live On One Matrix

Left: the sigmoid probability matrix σ(t·cos + b) — each cell independent, brighter = higher match probability. Right: the softmax (image→text) probability matrix — each row sums to 1, so brightening one cell dims its neighbors. The diagonal is the true pairs (ringed warm). Watch how the bias only shifts the sigmoid side (the softmax is shift-invariant), and how separation sharpens both.

Temperature t 10.0
Bias b -6.0
Diagonal separation 0.55
L_sig: — | L_clip: —

Three experiments to run before you move on:

  1. Slide the bias from −14 up to +4. The softmax matrix on the right does not change at all (it is normalized per row — shift-invariant), but the sigmoid matrix on the left brightens everywhere, and Lsig changes. This is the Chapter 3 point made visible: the bias is a real, load-bearing parameter for sigmoid and a no-op for softmax.
  2. Crank the temperature t up. Both probability matrices sharpen — confident cells get more confident. At very high t the softmax rows go near one-hot and Lclip drops fast; the sigmoid also sharpens but each confident negative still pays its own price.
  3. Drop the diagonal separation to 0. Now true pairs are no more similar than mismatches — both losses rise sharply because neither can tell matches from non-matches. This is what an untrained model looks like.
What to take away. Both losses are functions of the very same logit matrix; they are two different read-outs of it. SigLIP's read-out is a sum of independent per-cell sigmoids (decoupled, shift-sensitive, needs a bias); CLIP's is a pair of row/column softmaxes (coupled, shift-invariant, no bias). Every difference in behavior you can see in this panel traces back to that one structural choice.

Chapter 8: Limits and Honest Caveats

SigLIP is a loss-function change, not a silver bullet. Several limits and open questions are worth stating plainly.

The advantage narrows at scale

The clearest win is at small-to-moderate batch. If you already command tens of thousands of accelerators and run batches of 32k or more, the softmax catches up and the practical accuracy difference becomes small. SigLIP does not promise a better large-scale model; it promises an equally good one trained more cheaply and a better one when you cannot afford the giant batch.

It does not fix data quality

Like CLIP, SigLIP learns from noisy web image-text pairs and inherits their biases, mislabelings, and gaps. A different loss does not clean the data. Downstream fairness and robustness issues familiar from CLIP carry over.

The bias and temperature need care

The negative bias initialization is important; get it wrong (e.g. binit near 0) and early training is dominated by the negative flood. The loss has a couple of sensitive knobs that the softmax does not, which is a small added burden even though the defaults (b = −10, t = 10) work well.

Still O(n²) compute

SigLIP removes the global softmax normalization and its all-gather, but it still scores all n² pairs — the matrix of logits is unchanged. The savings are in communication and memory, not in the asymptotic number of pair evaluations. Very large batches are still quadratic in compute.

QuestionSigLIP's answer
Does it beat softmax at huge batch?No — comparable; both saturate ~32k
Does it remove the O(n²) pair compute?No — same matrix; only the global sync is gone
Does it need extra hyperparameters?Yes — a bias term (init −10), but defaults are robust
Does it fix web-data bias?No — same data, same inherited issues
Where is it clearly better?Small/moderate batch, modest hardware, frozen-image SigLiT
Misconception: "SigLIP replaces CLIP everywhere, so softmax contrastive is obsolete." Not the claim. SigLIP shows the sigmoid loss is a better default — especially at accessible scales — and clarifies that the giant-batch arms race had a knee. But at frontier scale the two are comparable, and softmax contrastive remains a perfectly good choice. The contribution is a cleaner, cheaper, more democratic recipe, not a wholesale obsolescence.
Which of these is an honest limitation of SigLIP?

Chapter 9: Connections & Cheat Sheet

SigLIP sits at a crossroads of contrastive learning, multimodal pretraining, and distributed-training systems. Here is how it connects to the rest of the map.

Where it came from

SigLIP is the direct successor to CLIP (Radford et al., 2021) and LiT (locked-image tuning, Zhai et al., 2022). It keeps their two-tower architecture and zero-shot evaluation, and changes only the loss. The sigmoid-per-pair idea echoes the prior-bias trick from imbalanced detection (focal-loss-era detectors) and the long line of binary-vs-softmax debates in metric learning.

Where it leads

SigLIP became a workhorse vision encoder: SigLIP and SigLIP 2 image encoders are widely used as the frozen visual backbone in vision-language models (the "image tower" feeding an LLM). Its small-batch efficiency made it a practical default well beyond the original translation-flavored CLIP use case.

CLIP (2021)
Two towers + softmax contrastive loss; large-batch zero-shot transfer
↓ freeze the image tower
LiT (2022)
Locked image encoder, train only text — cheaper, strong zero-shot
↓ swap softmax → sigmoid
SigLIP (2023)
Per-pair sigmoid loss + bias; small-batch win, no global sync
↓ reused as a frozen backbone
VLMs
SigLIP image features feed a language model for captioning, VQA, grounding

Related lessons on this site

Cheat sheet

ConceptOne-line summary
Core changeReplace CLIP's softmax contrastive loss with a per-pair sigmoid (binary) loss on the same logit matrix
Logitij = t · xi · yj + b, with x, y L2-normalized; t, b learnable
Labelzij = +1 on the diagonal (true pairs), −1 off-diagonal
LossL = −1ni,j log σ(zijij) — independent per cell
Temperature tLearnable as t = exp(t'), init t = 10; scales cosine into logit range (the slope)
Bias bLearnable, init −10; counters the n² negative flood at init (the operating point)
Why no bias in CLIPSoftmax is shift-invariant — a bias cancels in the normalized row
Systems winNo global softmax → no all-gather barrier; chunked ring-pass loss, O(b) memory/device
Batch findingSigmoid wins at small/moderate batch; both saturate ~32k; bigger batches buy little
Best variantSigLiT (frozen image tower) — strong ImageNet zero-shot on a few chips in ~1–2 days
LegacySigLIP image encoders are a standard frozen backbone inside modern VLMs
The one sentence to remember. SigLIP scores every image-text pair as its own independent yes/no question with a sigmoid — deleting CLIP's global softmax normalization, the all-gather it required, and its small-batch weakness, while clarifying that the giant-batch arms race had a reachable knee.

"What I cannot create, I do not understand." — and you just created both losses, by hand and in code, on the same matrix. You understand the difference.