Every encoder here is the same machine, a vision transformer that cuts an image into patches and turns each patch into a token. What it is trained to put into those tokens (a match to its caption, agreement with another view of the same image, or its missing pixels) decides what the vectors are good for: text search and VLMs, frozen per-patch features, or a starting point for fine-tuning.
Fig. 1 is the page on one card: one backbone, three training signals, two kinds of output. Its numbers are this page's linear probe at 16 labels per class on Fashion-MNIST measured and DINOv2's published dense score published.
You need: what attention and a transformer block do (The transformer from zero), and the idea of a contrastive loss (Contrastive and self-supervised learning owns InfoNCE, DINO's self-distillation and MAE as methods; this page owns them as encoders). How a VLM plugs an encoder into a language model is on Vision-language models; image tokenizers for generation (VQ) are on Autoencoders and VAEs.
New terms
All five are base-size (about 86 million parameters in the image tower), so differences come from how they were trained, not from size. Each image goes through the model's own preprocessor, as anyone using the model would do.
| Encoder | Trained with | Patch, grid at its default input | Tokens out | One vector from | Positions |
|---|---|---|---|---|---|
| CLIP ViT-B/32 | captions, softmax contrastive loss (OpenAI, 2021) | 32 px, 7 × 7 at 224 | 49 + [CLS] | [CLS], LayerNorm, projection to 512 | learned table, 50 rows |
| SigLIP 2 B/16 | captions, sigmoid loss, plus captioning and self-distillation losses (Google, 2025) | 16 px, 14 × 14 at 224 | 196, no [CLS] | attention-pooling head (MAP) | learned table, 196 rows |
| DINOv2 ViT-B/14 | images alone, self-distillation plus masked prediction, distilled from a 1.1B teacher (Meta, 2023) | 14 px, 16 × 16 at 224 | 256 + [CLS] | [CLS] (its paper also concatenates the mean patch token) | learned table for 37 × 37 (518 px), always resized |
| DINOv2 B/14 with registers | as above, plus 4 extra learned tokens (2024 release) | 14 px, 16 × 16 at 224 | 256 + [CLS] + 4 registers | [CLS] | as above |
| MAE ViT-B/16 | images alone, reconstruct 75% hidden patches (Meta, 2021) | 16 px, 14 × 14 at 224 | 196 + [CLS] | mean of patch tokens (or [CLS]) | fixed 2-D sine-cosine, not learned |
Shapes, accuracies and cosines are properties of the released weights and transfer to any hardware up to float rounding; no timing here is meant to transfer. The papers have their own pages: ViT and CLIP. Repos and revisions: openai/clip-vit-base-patch32 @ 3d74acf, google/siglip2-base-patch16-224 @ 75de2d5 (the root's loaders), facebook/dinov2-base @ f9e44c8, facebook/dinov2-with-registers-base @ a1d738c, facebook/vit-mae-base @ 25b184b (Apache 2.0, Hub API 2026-10-17). Parameters counted from the loaded modules: DINOv2 B 86,580,480 measured. MAE's position table is built by build_2d_sinusoidal_position_embedding and frozen (transformers v5.20.1, models/vit_mae/modeling_vit_mae.py:273); the MAE paper: "the sine-cosine version" (He et al. 2021, appendix A.1).
Measured numbers come from this page and the root's vision recordings (root src/vision/out; Apple M1 Pro CPU, float32, 2026-10-17); published ones are quoted from the paper that states them; derived ones show their formula. The test set is Fashion-MNIST, the topic's running example (grey 28-pixel clothing upscaled to 224, so it measures transfer), plus the root's 16 colour test images with captions.
A 224 × 224 colour image is 150,528 numbers; as one token per pixel it would be 50,176 tokens and about 2.5 billion attention scores per head per layer derived: 224² = 50,176; 50,176². The vision transformer (ViT, Dosovitskiy et al. 2020, "An Image is Worth 16x16 Words") groups pixels into square patches instead. Fig. 2 steps through it on a real image; switch the patch size to see the three grids used on this page.
Patch size
Token colours are illustrative; shapes and counts are the models' own (configs and the loaded modules) measured.
The patch embedding is one matrix. Libraries write it as a 2-D convolution with kernel and stride equal to the patch size, which is the same arithmetic: cutting with unfold and multiplying by the convolution's weights reshaped into a matrix differs from the model's convolution by 0.0 for CLIP and 6.9e-06 for SigLIP 2 measured. Nothing convolutional happens across patches, so unlike a CNN the ViT must learn locality from data, which is why it beat 2020's best CNNs only after pre-training on hundreds of millions of images (ViT page).
A convolutional network (CNN) slides small filters (3 × 3 pixels, say) over the image, so each layer only mixes neighbours and the same filter is used everywhere. Those two built-in assumptions (nearby pixels belong together; a pattern means the same thing anywhere) are its inductive bias: that inductive bias makes it learn from little data and limits what one layer sees; a stack of L such layers (stride 1) sees a window of only 2L + 1 pixels derived, so real CNNs downsample to see further. A ViT block lets every patch attend to every other from the first layer. From scratch, a CNN’s inductive bias wins on small data; in practice you start from a pretrained encoder of either kind, and pretrained ViTs (CLIP, SigLIP, DINOv2) are the default backbones for VLMs (section 6).
The patch-embedding check (root's src/vision/analyse.py) cuts the root's images into patches with unfold, multiplies by the convolution's own weights reshaped into a matrix, and compares with the model's convolution: CLIP's is a 768 × 3,072 matrix, no bias, 2,359,296 parameters (difference 0.0); SigLIP 2's is 768 × 768 plus a bias, 590,592 parameters (6.9e-06, float32 rounding) measured.
Pooling in transformers v5.20.1: CLIP takes pooled_output = last_hidden_state[:, 0, :] (models/clip/modeling_clip.py:641), applies a LayerNorm, then visual_projection (:941) into the space shared with text. SigLIP's head is SiglipMultiheadAttentionPoolingHead (models/siglip/modeling_siglip.py:622), a learned query self.probe that attends once over all patch tokens, then an MLP. LLaVA-1.5 drops the [CLS] token with selected_image_feature[:, 1:] (models/llava/modeling_llava.py:166-168). MAE's [CLS] is "an auxiliary dummy token" and its paper says MAE "works similarly well without this token (with average pooling)" (He et al. 2021, appendix A.1); DINOv2's own linear evaluation concatenates [CLS] and the mean.
Fine detail (small text, thin lines, many small objects) needs more pixels per object, and every extra patch is another token every block must process. An R × R image in P × P patches gives N = (R / P)² tokens. Each block then does four D × D projections per token (queries, keys, values, output), two N × N products for attention (scores, then the weighted sum), and two MLP matrices of D × F per token:
Only the 2N²D term grows with the square of the token count, and at 224 pixels it is small: 4% of a ViT-B/16 and 23% of DINOv2 B/14 at its 518-pixel training size derived. Most of the cost is linear in tokens, so token count is the number to watch; quadratic attention dominates only at thousands of tokens, which is why high-resolution VLM encoders use windowed attention. The Tokens and cost tab computes the split for any configuration.
The formula agrees exactly with PyTorch's FLOP counter (torch.utils.flop_counter.FlopCounterMode) on transformers models built from the configs, but only when attention runs as plain matrix multiplies: with PyTorch's fused attention kernel (scaled_dot_product_attention, the default) the counter silently skips the 2N²D term measured, so a counted ViT-B/16 comes out at 16.85 GMACs instead of 17.56, and DINOv2 B/14 at 518 at 117.0 instead of 151.6. Published counts disagree for the same reason: the timm model card for ViT-B/16 at 224 says 16.9 GMACs, which matches the count without attention scores (16.85; with them, 17.56); the card for DINOv2 B/14 at 518 says 151.7, which matches the count with them (151.57; without, 116.98) derived. Two cards from one library, two accountings: state whether the N² terms are in.
Search and classification want one vector per image (the stepper's last step shows the three ways):
A vision-language model (VLM) pools nothing: it passes every patch token, usually from the second-to-last block (LLaVA-1.5's config says "vision_feature_layer": -2), to the language model.
ViTMAEModel always draws a random patch shuffle, even with mask_ratio=0: on one test image only 3 of 196 patches stayed in place and patch 0's output had cosine 0.26 with the unshuffled run, while the mean over patches was identical (1.000000) measured. Pooled features are fine; per-patch maps are scrambled. Pass noise=torch.arange(L) (or use ids_restore) to keep the order; src/runs/mae_shuffle.py.Attention is permutation-invariant: without positions the model sees a bag of patches. A learned position table has one row per grid slot of the training resolution. CLIP B/32 has 49 rows for its 7 × 7 grid; give it a 336-pixel image (10 × 10 = 100 patches) and there are no rows for the extra slots. Both libraries refuse, with these exact errors measured:
CLIP ViT-B/32, 336 x 336 input: ValueError: Input image size (336*336) doesn't match model (224*224). SigLIP 2 B/16, 336 x 336 input: RuntimeError: The size of tensor a (441) must match the size of tensor b (196) at non-singleton dimension 1
Pass interpolate_pos_encoding=True and transformers reshapes the table into its 2-D grid, resizes it bicubically to the new grid and flattens it back (interpolate_pos_encoding, models/clip/modeling_clip.py:161, mode="bicubic" at :194; the same code in SigLIP at modeling_siglip.py:137 and DINOv2 at modeling_dinov2.py:87). Fig. 3 steps through it on CLIP's real table.
Slot
interpolate_pos_encoding reshapes the 49 vectors into a 7 × 7 × 768 grid and resizes it bicubically to 14 × 14: the columns grow from the old grid's values, each copied over a 2 × 2 block, to the model's own resized table. Every new vector is a smooth blend of its trained neighbours.Heights: cosine similarity of the chosen slot's position vector to every slot's, from the released table (224) and from the model's own bicubic resize (448) measured; the image is test image p01 at the model's input size.
The cost. It runs, on positions the network never trained on. On the 16 colour test images, CLIP's image embedding at 448 pixels keeps a cosine of only 0.91 on average (as low as 0.76) with the same image at 224; SigLIP 2's keeps 0.94. Caption matching did not change on these easy pairs (CLIP still 15 of 16, SigLIP 2 still 16 of 16) measured. The published fix is to train briefly at the new size, as SigLIP 2 did for its fixed-resolution checkpoints (resumed at 95% of training with the table resized, Tschannen et al. 2025, §2.4.1) published.
Designs that avoid the table. MAE's fixed sine-cosine table can be computed for any grid. FlexiViT randomises the patch size during training so one set of weights works "across a wide range of patch sizes" (Beyer et al. 2022). NaViT packs several images of different sizes and aspect ratios into one sequence and trains on "inputs of arbitrary resolutions and aspect ratios" (Dehghani et al. 2023); SigLIP 2's NaFlex variant combines the two, resizing each image so both sides are multiples of the patch size with the aspect ratio kept as closely as possible within a token budget (256 by default). 2-D RoPE (rotary position embedding along rows and columns, Positional encodings) puts position into the attention product instead of a table, so any grid works: Qwen2.5-VL's encoder uses it (Qwen2.5-VL report, §2.1.1), and DINOv3 replaced DINOv2's learnable table with RoPE (DINOv3, Table 2).
What the processor does to a real image decides both what the encoder sees and how many tokens it costs. Type a size and compare the four rules (the last two ported line by line from transformers v5.20.1: models/siglip2/image_processing_siglip2.py:42 get_image_size_for_max_num_patches; models/qwen2_vl/image_processing_qwen2_vl.py:63 smart_resize, used by Qwen2.5-VL with min_pixels 3,136 and max_pixels 12,845,056 from its preprocessor_config.json):
Drawn to scale: the original (grey outline) and what each rule feeds the encoder derived. A 1920 × 1080 frame loses 44% of its area to CLIP's crop; SigLIP 2's fixed processor distorts its aspect by 78%; Qwen2.5-VL rounds to multiples of 28 and merges each 2 × 2 group of 14-pixel patches into one language-model token. Normalisation constants differ too (CLIP's ImageNet-like mean and standard deviation, SigLIP's 0.5 and 0.5).
Large ViTs learn to dump global information into a few patch tokens in uninformative background areas. Darcet et al. (2023) found these "tokens with roughly 10x higher norm at the output", "around 2%" of the sequence, holding "less information about their original position in the image or the original pixels in their patch" published. They spoil attention maps and dense features. The fix: append a few learned register tokens that carry no image content, so the model has somewhere else to compute; "one register is sufficient to remove artefacts", and they kept 4.
In DINOv2 the outliers "appear with models larger than and including ViT-Large", and after a third of training. They are not specific to DINOv2: the label-trained DeiT-III B and the caption-trained OpenCLIP ViT-B/16 the authors trained also had outliers, and registers removed them in all three (their Fig. 7). With registers, their DINOv2 ViT-L (ImageNet-22k) rose in linear ADE20K segmentation from 46.6 to 47.9 mIoU and on ImageNet from 84.3% to 84.8% (their Table 2a) published. So the paper's ViT-Large threshold is about DINOv2; a base-size caption-trained model having outliers (below) fits it.
Image
Registers and [CLS] are not part of the grid; one height scale for every step measured.
What it shows measured. In SigLIP 2 B/16 the same three grid slots stand out in all 16 images, wherever the object is: row 0 column 13 at 15 to 23 times the median patch norm, row 3 column 13 at 11 to 13 times and row 0 column 1 at about 4 times (a fourth, row 0 column 11, joins them in the five flat synthetic images): three bright fixed slots in every image. Two of them, (0, 1) and (3, 13), are among the four slots where SigLIP 2's attention-pooling head puts 30 to 45% of its weight: the pooled vector reads from the outliers. DINOv2 B has milder ones (up to 4.7 times the median) in 8 of the 16 images, at varying places; DINOv2 B with registers, CLIP B/32 and MAE B have none (at most 1.5 times). Look at token norms before building dense features on a model, and prefer a registers variant where one exists.
There are hundreds of millions of image-caption pairs on the web and no labels saying how similar any two are. Contrastive training uses the pairing itself as the label: in a batch of N pairs, each image's own caption is the positive and the other N − 1 captions are negatives. Two towers (a ViT for images, a transformer for text) each end in a vector scaled to length 1, so their dot product is the cosine similarity.
A real batch. The root's 16 colour test images against their 16 captions: through CLIP B/32 the matching pairs average a cosine of 0.333 and the other pairs 0.166; it puts the right caption first for 15 of 16 images (its miss is the typographic image s04, section 6). SigLIP 2 gets all 16, after its text is lowercased as its reference code does; its cosines average 0.194 and −0.019 measured. Cosines that small still make a confident choice because each is multiplied by a learned scale t (the inverse of the temperature) before the softmax: CLIP's released B/32 sits at t = 100.0, so a gap of 0.05 in cosine becomes a factor of e5 ≈ 150 in probability.
Try it. The widget evaluates both losses on the same real matrix for any batch size and scale: the softmax view shows how CLIP's loss depends on t, the sigmoid view each cell on its own.
CLIP's t = 100.0 is exactly where its paper clipped the scale; SigLIP 2 learned t = 112.67 with b = −16.77 read from the weights in float32. Because SigLIP's logits carry a bias they are calibrated per pair (a sigmoid gives a yes-or-no probability); CLIP's are calibrated only relative to the other candidates.
In transformers 5.20.1: CLIP's contrastive_loss is a cross-entropy against torch.arange(len(logits)) (models/clip/modeling_clip.py:47), applied to the logits and their transpose and averaged; SigLIP's logits are logits_per_text * logit_scale.exp() + logit_bias (models/siglip/modeling_siglip.py:805) and the loss is logsigmoid(m1_diag1 * logits_per_text) summed over each row and averaged (:814). CLIP's scale started at 1 / 0.07 and was clipped at 100 (CLIP paper §2.5); the released B/32 sits exactly at that clip, and SigLIP 2 learned t = 112.67 with b = −16.77 read from the weights in float32. A sigmoid of 100 × cosine is near 1 for every CLIP pair, so applying one model's rule to the other's logits is meaningless.
Left: first N images (rows) against first N captions (columns), each cell's probability under the chosen loss, diagonal outlined. Right: the loss at every scale, the dot at the current one. Real cosines from the root's vision recordings measured. Sigmoid bias: SigLIP 2's learned −16.77, or SigLIP's initial −10 for CLIP (illustrative).
The softmax learns only from the negatives in the batch, and its chance level ln N grows with it: CLIP's batch of 32,768 asked each image to pick 1 caption out of 32,768 (CLIP page), and hard negatives (two cats, two similar captions) only show up in large batches. Split over D devices, the softmax normalises each row and column over the whole batch, so every device needs every other device's embeddings (an all-gather). The sigmoid scores each cell alone, so SigLIP's "chunked" implementation keeps each device's images in place and passes text embeddings round the devices in D steps: "the memory cost at any given moment is reduced from |B|2 to b2", with b = |B| / D (SigLIP §3.3).
What the paper measured published: with locked image features (SigLiT), "when the batch size is smaller than 16 k, sigmoid loss outperforms softmax loss by a large margin", but "performance for both sigmoid and softmax saturate at around 32 k batch size" (they went up to one million), and for SigLIP proper "a very large batch size hurts both losses" (§4.1, Figure 2). With four TPUv4 chips a SigLiT model reached 84.5% ImageNet zero-shot in two days. So the sigmoid buys cost and small-batch quality, not a higher ceiling.
Not run here: training either loss at scale. The widget evaluates both losses on released embeddings, and each model was trained with its own rule, so a loss computed with the other rule says nothing about how that model would have trained. "D collective permutes is typically faster than two all-gathers" (SigLIP §3.3). A toy CLIP trained from scratch, with softmax against sigmoid on a toy batch, is on the CLIP page; InfoNCE on a real text batch and the temperature's effect on hard negatives are on Contrastive and self-supervised learning.
Drawn for D = 4 devices. Numbers for a global batch |B| = 32,768 on D = 256 (b = 128 per device), float32 logits: the full matrix is 4.3 GB; one device's rows b × |B| are 16.8 MB; one chunk b × b is 65.5 kB derived from SigLIP §3.3.
CLIP chose the contrastive loss for efficiency (it learned ImageNet-recognisable features 4 times faster than predicting the caption's bag of words, CLIP Figure 2), but almost every gain since 2021 came with a new dataset rather than a new loss. At fixed compute, curation moved accuracy by several points: MetaCLIP's ViT-B/32 goes from 57.4% on raw English pairs to 65.5% with its metadata balancing, and DataComp's best filter adds 6.9 points over its unfiltered pool published.
| Dataset | Size | How it was chosen | What the paper reports |
|---|---|---|---|
| WIT (CLIP) | 400M pairs | text must contain one of "500,000 queries", with "up to 20,000 (image, text) pairs per query" (not released; quoted by MetaCLIP) | best model 76.2% ImageNet zero-shot (CLIP page) |
| ALIGN | 1.8B pairs | raw alt-text with "only minimal frequency-based filtering", trading "quality for scale" | scale compensates for noise (Jia et al. 2021) |
| LAION-5B | 5.85B pairs | Common Crawl pairs kept if OpenAI CLIP ViT-B/32 cosine ≥ 0.28 (English) or ≥ 0.26 (other languages); "removed around 90% of the original 50 billion images" | open reproductions of CLIP (Schuhmann et al. 2022, §3.1) |
| DataComp | 12.8B candidates | a benchmark for filters: fixed training, vary only the data; best baseline keeps the intersection of a CLIP-score filter (top 30% by a ViT-L/14) and an image-based filter, 1.4B pairs | best filter +6.9 points ImageNet over the unfiltered pool; DataComp-1B trains a ViT-L/14 to 79.2%, "outperforming OpenAI's CLIP ViT-L/14 by 3.7 percentage points" at equal compute (Gadre et al. 2023) |
| MetaCLIP | 400M (also 2.5B) | reconstructs that recipe in the open: 500k metadata entries (WordNet synsets, Wikipedia words and titles), substring matching, then caps each entry at 20k pairs so rare concepts are not drowned | ViT-B/32 at fixed steps: raw English 57.4%, curated without balance 60.8%, balanced 65.5%, against WIT 63.4% and LAION-400M 60.0% (Xu et al. 2023, Fig. 1) |
| WebLI (SigLIP 2) | 10B images, 12B alt-texts, 109 languages | 90% English mix; the base models then distilled from a bigger teacher with "active data curation" (picking the most useful examples online) | SigLIP 2 B/16 at 224: 78.2% ImageNet zero-shot against CLIP B/16's 68.3% (Tschannen et al. 2025, §2.1, Table 1) |
All rows are published by the dataset's authors published; ImageNet accuracies are zero-shot top-1 on the validation set, read from each paper's own text or table on 2026-10-17.
LAION's CLIP-score filter, on the running example. LAION used OpenAI's CLIP ViT-B/32, the very model run here, so its rule can be applied to the real 16 × 16 matrix. Move the threshold.
At 0.28 all 16 true pairs pass and 1 of the 240 wrong pairs passes too measured: good captions of simple images score only about 0.28 to 0.38, and the typographic image s04 (0.284) barely survives. A filter built from one model passes that model's blind spots into the next model's data; LAION's authors note that a small CLIP "may leave more image-text pairs with weak or no semantic connection" (§3.1).
Dots: the 16 true pairs (top row) and the 240 mismatched image-caption pairs (bottom row), CLIP ViT-B/32 cosines measured; the line is the threshold.
SigLIP 2 keeps the sigmoid loss and adds a caption decoder that reads the un-pooled patch tokens, then, for the last 20% of training, self-distillation and masked prediction "to improve the local semantics of the (un-pooled) feature representation" (§2.2, 2.3): its patch tokens become much better for dense tasks, ADE20K linear segmentation rising from 37.6 (SigLIP So/14, 224) to 41.8 mIoU (its Table 2) published.
Contrastive training does not have to start from scratch. LiT (locked-image tuning) freezes a pre-trained image model and trains only a text tower to read it, and found "locked pre-trained image models with unlocked text models work best"; with a ViT-g/14 image tower it reached 85.2% ImageNet zero-shot (Zhai et al. 2021) published. SigLIP's 84.5% in two days is a LiT-style run. SigLIP 2's caption decoder comes from LocCa.
Labels, the original recipe (ImageNet-21k, Google's private JFT-300M), teach only the distinctions their 1,000 or 21,000 classes ask for, and labels are expensive; captions and self-supervision both remove the labeller.
DeiT showed the ViT's data requirement was partly a recipe problem: "competitive convolution-free transformers by training on Imagenet only", 83.1% top-1 for an 86M model with a distillation token that learns from a CNN teacher, "on a single computer in less than 3 days" (Touvron et al. 2020) published.
Images alone. How the methods work (with MAE's real reconstructions and the collapse problem) is on Contrastive and self-supervised learning. In one line each: MAE hides 75% of the patches and trains the encoder plus a small decoder to redraw the missing pixels; DINO trains a student network so that its output for one crop matches a slowly averaged teacher copy's output for another crop, and DINOv2 adds a masked-patch version of the same loss (iBOT) that is applied to every patch token (both are drawn in Fig. 1, steps 5 and 6). As encoders they differ like this:
DINOv3 (2025) scaled the recipe to a 6.7B-parameter ViT-7B and added Gram anchoring to stop dense features degrading in long training; its weights are under Meta's own licence, so it is not run here.
DINOv3 scaled it again. A 6.7B-parameter ViT-7B with patch 16, RoPE and 4 registers, trained on LVD-1689M (1,689 million curated images), with a new Gram anchoring loss that fixes "the known yet unsolved issue of dense feature maps degrading during long training schedules" by keeping the patch-to-patch similarity matrix close to that of an earlier checkpoint (Siméoni et al. 2025, §3 to 4, Table 2) published. Its weights are gated under Meta's own DINOv3 licence, so it is not run here (DINOv2 is Apache 2.0).
An encoder is used in one of four ways: its pooled vector for classification and search (global features), its per-patch tokens for segmentation, depth or matching (dense features), its text tower for zero-shot work (text), or all its patch tokens as the eyes of a VLM (backbone). Each training signal favours some of these.
A linear probe trains only a linear classifier on frozen features (the settings and random draws of the root's zero-shot study); kNN labels each test image by a vote of its 20 most similar labelled images (DINO's weighted protocol); image-to-image search asks whether a query's nearest neighbours share its class. A probe can rescale and rotate the features; kNN and search take the geometry as it is.
What it shows measured. SigLIP 2 and DINOv2 tie at the top with 500 labels per class (89.3% and 89.3% for DINOv2's [CLS] plus mean), CLIP B/32 is about a point and a half lower (87.8%), MAE lowest. With few labels SigLIP 2 leads (84.0% at 16 per class, DINOv2 82.6%, CLIP 79.0%). Differences under a point are not a ranking (one dataset, one resolution, one seed). With enough in-domain labels a small specialised model still wins: the root's 550,890-parameter CNN trained from scratch on all 55,000 training images reaches 92.98%; an encoder's value is needing few or no labels. Every score is in Encoder comparison; the searches in Retrieval.
measured Every encoder peaks before its last block (CLIP at block 8, SigLIP 2 at 10, DINOv2 at 10, MAE at 9), by 0.4 to 1.1 points, and the pooled output is lower still (CLIP 85.4%, SigLIP 2 87.4%, DINOv2 87.6%, MAE 85.4%): the last layers specialise for the training objective. Meta's Perception Encoder paper finds the same at scale, contrastive training's best embeddings "are hidden within the intermediate layers of the network" (Bolya et al. 2025) published; it is why LLaVA reads the second-to-last block. Try a few layers rather than one: the curves are noisy (DINOv2 and MAE dip at block 3).
Block 0 (the patch embedding plus positions): CLIP's already probes at 55.2%, DINOv2's at 31.9%, SigLIP 2's at 20.3% and MAE's at 14.4%, because in SigLIP 2 and MAE the position vectors dominate the first tokens (the dense-feature stepper below shows SigLIP 2's block-0 map as a smooth position gradient) measured. Contrastive training "can produce strong, general embeddings", in Perception Encoder's words, but not at the output.
Linear probe on each block's mean patch token: trained on 200 validation images per class, tested on the first 500 test images per class (5,000); CPU float32 measured. Script src/runs/layerwise.py.
Real tokens from the released models on the root's colour test images (CC0, public-domain and SD 1.5 outputs), CPU float32 measured; components computed per image and block without high-norm outlier tokens, signs aligned between blocks. The Encoder comparison tab adds DINOv2 with registers, token norms, [CLS] attention and a click-a-patch similarity view. Script src/runs/dense.py.
Segmentation, depth and matching need a good vector at every patch. Nothing in a contrastive loss asks for that: only the pooled vector is compared with text. Self-distillation with masked patches (DINOv2's iBOT term) does. To see it, take one block's patch tokens, find their three main directions of variation (principal components) and paint each patch with its three coordinates as red, green and blue: patches with similar vectors get similar colours.
Published, at scale. With a linear layer on frozen patch tokens, ADE20K semantic segmentation (150 classes) reaches 47.3 mIoU for DINOv2 B/14, 39.3 for OpenCLIP ViT-G/14 and 33.3 for MAE ViT-H/14 (DINOv2 Table 10); SigLIP 2's extra losses lift a caption-trained encoder to 41.8 (section 4) published. Dense quality is where self-supervised encoders still lead.
A contrastive embedding keeps whatever helps pick the right caption out of a batch. Web captions name objects and often repeat the text in the picture; they rarely state counts, left and right, or which attribute goes with which object. So the embedding is strong on "what is it" and "what does it say", weak on structure, partly a bag of words (Yuksekgonul et al. 2022). OpenAI called the first failure a typographic attack, needing "no more technology than pen and paper" (OpenAI, March 2021, archived).
What it shows measured. CLIP B/32 flips from cat to the written word for DOG (cosine 0.2855 for dog against 0.2775 for cat) and for BIRD (0.2837 against 0.2659), whether the DOG sticker is small or large; it resists CAR, narrowly (cat 0.2890, car 0.2827). The CAT sticker raises CLIP’s cat score (0.2926 against 0.2846 plain): the written word adds to the image’s meaning in the same direction as the object. SigLIP 2 never flips, but the sticker still moves it: "dog" rises from 0.0684 to 0.1112 with the DOG sticker while "cat" stays near 0.13. Both models read text; SigLIP 2's image of the cat is strong enough to win.
Images: the scikit-image cat photo (CC0) with a white label drawn by the root's src/vision/make_probes.py. Bars: cosine of each image with "a photo of a cat / dog / bird / car"; the winner of each image is bold measured.
| Minimal pair | CLIP B/32 | SigLIP 2 B/16 |
|---|---|---|
Counting: 1 to 6 red circles![]() ![]() ![]() ![]() ![]() ![]() | 3 of 6 right (one, three, six); two is called "three", four and five "six"; margins 0.001 to 0.008 in cosine | 4 of 6 (one to three, and six); four is called "five", five "six"; margins 0.02 to 0.03 on the small counts |
Left and right: a scene and its mirror image![]() ![]() | the same sentence for both, so right once by construction: a coin toss, margins of a few thousandths | the same |
Binding: red circle and blue square, colours swapped![]() ![]() | both wrong | the same sentence for both |
Synthetic probes from the root's make_probes.py, cosines from the released models measured; six probes are a hint, not an accuracy. Larger sets of such minimal pairs (Winoground, ARO, SugarCrepe) found the same for many CLIP-like models.
To check a model: build minimal pairs like these and see whether the score moves the right way, and by more than a few thousandths. The fix is rarely a better prompt: it is training data with hard negatives (captions with swapped words), a VLM that reads the image tokens with a language model, or both.
A VLM maps an encoder's patch tokens into the language model with a small projector (the Vision-language models page owns how). Contrastive encoders (CLIP, then SigLIP) won this role because their patch tokens already line up with language; DINO-style features carry more spatial detail but no link to words. Qwen2.5-VL shows the other route: train the encoder inside the VLM at native resolution, with windowed attention.
| VLM | Vision encoder | Which tokens | Tokens per image |
|---|---|---|---|
| LLaVA-1.5 | CLIP ViT-L/14 at 336 (contrastive) | second-to-last block, [CLS] dropped (config vision_feature_layer -2) | 576 = (336/14)² derived |
| PaliGemma | SigLIP So400m/14 (sigmoid contrastive) | all patch tokens through a "(zero initialized) linear projection" (Beyer et al. 2024, §3.1) | 256 at 224 px derived |
| SmolVLM-500M | SigLIP B/16 at 512 per tile (93M) | last block, pixel shuffle by 4 (16 patches into one token) | 64 per tile; 1,088 for a 512 × 512 image split into 17 views (root VLM lab recordings; tiling: Vision-language models) measured |
| Qwen2.5-VL | its own ViT, trained from scratch: 32 blocks, width 1,280, patch 14, 2-D RoPE, RMSNorm, SwiGLU | windowed attention (112 × 112 px windows) in all but 4 blocks; 2 × 2 patches merged per token | native resolution: (H/28) × (W/28), up to 16,384 |
Configs: llava-hf/llava-1.5-7b-hf @ b234b80, HuggingFaceTB/SmolVLM-500M-Instruct @ a7da5b9 (scale_factor 4), Qwen/Qwen2.5-VL-3B-Instruct @ 6628554 (depth 32, window_size 112, fullatt_block_indexes [7, 15, 23, 31], spatial_merge_size 2; max_pixels 12,845,056 = 16,384 × 28²). Qwen2.5-VL's report: "only four layers employ full self-attention, while the remaining layers utilize windowed attention with a maximum window size of 112×112" (§2.1.1). The SmolVLM token count was measured with its processor in the root's VLM runs.
Zero-shot classification is what a text tower buys: embed one sentence per class ("a photo of a sneaker.") and pick the class whose sentence is nearest to the image; the ten text vectors are the classifier's weights. On Fashion-MNIST CLIP B/32 lands between 61.3% and 66.7% over ten prompt sets and SigLIP 2 B/16 between 20.0% and 74.5%, and a linear probe with 16 labels per class beats every prompt set for both (79.0% and 84.0%) measured (root Zero-shot lab). SigLIP 2's 20% is a preprocessing bug: its reference code lowercases text and the transformers processor alone does not; with one template it scores 22.3% on the class names as written ("T-shirt/top", "Trouser") and 70.2% lowercased.
CLIP's tokenizer lowercases on its own, so code written for CLIP silently passes capitals to SigLIP 2. SigLIP was also trained on text padded to a fixed 64 tokens (padding="max_length", max_length=64 in the processor call); padding to the longest in the batch, as CLIP code does, changes its text embeddings. The root's loaders and this page pass both explicitly.
Each protocol answers a different question, and each has a setting that can move the result by more than the gap between two models:
| Protocol | Question it answers | What moves it | Here |
|---|---|---|---|
| Zero-shot classification | can text alone name the classes? | prompt wording, case, templates, ensembling (5 to 50 points) | CLIP 61.3 to 66.7%, SigLIP 2 20.0 to 74.5% across prompt sets measured |
| Linear probe | is the class information linearly readable? | feature scaling, regularisation, labels per class, which layer | unscaled features underfit by 5 to 8 points (root zero-shot study); the best CLIP block beats its output (section 6) |
| kNN | is the geometry itself right, with no training? | k, temperature, normalisation | MAE's mean vector is lowest on kNN and search (section 6) |
| Retrieval recall@K or precision@K | does the right item come first? | gallery size, what counts as relevant, duplicates | Retrieval tab |
| Dense probes | are patch tokens useful per location? | input resolution, head (linear or decoder), multi-scale | published only (ADE20K needs its own data) |
| Inside a VLM | does the VLM answer better with it? | projector, LLM, training data, token count; confounded by all of them | the VLM page; VLM benchmarks on Long-context and multimodal benchmarks |
Check the resolution (a "B/16" at 384 sees 2.9 times the tokens of one at 224), whether numbers are zero-shot, probe or fine-tuned (MAE ViT-B: 68.0% linear, 83.6% fine-tuned), whether the probe ran on the [CLS], the mean or several layers, and who ran it (DINOv2's Table 4 re-ran every baseline "with our code", which is why its CLIP ViT-L/14 linear score is its own measurement, not OpenAI's). And check what the training data could have seen: DFN, the closest rival in SigLIP 2's table, "uses a network fine-tuned on ImageNet, COCO, and Flickr (i.e. the main benchmarks in Table 1) as a filter" (SigLIP 2, §3.1) published. Cosines are not comparable across models either: CLIP's matching pairs sit near 0.3, SigLIP 2's near 0.2, so any threshold is per model.
| You need | Start with | Why, and the check |
|---|---|---|
| Search by text, zero-shot labels, filtering a dataset | a caption-trained encoder (SigLIP 2, or an OpenCLIP / MetaCLIP model) | only these have a text tower; check the processor (case, padding, crop) and calibrate any threshold per model |
| Image-to-image search, near duplicates, few-shot classification | DINOv2 or SigLIP 2, frozen, with kNN or a linear probe | both lead on the running example; measure precision@K on your own images with your own relevance |
| Segmentation, depth, correspondence, tracking | DINOv2 (with registers) or DINOv3 if its licence fits | best published frozen dense features; check token norms and patch-similarity maps for artefacts |
| A VLM backbone | SigLIP or SigLIP 2 (So400m), NaFlex if documents or odd aspect ratios matter | language-aligned patch tokens; count tokens per image first (Tokens and cost tab) |
| Fine-tuning on a large labelled task | any of them; MAE initialisation is strong when the whole network is trained | frozen-feature scores do not predict fine-tuned scores well (MAE §4.3) |
src/runs/ and src/out/ in this page's folder (embed_ssl.py, dense.py, probes.py, layerwise.py, resolution.py, flops.py, textq.py, mae_shuffle.py; make_data.py and make_lab_data.py build the page data; fill_prose.py writes the numbers into the text). The contrastive-loss and minimal-pair data come from the root's Vision lab recordings (src/vision/out/ in the root folder). Published numbers transcribed in src/inputs/published.json; model configs in src/inputs/configs/.The same images through five released encoders, on the CPU of an Apple M1 Pro (float32) on 2026-10-17 measured. Pick an image, a block and a view. Click any map to choose a patch: the "similar patches" view then shows, in every encoder, how similar each patch is to the patch at that place. What the views mean is explained in sections 3 and 6 of the Reading tab.
Fashion-MNIST, the topic's running example: train on the 5,000 validation images (or k per class of them), test on all 10,000 test images. Click a column to sort. The DINOv2 paper's own frozen-feature ImageNet numbers are beside them for scale; they are a different dataset and resolution, and are not comparable cell by cell.
Top-1 accuracy, ImageNet-1k validation, frozen backbone; kNN and linear as reported by Oquab et al. 2023, Table 4, all evaluated with the DINOv2 authors' code published. Two CLIP ViT-L/14 rows appear there (the second at 336 pixels, marked in the table); both are shown.
Retrieval is ranking a collection (the gallery) by similarity to a query: embed everything once, then sort by cosine. Here the gallery is 1,000 Fashion-MNIST test images (the first 100 of each class) and the vectors are the ones saved for the Encoder comparison tab. A green outline means the result has the class the query asks for (or the query image's class); red means it does not. Everything is precomputed from the released models measured; the page only looks results up.
Only an encoder trained with captions has a text tower, so DINOv2 and MAE cannot take a sentence. Try the descriptive queries: some name things the 28-pixel grey images cannot show ("a red dress", "a striped t-shirt"), and "a cat" names nothing in the gallery, yet search always returns eight images. The last three options keep SigLIP 2's capitals (the case trap, Reading section 7).
Pick a query image, or click any result to search with it. Each row is one encoder's 8 nearest gallery images; the number under each is its cosine to the query.
With class labels as relevance (any image of the query's class counts), the scores are precision@K (share of the top K that are relevant) and mean average precision (mAP, which rewards putting all relevant items early). Image-text benchmarks such as COCO and Flickr30k instead pair each image with its own captions, and report recall@K: the share of queries whose one correct partner is among the top K. On the 16 colour test images and their captions (the matrix of Reading section 4), CLIP B/32 has image-to-text recall@1 of 15 of 16 and text-to-image 16 of 16 measured. On all 10,000 Fashion-MNIST test images:
Published paired recall@1 at the same size (ViT-B/16, 224 pixels), from the SigLIP 2 paper's Table 1 published:
COCO and Flickr30k are captioned photo collections; T→I means a caption retrieves its image, I→T the reverse. Tschannen et al. 2025, Table 1, read 2026-10-17. Not run here: the benchmark images are not part of the running example.
What one image costs a vision transformer, from its configuration, with the formula from section 1 of the Reading tab: patch embedding, the four projections, the attention scores (the only part that grows with the square of the token count) and the MLP. Presets are read from each model's config.json (revisions in src/inputs/configs/REVISIONS.txt).
The curve: GMACs per image against input side for the current shape (log scale), with the attention-score share. MACs are multiply-accumulates (FLOPs ≈ 2 × MACs); norms, softmax, activations and biases are left out. derived
How a processor resizes a real, non-square image (CLIP's crop, SigLIP 2's squash, NaFlex, Qwen2.5-VL) is in Reading section 2.
Five encoders on the same images: principal-component maps by block, token norms, [CLS] attention, click-a-patch similarity; every frozen-feature score. 3 min to read, plus the controls
Text-to-image and image-to-image search over 1,000 Fashion-MNIST test images, four encoders side by side. 3 min to read, plus the controls
Tokens and multiply-accumulates from any ViT configuration, reproducing two published counts. 1 min to read, plus the controls
The root: how vision encoders fit next to generators and VLMs. Its Zero-shot lab tab holds the zero-shot prompt study (every prompt set, confusion matrices) and the CPU timings; the contrastive loss, the minimal-pair probes and the patch embedding its vision runs also measured are taught on this page.
Projectors, tiling, the encoder inside a VLM. about 33 min
Image tokenizers, the other way to turn images into tokens. about 40 min
Models that read and generate images with one transformer. about 37 min
FID, CMMD and FD-DINOv2 use these encoders as feature extractors. about 27 min
The paper page: a toy ViT trained live, ViT against a ResNet, the data-scale experiment and the paper's tables. about 23 min
A toy CLIP, softmax against sigmoid on a toy batch, zero-shot against few-shot, the tables rebuilt. about 27 min
InfoNCE, collapse and its defences (BYOL, DINO, VICReg), MAE's real reconstructions and I-JEPA. about 31 min
The text-side counterpart: how retrieval embeddings are trained and judged. about 30 min
Page-image retrieval for documents, where vision encoders meet RAG. about 28 min
How VLMs, and through them their encoders, are scored. about 27 min
The rotary embedding that 2-D RoPE in Qwen2.5-VL's encoder and DINOv3 extends to rows and columns. about 22 min
Curated LVD-142M, self-distillation plus iBOT, distillation into small models; Tables 4 and 10 are the frozen-feature references. about 60 min
High-norm outlier tokens, where they appear, and the four-token fix. about 30 min
A 7B self-supervised ViT, Gram anchoring for dense features, distillation into a family. Long report; read sections 3 to 5. about 75 min
Sigmoid loss plus captioning, self-distillation, masked prediction, NaFlex and active data curation; Table 1 for zero-shot and retrieval. about 40 min
The pairwise sigmoid loss, chunked implementation and batch-size study. about 30 min
75% masking, encoder on visible patches, linear probing against partial fine-tuning (§4.3). about 40 min
ViTs trained on ImageNet only, with a distillation token. about 30 min
Freeze the image tower, train only the text tower. about 30 min
A benchmark where only the data varies; the filtering baselines. about 45 min
CLIP's curation rebuilt: metadata, substring matching, balancing. about 35 min
The open CLIP-filtered dataset; §3 describes the 0.28 filter. about 40 min
Scale over cleaning: 1.8B noisy pairs. about 25 min
Native aspect ratio by sequence packing; one model for many patch sizes. about 30 min each
Contrastive training's best features sit in intermediate layers; alignment tuning to bring them out. about 50 min
Two VLMs' encoder choices: a native-resolution ViT trained in the VLM, and a frozen-then-tuned SigLIP So400m. about 30 min each for the encoder sections
clip, siglip, siglip2, dinov2, dinov2_with_registers, vit_mae, qwen2_vl: every line quoted on this page. browse as needed
Reference training and evaluation code for DINOv2 and for SigLIP / SigLIP 2. browse as needed
Open CLIP training and the largest collection of released CLIP-style weights, with their benchmark results. browse as needed
Times for outside resources are estimates from their length.