Sub topic 16
Successors and Variants: OpenCLIP, ALIGN, and SigLIP
This chapter assumes you understand CLIP's dual-encoder design, normalized embeddings, cosine similarity, and symmetric contrastive loss. The main question here is how later systems change the data, model scale, or training objective.
CLIP's core idea remains useful: an image encoder and a text encoder map their inputs into a shared vector space. Matching image-text pairs have high similarity. Different variants change how this alignment is learned and how the model is distributed.
OpenCLIP: an open reproduction and extension
OpenCLIP is an open-source implementation and model collection inspired by the original CLIP. It supports many encoders, training datasets, and pretrained checkpoints. A common checkpoint uses a Vision Transformer with weights trained on the LAION image-text datasets.
The architecture is still a dual encoder. During training, a batch produces an image-to-text similarity matrix. The diagonal contains matching pairs, and the contrastive objective pushes those entries above the in-batch negatives.
OpenCLIP is useful when you need:
- Model weights and training code that are more openly available.
- A choice of image encoder size and training dataset.
- Local inference without depending on a hosted API.
- Checkpoints for experiments or domain adaptation.
The checkpoint name matters. Different checkpoints can have different image resolution, vocabulary behavior, training data, and accuracy. Do not compare two checkpoints only by their model family name.
import torch
import open_clip
from PIL import Image
model, _, preprocess = open_clip.create_model_and_transforms(
"ViT-B-32",
pretrained="laion2b_s34b_b79k",
)
tokenizer = open_clip.get_tokenizer("ViT-B-32")
image = preprocess(Image.open("photo.jpg")).unsqueeze(0)
text = tokenizer(["a photo of a cat", "a photo of a dog"])
with torch.no_grad():
image_features = model.encode_image(image)
text_features = model.encode_text(text)
image_features = image_features / image_features.norm(dim=-1, keepdim=True)
text_features = text_features / text_features.norm(dim=-1, keepdim=True)
probabilities = (100 * image_features @ text_features.T).softmax(dim=-1)
print(probabilities[0].tolist())ALIGN: scale and noisy alt text
ALIGN, or A Large-scale ImaGe and Noisy-text embedding, follows the same broad dual-encoder pattern. Its important design choice is training on a very large collection of image-text pairs gathered from the web with limited cleaning.
This approach trades careful annotation for scale. More data can expose the model to rare objects, concepts, and languages. However, web text can contain incorrect descriptions, duplicates, offensive associations, and strong popularity bias.
ALIGN shows that filtering and dataset scale are both important design variables. A cleaner, smaller dataset may produce different behavior from a much larger but noisier one.
SigLIP: pairwise sigmoid loss
SigLIP changes the loss rather than relying on a batch-wide softmax. For every image-text pair, it treats the pair as a binary decision: should these two items match?
The model applies a sigmoid function to each pair's logit. Positive pairs target 1, while selected negative pairs target 0. This removes the requirement to normalize across the entire batch.
| Variant | Main change | Practical implication |
|---|---|---|
| OpenCLIP | Open implementation and many checkpoints | Flexible local experimentation |
| ALIGN | Very large, noisy image-text dataset | More scale, but more data-quality risks |
| SigLIP | Pairwise sigmoid loss | Less dependence on global batch normalization |
Choosing a variant
Choose OpenCLIP when reproducibility, checkpoint choice, or offline inference matters. Consider ALIGN-style models when broad coverage and scale are more important than strict data cleanliness. Consider SigLIP when its training and inference ecosystem fits your deployment constraints, especially when you want a pairwise objective rather than batch-wide competition.
A common error is to mix a model from one implementation with the processor, tokenizer, or preprocessing rules from another. Image resizing, normalization, tokenization, and logit scaling must match the checkpoint.
Exercise
What is the central training-objective difference between CLIP and SigLIP?
Show answer
CLIP commonly uses a batch-wide symmetric softmax contrastive loss, while SigLIP treats image-text pairs as independent binary matching decisions with a sigmoid-based loss.