#1. Why Self-Supervised? The Label Bottleneck
Supervised learning was the dominant paradigm from roughly 2012 (AlexNet on ImageNet) until 2018 (BERT). It works, but it has a fatal scaling problem.
ImageNet has 1.2M labeled images. That's about the upper limit of what a research lab can afford to label. But unlabeled images? Common Crawl alone has billions. YouTube uploads more video every day than a human could watch in a lifetime.
For roughly a decade the answer was "kinda, but worse." Then between 2018 and 2022, SSL methods caught up to supervised learning and passed it on most downstream benchmarks. The recipe settled into three steps:
- Pretrain a large model with an SSL objective on web-scale data (months on thousands of GPUs).
- Fine-tune or linear-probe for the actual downstream task (hours on one GPU).
- Optionally distill into a smaller production model.
This is how GPT works. This is how CLIP works. This is how DINOv2 works. This is how everything works now.
#The Linear Probe Protocol
A linear probe is the standard way to ask how good a pretrained representation is. You freeze the encoder, so its weights never change, compute one feature vector per labeled example, and train a single linear layer on top of those features. The steps are:
- Pretrain the encoder f with a self-supervised objective and no labels.
- Freeze f. Compute the features h = f(x) for the labeled training and test examples. In SimCLR the projection head is thrown away after pretraining, and the representation h in front of it is what gets evaluated (Chen et al., 2020).
- Train one linear layer with the ordinary classification loss, the cross-entropy from Information Theory & Entropy.
- Report the accuracy on the held-out test set.
A feature of length 2048 and 1000 classes give 2,049,000 trainable numbers in the probe, far fewer than the encoder holds. That is why a good probe score is strong evidence the encoder itself learned useful structure, and why probing is cheap enough to run after every pretraining experiment.
#2. A Taxonomy of SSL Objectives
Modern SSL splits cleanly into three families. Each defines a different "pretext task" — a problem the model solves with no human labels, in hopes that the representations it builds along the way transfer to real tasks.
#2.1 Generative / Reconstructive
- BERT (2018). Mask 15% of input tokens; predict them from context. The famous "masked language model" (MLM) objective.
- GPT (2018+). Predict the next token, autoregressively. This is also SSL! Every position is supervised by the next position; no human labels needed.
- MAE (2022). Mask 75% of image patches; reconstruct the pixels.
The Masked Language Model Loss
BERT hides 15% of the token positions and trains the model to fill them in. The loss is a cross-entropy computed at the hidden positions only.
Cross-entropy with a one-hot target is the negative log of the probability given to the true class, derived in Information Theory & Entropy. The derivation below adds what is new here: where the sum over masked positions comes from.
#2.2 Contrastive
- SimCLR (2020). Two augmentations of the same image are positive pair; all other batch items are negatives.
- MoCo (2020). Same idea, but uses a memory queue + momentum encoder for many more negatives.
- CLIP (2021). Positive pair is (image, its real caption); negatives are (image, other captions in batch).
#2.3 Non-Contrastive (Self-Distillation)
- BYOL (2020). Online network predicts target network's output; target is an EMA of online.
- SimSiam (2021). Same idea, even simpler: just stop-grad on the target branch.
- DINO (2021). Self-distillation with sharpening + centering tricks for ViT.
You're running SimCLR with batch size 32. For each anchor image, how many negative examples does the contrastive loss see?
#3. MAE: Masked Autoencoders Are Scalable Vision Learners
He et al., 2022. Possibly the single most influential vision SSL paper after CLIP.
The setup
- Split an image into non-overlapping patches (e.g., 16×16 ViT patches).
- Mask 75% of them, randomly.
- Feed only the visible 25% to a ViT encoder.
- A small ViT decoder takes (encoded visible patches + mask tokens) and predicts the raw pixels of the masked patches.
#4. SimCLR: Contrastive Learning, Stripped Down
Chen et al., 2020. The paper that re-legitimized contrastive SSL by showing it could match supervised ResNet on ImageNet linear probe — given enough batch size and compute.
The pipeline
- Take an image x. Apply two random augmentations (crop, color jitter, blur, flip) → x_i, x_j.
- Encode both with a shared ViT/ResNet → h_i, h_j.
- Project through a small MLP "projection head" → z_i, z_j.
- Compute NT-Xent loss: pull z_i and z_j together, push z_i away from all other 2N − 2 views in the batch.
2N − 2 negatives. SimCLR's strongest results used batch size 4096 or 8192 — meaning each anchor was contrasted against ~8000 negatives per step. Smaller batches give a weaker, noisier signal.Two facts about this loss are worth deriving: where the pull and push come from, and how it relates to mutual information. The second uses the mutual information defined in Information Theory & Entropy.
#5. MoCo: Contrastive Learning Without Huge Batches
He et al., 2020. Same year as SimCLR; different solution to the same problem.
SimCLR's weakness: you need batch size 4096+ to get enough negatives. That requires TPUs or a small GPU cluster. MoCo replaces the giant batch with two tricks:
- Momentum encoder. Keep two copies of the encoder: a "query" encoder (trained normally) and a "key" encoder (slowly updated as an EMA of the query). The key encoder produces stable representations of past examples.
- Queue of negatives. Maintain a FIFO queue of ~65k key embeddings from previous batches. Each anchor contrasts against the entire queue.
The result: contrastive learning with batch 256, and 65,000 negatives per step.
#6. BYOL: No Negatives, And Yet It Works
Grill et al., 2020. The result that broke the contrastive-SSL consensus.
- Online network: encoder → projector → predictor → q.
- Target network: encoder → projector → z. (No predictor. Updated as EMA of online.)
- Loss: ‖q(view_a) − stop_grad(z(view_b))‖² + symmetric term.
The loss is a squared distance in disguise, and that explains why collapse is allowed. Open the derivation for both.
Nothing in the formula rules out collapse, so something outside the formula must. For SimSiam, Chen and He report that removing the stop-gradient makes the loss reach its minimum immediately, the spread of the normalized outputs falls to zero, and ImageNet linear accuracy drops to 0.1%, against 67.7% with the stop-gradient (their section 4.1). Why the asymmetry helps is explained by hypotheses and analyses, not by a proof, so this lesson states the observed result.
BYOL has no negative pairs. What stops the network from collapsing to the trivial solution where every output is the same constant vector?
A new paper claims a non-contrastive SSL method that drops both the predictor MLP and the stop-gradient. Should you believe it works?
#7. DINO: Self-Distillation Lights Up Object Parts
Caron et al., 2021. Same family as BYOL, but with a ViT and some specific tricks that produced one of the most visually striking results in vision SSL: emergent object segmentation without any segmentation labels.
The recipe
- Two networks: student (trained) and teacher (EMA of student).
- Multi-crop: 2 large "global" crops + several small "local" crops.
- Student sees all crops; teacher sees only global crops.
- Loss: cross-entropy between student's softmax output and teacher's softmax output.
- Two tricks against collapse: centering (subtract running mean from teacher logits) and sharpening (lower teacher temperature than student).
DINOv2 (Oquab et al., 2023) scaled this to 142M images and a ViT-g/14 with 1.1B parameters. The features it produces are now used as a frozen backbone for many downstream tasks (depth estimation, semantic segmentation, instance retrieval) — often beating fully supervised baselines.
#8. CLIP: Language as a Universal Label
Radford et al., 2021. The single most consequential SSL paper for multimodal AI.
Zero-shot classification
To classify an image with CLIP:
- Encode the image:
v = image_encoder(img). - Encode each class name as a prompt ("a photo of a [class]"):
t_i = text_encoder("a photo of a cat"), etc. - Predict the class with highest cos(v, t_i).
No fine-tuning. No class-specific training data. Just compare embeddings. CLIP achieved 76% zero-shot ImageNet accuracy — matching the original supervised ResNet-50, without ever seeing an ImageNet label.
This was the proof that SSL + scale + web data could leapfrog the supervised paradigm entirely. Every modern vision-language model descends from CLIP: Flamingo, Gemini, GPT-4V, Claude's vision.
MAE masks 75% of image patches. What happens if you push the mask ratio to 95%?
#9. The 2023–2026 Frontier: JEPA and Beyond
The latest generation of SSL methods is moving away from pixel-space reconstruction and toward prediction in representation space.
- Pixel-level reconstruction wastes capacity on irrelevant detail (texture, lighting).
- Contrastive negatives require expensive augmentation pipelines.
#10. Why SSL Works: Theory, Intuition, Open Questions
#10.1 The information bottleneck view
#10.2 Augmentation as inductive bias
In contrastive SSL, the choice of augmentation is the inductive bias. SimCLR's authors explicitly say: SimCLR is learning to be invariant to "things that the augmentation pipeline considers irrelevant" (color jitter → color invariance; crop → location invariance). Different augmentations → different features.
#10.3 The collapse problem
Every non-contrastive SSL method has to actively prevent representation collapse. The mechanisms differ:
- BYOL/SimSiam: asymmetric predictor + stop-grad / EMA.
- DINO: centering + sharpening of the teacher distribution.
- Barlow Twins: loss term that pushes the cross-correlation matrix toward the identity.
- VICReg: explicit variance + covariance regularizers.
These can all be viewed as implicit ways to enforce variance in the representation.
The Barlow Twins and VICReg Losses Written Out
Both methods take the embeddings of two views of every image in a batch and add terms that keep the embedding dimensions informative, so a constant output is not a minimum. The VICReg loss over two batches Z and Z' of n embeddings with d dimensions each (Bardes, Ponce and LeCun) is below. Here z^j is the j-th dimension across the batch and C(Z) is the covariance matrix of the embeddings.
Barlow Twins (Zbontar et al.) takes the same idea through the cross-correlation matrix C between the two views, computed along the batch, where b indexes the batch and i, j index the embedding dimensions.
Two small derivations show how each loss turns away a collapsed solution.
#10.4 SSL ≠ universally better
A real subtlety: SSL representations are not automatically superior to supervised ones. They tend to be:
- Better for transfer learning (especially when downstream data is small).
- Better at OOD generalization in many vision benchmarks.
- Comparable or worse on the original pretraining-distribution task.
For tasks where you have plenty of labels and inference distribution matches training, supervised may still win.
You're choosing an SSL objective for pretraining a vision backbone that will be fine-tuned end-to-end on a medical segmentation task. Which family is most likely the strongest choice?
#Wrapping Up: The SSL Mindset
If you take three things from this lesson:
-
SSL is the dominant pretraining paradigm now. Every frontier model is built on self-supervised pretraining: GPT, Claude, Gemini, CLIP, DINOv2, MAE, SAM, JEPA. Supervised learning is now a fine-tuning step, not a pretraining strategy.
-
The three families have different sweet spots. Generative SSL (BERT, MAE) tends to win at fine-tuning on dense tasks. Contrastive SSL (SimCLR, CLIP) tends to win at linear probe, retrieval, and multimodal. Non-contrastive SSL (BYOL, DINO) wins at instance-level features without needing huge batches.
-
Collapse is the enemy. Every non-contrastive SSL design is, in some way, an answer to the question: what stops the network from outputting a constant? Architectural asymmetry (BYOL), distribution sharpening (DINO), explicit variance regularization (VICReg) — all are anti-collapse mechanisms.