Non-Contrastive & Self-Distillation Methods
BYOL, SimSiam, DINO, Barlow Twins and VICReg, and how far they avoid collapse without negatives.
Remove the negatives from a contrastive loss and it has a perfect, useless minimizer: send every input to the same point. BYOL and SimSiam train anyway, armed with a small predictor and a stop-gradient (and, in BYOL, a moving-average target); DINO adds centering and sharpening; Barlow Twins and VICReg replace architectural tricks with statistics of the batch. This lesson works out why each one escapes complete collapse, why none is immune to losing dimensions, and why the two families are closer than they look.
What you’ll learn
- Explain how a predictor and a stop-gradient let BYOL and SimSiam avoid collapse, via SimSiam's alternating-optimization reading and the eigenvalue dynamics of a linear model.
- Use the decomposition to show why DINO needs both centering and sharpening, and describe SwAV's equipartition and the additions of DINOv2.
- Write the Barlow Twins and VICReg losses and evaluate their terms on a batch.
- Prove the duality between sample-contrastive and dimension-contrastive criteria.
- Define dimensional collapse, name its mechanisms, and measure it with the effective rank.
Collapse, stated precisely
Any objective that only rewards agreement is minimized by , so the question is never whether collapsed minimizers exist but how a method avoids them. There are three answers:
- Negatives. Contrastive losses add a repulsive term between different inputs (Self-Supervised Learning).
- Asymmetric dynamics. BYOL, SimSiam and DINO keep a pure agreement loss but make the two branches different, through a predictor, a stop-gradient, a moving-average teacher or output normalization, so that training does not flow into the collapsed minima even though they exist.
- Constraints on batch statistics. SwAV forces balanced cluster assignments; Barlow Twins and VICReg penalize low variance and correlated dimensions directly.
The widget runs the agreement loss with nothing else, so you can watch the first point happen.
BYOL and SimSiam: a predictor and a stop-gradient
BYOL (Grill et al., 2020) has an online network (encoder, projector, then a small MLP predictor ) and a target network (encoder and projector only) whose weights are an exponential moving average of the online ones, , with rising from to on a cosine schedule. The online branch predicts the target's projection of the other view, and only the online weights receive gradients:
The authors hypothesize that "there is no loss such that BYOL's dynamics is a gradient descent on jointly over ". Collapsed solutions minimize the loss, but the update is not descending that loss, much as a GAN's players are not jointly minimizing anything.
SimSiam (Chen & He, 2021) stripped this down: one shared encoder, a predictor , a stop-gradient, no moving average, no negatives, ordinary batches of a few hundred images. Without the stop-gradient the loss dropped straight to its minimum and the representation collapsed (0.1% accuracy, with the per-channel standard deviation of the normalized outputs falling to zero instead of staying near ). Without the predictor it collapsed too. What about BYOL's failure at ? An appendix of the BYOL paper's arXiv version reports that with the predictor's learning rate ten times higher, BYOL also trains without a moving average (66.6%): the predictor must adapt faster than the encoder.
Introduce one extra variable per training image, a target representation, and consider
Minimize it by alternating, as -means alternates between centroids and assignments. With fixed, the optimal target is the mean embedding over augmentations; with fixed, takes gradient steps toward fixed targets:
Approximate the expectation by a single augmentation and take one gradient step per alternation. The result is exactly a Siamese loss whose target branch is a constant during the step: the stop-gradient is the trace of the alternation, not an arbitrary trick.
The predictor fills the gap left by the one-sample approximation: its optimum is , the expectation the alternation needs. This is a hypothesis, not a proof that collapse is avoided. It accounts for the stop-gradient ablation: remove it and nothing alternates. The predictor ablation has a simpler explanation in the paper: with the identity and the loss symmetrized over the two views, the stop-gradient update points in the same direction as the update without it, only half as large, so the method reduces to the one that collapses.
The quantity decays like , so with weight decay every trajectory approaches the parabola . Substituting it into the first equation:
Besides , the fixed points solve . They exist only if :
The bracket is positive between and and negative outside, so and are stable and is the edge of the basin of collapse. A direction that starts below dies: that is dimensional collapse, one eigen-direction at a time. More weight decay or stronger augmentation () widens the basin, and above the threshold every direction collapses. The moving average acts as an automatic curriculum: early in training the target lags behind the fast-growing online weights, so is small and each direction first heads for the modest goal , slowly enough that the predictor stays aligned with (the condition of the theorem); then rises toward and the goal with it. The price is that a small raises , so more directions can be caught in the basin of collapse.
The analysis suggests a shortcut, DirectPred: skip training the predictor and set it from the eigendecomposition of a running estimate , with eigenvalues (plus a small boost for weak directions). On ImageNet this matched BYOL's learned two-layer predictor.
In the linear model with , and weight decay , a direction starts on the parabola with . What happens to it?
- It grows to and survives
- It stays at , a fixed point
- It decays to : it starts inside the basin of collapse, below
- It oscillates between and
Show the answer
C. It decays to : it starts inside the basin of collapse, below
, so and . Below the bracket is negative (), so and the direction shrinks to zero. A direction starting above would instead grow to .
Self-distillation: DINO, SwAV and DINOv2
DINO (Caron et al., 2021) recasts BYOL as distillation without labels: self-distillation. A student and a teacher with the same architecture map an image to logits ( by default), turned into distributions by softmaxes at temperatures and (warmed up from to ). The teacher's weights are a moving average of the student's (from to on a cosine schedule), and it sees only two global crops of pixels, while the student also sees several local crops of (multi-crop). The loss is a cross-entropy from teacher to student over pairs of different views:
Split the cross-entropy into the teacher's entropy and a divergence. The teacher gets no gradient, so the student only reduces the KL term; collapse means a constant output, which makes the KL zero:
Centering alone. If the teacher's logits drift toward a common vector for all inputs, the running mean tracks it, the centered logits go to , and becomes uniform: the collapse that centering invites. Its entropy is maximal, nats for DINO's default head:
Sharpening alone. A low teacher temperature exaggerates the largest logit; with constant logits becomes one-hot on a single dimension, the other collapse, with . Centering opposes exactly this (no dimension may dominate on average), and sharpening opposes the uniform collapse.
Caron et al. tracked both terms. Removing either operation drove the KL to zero, with the entropy going to without centering and to without sharpening; with both, the KL stayed positive and training worked. The balance is empirical, not a guarantee: a center momentum of collapsed in their ablation.
SwAV (Caron et al., 2020) avoids collapse with a constraint instead of a dynamical balance. Embeddings are scored against learned prototypes (), and each view must predict the code of the other view: a swapped prediction, , with a cross-entropy against a softmax over prototype scores. The codes of a batch are computed by entropic optimal transport with an equipartition constraint, so every prototype is used equally often:
Two successors combined these ideas. iBOT (Zhou et al., 2022) added masked image modeling with an online tokenizer: the student sees an image with masked patches and matches, at each masked patch, the teacher's output distribution computed on the unmasked image, alongside DINO's image-level loss. DINOv2 (Oquab et al., 2024) scaled the recipe. It curated a dataset of 142 million images (LVD-142M) by retrieving images similar to curated collections from about 1.2 billion uncurated ones, with deduplication; combined the DINO and iBOT losses with separate heads; replaced the teacher's centering by three Sinkhorn–Knopp iterations, borrowed from SwAV; added the KoLeo regularizer, which spreads the normalized features of a batch apart; raised the resolution to for a short final phase; and distilled a ViT-g of about 1.1 billion parameters into smaller models. The KoLeo term, with , is
Redundancy reduction and the duality theorem
The third route penalizes collapse directly in the statistics of a batch of embeddings ( samples, dimensions) of the two views. Barlow Twins (Zbontar, Jing, Misra, LeCun & Deny, 2021), named after Horace Barlow's 1961 redundancy-reduction hypothesis, standardizes each dimension over the batch and pushes the cross-correlation matrix of the two views toward the identity:
VICReg (Bardes, Ponce & LeCun, 2022) splits the job into three explicit terms: invariance ; variance, a hinge that keeps the standard deviation of every dimension (the column ) above ; and covariance, the squared off-diagonal entries of each branch's covariance matrix :
A batch of 4-dimensional embeddings has per-dimension standard deviations , , and . With and , what is the variance term ?
Show the answer
0.225
Only dimensions below contribute: and . Averaging over gives . The hinge ignores dimensions that already vary enough and pushes hardest on the nearly collapsed one; a squared-error version would also shrink the large ones.
Contrastive losses repel samples; Barlow Twins and VICReg decorrelate dimensions. Garrido, Chen, Bardes, Najman & LeCun (2023) made the relation exact. Stack a batch of embeddings of dimension as the columns of .
and have the same nonzero eigenvalues , so the same Frobenius norm:
Removing the diagonal removes the squares of the diagonal entries. Those entries are the squared column norms for the Gram matrix and the squared row norms for the covariance-like matrix:
Subtract and use the first step. Unit columns make , and since , Cauchy–Schwarz pins the row term between (all dimensions equal) and (one dimension carries everything). That gives the bounds. The authors then showed empirically that the remaining performance gap between the families came mostly from design choices and hyperparameters: a carefully retuned SimCLR matched VICReg, and very large embedding dimensions were not essential.
Dimensional collapse, measured
Avoiding complete collapse is not enough. Hua et al. (2021) showed that non-contrastive methods can keep a nonzero variance while their dimensions become strongly correlated, and proposed decorrelating them. Jing, Vincent, LeCun & Tian (2022) found dimensional collapse even in SimCLR: plotting the singular values of the covariance of 128-dimensional embeddings on a log scale, several fell to zero. They identified two mechanisms in linear models: strong augmentation, which collapses a direction whose augmentation variance exceeds its data variance (the in the basin above), and implicit regularization, by which gradient descent in multi-layer networks drifts toward low-rank solutions even when augmentation is mild. Their DirectCLR applies the loss directly to a fixed sub-vector of the representation, with no trainable projector, and beat SimCLR with a linear projector.
If rank is what matters, measure it. RankMe (Garrido, Balestriero, Najman & LeCun, 2023) computes a smooth effective rank from the singular values of the matrix of embeddings, as the exponential of the entropy of their normalized distribution:
import torch
def rankme(z, eps=1e-7):
# z: (N, d) embeddings of N inputs, e.g. projector outputs on 25,600 images
s = torch.linalg.svdvals(z) # singular values, largest first
p = s / s.sum() + eps # a probability vector over directions
return torch.exp(-(p * torch.log(p)).sum())A collapsed encoder gives a value near ; an encoder whose embeddings fill all directions equally gives about .
Key takeaways
- Pure agreement objectives always have collapsed minimizers; methods avoid them with negatives, with asymmetric dynamics (predictor, stop-gradient, moving-average teacher), or with constraints on batch statistics.
- BYOL and SimSiam are not gradient descent on their loss. SimSiam reads as alternating optimization in which the stop-gradient and predictor are essential; in a linear model, eigen-directions starting below die, so weight decay and strong augmentation trade off against dimensional collapse.
- DINO needs both centering (against one dominant output) and sharpening (against uniform outputs), as shows; SwAV enforces equipartition with Sinkhorn–Knopp, and DINOv2 adds curated data, iBOT's patch loss and the KoLeo spreading term.
- Barlow Twins and VICReg decorrelate dimensions and keep their variance up; the duality shows they are close cousins of contrastive losses.
- Dimensional collapse persists even without complete collapse; effective rank (RankMe) detects it without labels but is necessary, not sufficient, for good features.
Check yourself
In the interactive lesson these are scored with your confidence, and what you miss comes back for review.
You remove the stop-gradient from SimSiam and train. What happens, according to Chen & He (2021)?
- Training is slower but reaches the same accuracy
- The loss quickly reaches its minimum of and the representation collapses to a constant (chance-level accuracy)
- The representation collapses only if the predictor is also removed
- Accuracy improves, because gradients now flow through both branches
Show the answer
B. The loss quickly reaches its minimum of and the representation collapses to a constant (chance-level accuracy)
Without the stop-gradient both branches can move toward each other, and the cheapest way is a constant output: the loss hits , the per-channel standard deviation of the normalized outputs falls to zero, and accuracy drops to 0.1%. In the alternating view, removing the stop-gradient removes the alternation.
You train DINO with centering but no sharpening (a high teacher temperature). What do you expect to see?
- The teacher's output collapses to a one-hot vector, with entropy near
- Training works as usual, because centering alone prevents collapse
- The KL term grows without bound
- The teacher's output approaches the uniform distribution, with entropy near , and the KL term goes to zero
Show the answer
D. The teacher's output approaches the uniform distribution, with entropy near , and the KL term goes to zero
Centering subtracts the running mean of the teacher's logits, so if the outputs stop depending on the input the centered logits vanish and the softmax becomes uniform. The student copies it, the KL goes to zero, and the output carries no information. Sharpening is what pushes back toward peaked, input-dependent outputs.
A batch has embeddings of dimension . Every embedding is scaled to unit norm, and every dimension is rescaled to the same norm (both are possible at once). How does the dimension-contrastive criterion compare with the sample-contrastive criterion ?
- exactly
- They are unrelated: one compares samples and the other dimensions
Show the answer
C.
In , the column term is and the row term is . So . A constant offset leaves the minimizers unchanged: under these normalizations the two criteria are the same objective.
Two runs of the same self-supervised method reach RankMe values of 40 and 400 on 512-dimensional embeddings. Which conclusion is justified?
- The second run will certainly transfer better to every downstream task
- The first run has suffered complete collapse
- The first run uses far fewer effective directions, which signals dimensional collapse and usually lower downstream accuracy, though high rank alone does not guarantee good features
- RankMe values cannot be compared, since they depend on the batch
Show the answer
C. The first run uses far fewer effective directions, which signals dimensional collapse and usually lower downstream accuracy, though high rank alone does not guarantee good features
An effective rank of 40 out of 512 means the spectrum is concentrated in few directions. Within one method this tracks downstream accuracy well, but rank is necessary rather than sufficient, so it guides comparisons without guaranteeing results.
Further reading
- J.-B. Grill et al., "Bootstrap your own latent: a new approach to self-supervised learning," NeurIPS (2020).
- X. Chen & K. He, "Exploring simple Siamese representation learning," CVPR (2021).
- Y. Tian, X. Chen & S. Ganguli, "Understanding self-supervised learning dynamics without contrastive pairs," ICML (2021).
- M. Caron, H. Touvron, I. Misra, H. Jégou, J. Mairal, P. Bojanowski & A. Joulin, "Emerging properties in self-supervised vision transformers," ICCV (2021).
- A. Bardes, J. Ponce & Y. LeCun, "VICReg: variance-invariance-covariance regularization for self-supervised learning," ICLR (2022).
- Q. Garrido, Y. Chen, A. Bardes, L. Najman & Y. LeCun, "On the duality between contrastive and non-contrastive self-supervised learning," ICLR (2023).