Simple Algorithm
Deep Learning · Emergence · 28 min

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 H(Pt,Ps)=h(Pt)+DKL(Pt ∥ Ps)H(P_t,P_s)=h(P_t)+\KL(P_t\,\|\,P_s) 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 fθ(x)=cf_{\boldsymbol\theta}(\mathbf x)=\mathbf c, so the question is never whether collapsed minimizers exist but how a method avoids them. There are three answers:

  1. Negatives. Contrastive losses add a repulsive term between different inputs (Self-Supervised Learning).
  2. 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.
  3. 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 qθq_{\boldsymbol\theta}) and a target network (encoder and projector only) whose weights ξ\boldsymbol\xi are an exponential moving average of the online ones, ξ←τξ+(1−τ)θ\boldsymbol\xi\leftarrow\tau\boldsymbol\xi+(1-\tau)\boldsymbol\theta, with τ\tau rising from 0.9960.996 to 11 on a cosine schedule. The online branch predicts the target's projection of the other view, and only the online weights receive gradients:

Lθ=∥qθ(z1)∥qθ(z1)∥−sg⁡(z2′)∥z2′∥∥2=2−2cos⁡(qθ(z1), z2′),symmetrized over the two views\loss_{\boldsymbol\theta}=\Big\lVert\frac{q_{\boldsymbol\theta}(\mathbf z_1)}{\norm{q_{\boldsymbol\theta}(\mathbf z_1)}}-\frac{\operatorname{sg}(\mathbf z_2')}{\norm{\mathbf z_2'}}\Big\rVert^2=2-2\cos\big(q_{\boldsymbol\theta}(\mathbf z_1),\,\mathbf z_2'\big),\qquad\text{symmetrized over the two views}
sg⁡\operatorname{sg} is the stop-gradient: the target is treated as a constant. BYOL's ablations are stark: a target that is never updated (τ=1\tau=1) gave 18.8% linear-probe accuracy, copying the online weights every step (τ=0\tau=0) gave 0.3%, and removing the predictor gave 0.2%, against 72.5% for the full method in the same 300-epoch setting (74.3% with a ResNet-50 trained longer).

The authors hypothesize that "there is no loss Lθ,ξL_{\theta,\xi} such that BYOL's dynamics is a gradient descent on LL jointly over θ,ξ\theta,\xi". 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 hh, 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 1/d1/\sqrt d). Without the predictor it collapsed too. What about BYOL's failure at τ=0\tau=0? 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.

DerivationSimSiam as alternating optimization (Chen & He, 2021)
  1. L(θ,η)=Ex,t[∥Fθ(t(x))−ηx∥2]L(\boldsymbol\theta,\boldsymbol\eta)=\E_{\mathbf x,t}\Big[\big\lVert F_{\boldsymbol\theta}(t(\mathbf x))-\boldsymbol\eta_{\mathbf x}\big\rVert^2\Big]

    Introduce one extra variable ηx\boldsymbol\eta_{\mathbf x} per training image, a target representation, and consider

  2. ηxt←Et[Fθt(t(x))],θt+1←arg min⁡θL(θ,ηt)\boldsymbol\eta_{\mathbf x}^{t}\leftarrow\E_{t}\big[F_{\boldsymbol\theta^{t}}(t(\mathbf x))\big],\qquad\boldsymbol\theta^{t+1}\leftarrow\argmin_{\boldsymbol\theta}L(\boldsymbol\theta,\boldsymbol\eta^{t})

    Minimize it by alternating, as kk-means alternates between centroids and assignments. With θ\boldsymbol\theta fixed, the optimal target is the mean embedding over augmentations; with η\boldsymbol\eta fixed, θ\boldsymbol\theta takes gradient steps toward fixed targets:

  3. θ←θ−ηlr∇θ∥Fθ(t(x))−sg⁡(Fθ(t′(x)))∥2\boldsymbol\theta\leftarrow\boldsymbol\theta-\eta_{\text{lr}}\nabla_{\boldsymbol\theta}\big\lVert F_{\boldsymbol\theta}(t(\mathbf x))-\operatorname{sg}\big(F_{\boldsymbol\theta}(t'(\mathbf x))\big)\big\rVert^2

    Approximate the expectation by a single augmentation t′t' 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.

  4. The predictor fills the gap left by the one-sample approximation: its optimum is h(z1)=Et[Fθ(t(x))]h(\mathbf z_1)=\E_t[F_{\boldsymbol\theta}(t(\mathbf x))], 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 hh 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.

DerivationWhich directions survive
  1. p˙j=pj[pj(τ−(1+σ2)pj)−η]\dot p_j=p_j\Big[p_j\big(\tau-(1+\sigma^2)p_j\big)-\eta\Big]

    The quantity sj−pj2/αps_j-p_j^2/\alpha_p decays like e−2ηte^{-2\eta t}, so with weight decay every trajectory approaches the parabola sj=pj2/αps_j=p_j^2/\alpha_p. Substituting it into the first equation:

  2. p±=τ±τ2−4η(1+σ2)2(1+σ2)p_\pm=\frac{\tau\pm\sqrt{\tau^2-4\eta(1+\sigma^2)}}{2(1+\sigma^2)}

    Besides pj=0p_j=0, the fixed points solve (1+σ2)p2−τp+η=0(1+\sigma^2)p^2-\tau p+\eta=0. They exist only if η≤τ2/(4(1+σ2))\eta\le\tau^2/(4(1+\sigma^2)):

  3. The bracket is positive between p−p_- and p+p_+ and negative outside, so 00 and p+p_+ are stable and p−p_- is the edge of the basin of collapse. A direction that starts below p−p_- dies: that is dimensional collapse, one eigen-direction at a time. More weight decay or stronger augmentation (σ2\sigma^2) 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 τ\tau is small and each direction first heads for the modest goal p+≈τ/(1+σ2)p_+\approx\tau/(1+\sigma^2), slowly enough that the predictor stays aligned with FF (the condition of the theorem); τ\tau then rises toward 11 and the goal with it. The price is that a small τ\tau raises p−p_-, so more directions can be caught in the basin of collapse.

  4. Wp=U^ diag⁡(s1,…,sd) U^⊤W_p=\hat U\,\diag\big(\sqrt{s_1},\dots,\sqrt{s_d}\big)\,\hat U^\top

    The analysis suggests a shortcut, DirectPred: skip training the predictor and set it from the eigendecomposition of a running estimate F^=U^ΛU^⊤\hat F=\hat U\Lambda\hat U^\top, with eigenvalues pj=sjp_j=\sqrt{s_j} (plus a small boost for weak directions). On ImageNet this matched BYOL's learned two-layer predictor.

Check your understanding

In the linear model with τ=1\tau=1, σ2=0\sigma^2=0 and weight decay η=0.09\eta=0.09, a direction starts on the parabola with pj=0.05p_j=0.05. What happens to it?

  1. It grows to p+=0.9p_+=0.9 and survives
  2. It stays at 0.050.05, a fixed point
  3. It decays to 00: it starts inside the basin of collapse, below p−=0.1p_-=0.1
  4. It oscillates between p−p_- and p+p_+
Show the answer

C. It decays to 00: it starts inside the basin of collapse, below p−=0.1p_-=0.1

p±=(1±1−0.36)/2p_\pm=\big(1\pm\sqrt{1-0.36}\big)/2, so p−=0.1p_-=0.1 and p+=0.9p_+=0.9. Below p−p_- the bracket p(τ−p)−ηp(\tau-p)-\eta is negative (0.05×0.95−0.09<00.05\times0.95-0.09<0), so p˙j<0\dot p_j<0 and the direction shrinks to zero. A direction starting above 0.10.1 would instead grow to 0.90.9.

Self-distillation: DINO, SwAV and DINOv2

DINO (Caron et al., 2021) recasts BYOL as distillation without labels: self-distillation. A student gsg_s and a teacher gtg_t with the same architecture map an image to KK logits (K=65,536K=65{,}536 by default), turned into distributions by softmaxes at temperatures τs=0.1\tau_s=0.1 and τt\tau_t (warmed up from 0.040.04 to 0.070.07). The teacher's weights are a moving average of the student's (from 0.9960.996 to 11 on a cosine schedule), and it sees only two global crops of 2242224^2 pixels, while the student also sees several local crops of 96296^2 (multi-crop). The loss is a cross-entropy from teacher to student over pairs of different views:

L=∑x∈{x1g,x2g} ∑x′≠xH(Pt(x),Ps(x′)),Pt(x)=softmax⁡(gt(x)−cτt),c←m c+(1−m)1B∑i=1Bgt(xi)\loss=\sum_{\mathbf x\in\{\mathbf x^g_1,\mathbf x^g_2\}}\ \sum_{\mathbf x'\ne\mathbf x}H\big(P_t(\mathbf x),P_s(\mathbf x')\big),\qquad P_t(\mathbf x)=\softmax\Big(\frac{g_t(\mathbf x)-\mathbf c}{\tau_t}\Big),\quad\mathbf c\leftarrow m\,\mathbf c+(1-m)\frac1B\sum_{i=1}^Bg_t(\mathbf x_i)
The center c\mathbf c is a running mean of the teacher's logits (m=0.9m=0.9 worked best in the ablations). The paper's text describes centering as adding a bias c\mathbf c to the teacher's output; its pseudocode (Algorithm 1) subtracts the running mean, as written here, which is what centering means. Matching small local crops to the teacher's global view forces "local-to-global" correspondences.
DerivationWhy centering and sharpening are both needed
  1. H(Pt,Ps)=h(Pt)+DKL(Pt ∥ Ps)H(P_t,P_s)=h(P_t)+\KL(P_t\,\|\,P_s)

    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:

  2. Pt→(1K,…,1K),h(Pt)→log⁡KP_t\to\Big(\tfrac1K,\dots,\tfrac1K\Big),\qquad h(P_t)\to\log K

    Centering alone. If the teacher's logits drift toward a common vector g\mathbf g for all inputs, the running mean c\mathbf c tracks it, the centered logits go to 0\mathbf 0, and PtP_t becomes uniform: the collapse that centering invites. Its entropy is maximal, log⁡K=ln⁡65,536=16ln⁡2≈11.09\log K=\ln65{,}536=16\ln2\approx11.09 nats for DINO's default head:

  3. τt→0:Pt(x)→earg max⁡kgt(x)k\tau_t\to0:\quad P_t(\mathbf x)\to\mathbf e_{\argmax_kg_t(\mathbf x)_k}

    Sharpening alone. A low teacher temperature exaggerates the largest logit; with constant logits PtP_t becomes one-hot on a single dimension, the other collapse, with h(Pt)→0h(P_t)\to0. Centering opposes exactly this (no dimension may dominate on average), and sharpening opposes the uniform collapse.

  4. Caron et al. tracked both terms. Removing either operation drove the KL to zero, with the entropy going to 00 without centering and to log⁡K\log K without sharpening; with both, the KL stayed positive and training worked. The balance is empirical, not a guarantee: a center momentum of 0.9990.999 collapsed in their ablation.

SwAV (Caron et al., 2020) avoids collapse with a constraint instead of a dynamical balance. Embeddings z\mathbf z are scored against KK learned prototypes CC (K=3000K=3000), and each view must predict the code q\mathbf q of the other view: a swapped prediction, ℓ(z1,q2)+ℓ(z2,q1)\ell(\mathbf z_1,\mathbf q_2)+\ell(\mathbf z_2,\mathbf q_1), with ℓ\ell 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:

max⁡Q∈Q Tr⁡(Q⊤C⊤Z)+εH(Q),Q={Q∈R+K×B: Q1B=1K1K, Q⊤1K=1B1B},Q⋆=diag⁡(u) eC⊤Z/εdiag⁡(v)\max_{Q\in\mathcal Q}\ \Tr\big(Q^\top C^\top Z\big)+\varepsilon H(Q),\quad\mathcal Q=\Big\{Q\in\R_+^{K\times B}:\ Q\mathbf 1_B=\tfrac1K\mathbf 1_K,\ Q^\top\mathbf 1_K=\tfrac1B\mathbf 1_B\Big\},\quad Q^\star=\diag(\mathbf u)\,e^{C^\top Z/\varepsilon}\diag(\mathbf v)
Sinkhorn–Knopp finds the scaling vectors u,v\mathbf u,\mathbf v by alternately normalizing rows and columns; three iterations with ε=0.05\varepsilon=0.05 sufficed. A collapsed batch cannot satisfy equipartition, so "the codes for different images in a batch are distinct."

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 5182518^2 for a short final phase; and distilled a ViT-g of about 1.1 billion parameters into smaller models. The KoLeo term, with dn,i=min⁡j≠i∥zi−zj∥d_{n,i}=\min_{j\ne i}\norm{\mathbf z_i-\mathbf z_j}, is

LKoLeo=−1n∑i=1nlog⁡dn,i.\loss_{\text{KoLeo}}=-\frac1n\sum_{i=1}^n\log d_{n,i}.

Redundancy reduction and the duality theorem

The third route penalizes collapse directly in the statistics of a batch of embeddings Z,Z′∈Rn×dZ,Z'\in\R^{n\times d} (nn samples, dd 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 C\mathcal C of the two views toward the identity:

LBT=∑i(1−Cii)2+λ∑i∑j≠iCij2,Cij=∑bzb,i zb,j′∑bzb,i2∑bzb,j′2\loss_{\text{BT}}=\sum_i\big(1-\mathcal C_{ii}\big)^2+\lambda\sum_i\sum_{j\ne i}\mathcal C_{ij}^2,\qquad\mathcal C_{ij}=\frac{\sum_bz_{b,i}\,z'_{b,j}}{\sqrt{\sum_bz_{b,i}^2}\sqrt{\sum_bz_{b,j}'^2}}
The diagonal makes each dimension invariant to the augmentations; the off-diagonal terms (λ=5×10−3\lambda=5\times10^{-3}) decorrelate dimensions so they cannot all encode the same thing. Barlow Twins kept improving as the projector output grew, up to the largest size tested (16,38416{,}384 dimensions; the default is 81928192), and was almost unaffected by batches as small as 256.

VICReg (Bardes, Ponce & LeCun, 2022) splits the job into three explicit terms: invariance s(Z,Z′)=1n∑i∥zi−zi′∥2s(Z,Z')=\frac1n\sum_i\norm{\mathbf z_i-\mathbf z_i'}^2; variance, a hinge that keeps the standard deviation of every dimension jj (the column zj\mathbf z^j) above γ=1\gamma=1; and covariance, the squared off-diagonal entries of each branch's covariance matrix C(Z)C(Z):

v(Z)=1d∑j=1dmax⁡(0, γ−Var⁡(zj)+ϵ),c(Z)=1d∑i≠j[C(Z)]ij2,L=λs+μ[v(Z)+v(Z′)]+ν[c(Z)+c(Z′)]v(Z)=\frac1d\sum_{j=1}^d\max\Big(0,\ \gamma-\sqrt{\Var(\mathbf z^j)+\epsilon}\Big),\qquad c(Z)=\frac1d\sum_{i\ne j}\big[C(Z)\big]_{ij}^2,\qquad\loss=\lambda s+\mu\big[v(Z)+v(Z')\big]+\nu\big[c(Z)+c(Z')\big]
Defaults: λ=μ=25\lambda=\mu=25, ν=1\nu=1, ϵ=10−4\epsilon=10^{-4}. Without the variance term the representation "immediately" collapsed to a single vector. No predictor, stop-gradient, moving average or normalization of the embeddings is needed.
Predict before you look

A batch of 4-dimensional embeddings has per-dimension standard deviations 1.31.3, 1.11.1, 0.90.9 and 0.20.2. With γ=1\gamma=1 and ϵ=10−4\epsilon=10^{-4}, what is the variance term v(Z)v(Z)?

Show the answer

0.225

Only dimensions below γ\gamma contribute: 1−0.81+10−4≈0.1001-\sqrt{0.81+10^{-4}}\approx0.100 and 1−0.04+10−4≈0.8001-\sqrt{0.04+10^{-4}}\approx0.800. Averaging over d=4d=4 gives (0.100+0.800)/4≈0.225(0.100+0.800)/4\approx0.225. 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 NN embeddings of dimension MM as the columns of E∈RM×NE\in\R^{M\times N}.

DerivationProof
  1. ∥E⊤E∥F2=Tr⁡((E⊤E)2)=∑kσk4=Tr⁡((EE⊤)2)=∥EE⊤∥F2\norm{E^\top E}_F^2=\Tr\big((E^\top E)^2\big)=\sum_k\sigma_k^4=\Tr\big((EE^\top)^2\big)=\norm{EE^\top}_F^2

    E⊤EE^\top E and EE⊤EE^\top have the same nonzero eigenvalues σk2\sigma_k^2, so the same Frobenius norm:

  2. Lc=∥E⊤E∥F2−∑i=1N∥E⋅,i∥24,Lnc=∥EE⊤∥F2−∑j=1M∥Ej,⋅∥24\loss_c=\norm{E^\top E}_F^2-\sum_{i=1}^N\norm{E_{\cdot,i}}_2^4,\qquad\loss_{nc}=\norm{EE^\top}_F^2-\sum_{j=1}^M\norm{E_{j,\cdot}}_2^4

    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:

  3. Subtract and use the first step. Unit columns make ∑i∥E⋅,i∥4=N\sum_i\norm{E_{\cdot,i}}^4=N, and since ∑j∥Ej,⋅∥2=∥E∥F2=N\sum_j\norm{E_{j,\cdot}}^2=\norm E_F^2=N, Cauchy–Schwarz pins the row term between N2/MN^2/M (all dimensions equal) and N2N^2 (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 σ2\sigma^2 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 σk\sigma_k of the N×dN\times d matrix ZZ of embeddings, as the exponential of the entropy of their normalized distribution:

RankMe⁡(Z)=exp⁡(−∑k=1min⁡(N,d)pklog⁡pk),pk=σk(Z)∥σ(Z)∥1+ε\operatorname{RankMe}(Z)=\exp\Big(-\sum_{k=1}^{\min(N,d)}p_k\log p_k\Big),\qquad p_k=\frac{\sigma_k(Z)}{\norm{\boldsymbol\sigma(Z)}_1}+\varepsilon
It ranges from about 11 (one dominant direction) to min⁡(N,d)\min(N,d) (a flat spectrum). It needs no labels, and across hyperparameter sweeps it tracked downstream accuracy closely enough to choose hyperparameters with almost no loss. The authors stress its limits: high rank is necessary, not sufficient, and RankMe should only compare runs of the same method.
python
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 11; an encoder whose embeddings fill all dd directions equally gives about dd.

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 p−p_- 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 H(Pt,Ps)=h(Pt)+DKL(Pt ∥ Ps)H(P_t,P_s)=h(P_t)+\KL(P_t\,\|\,P_s) 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 Lnc+∑j∥Ej,⋅∥4=Lc+∑i∥E⋅,i∥4\loss_{nc}+\sum_j\norm{E_{j,\cdot}}^4=\loss_c+\sum_i\norm{E_{\cdot,i}}^4 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.

Question 1

You remove the stop-gradient from SimSiam and train. What happens, according to Chen & He (2021)?

  1. Training is slower but reaches the same accuracy
  2. The loss quickly reaches its minimum of −1-1 and the representation collapses to a constant (chance-level accuracy)
  3. The representation collapses only if the predictor is also removed
  4. Accuracy improves, because gradients now flow through both branches
Show the answer

B. The loss quickly reaches its minimum of −1-1 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 −1-1, 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.

Question 2

You train DINO with centering but no sharpening (a high teacher temperature). What do you expect to see?

  1. The teacher's output collapses to a one-hot vector, with entropy near 00
  2. Training works as usual, because centering alone prevents collapse
  3. The KL term grows without bound
  4. The teacher's output approaches the uniform distribution, with entropy near log⁡K\log K, and the KL term goes to zero
Show the answer

D. The teacher's output approaches the uniform distribution, with entropy near log⁡K\log K, 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.

Question 3

A batch has N=256N=256 embeddings of dimension M=128M=128. Every embedding is scaled to unit norm, and every dimension is rescaled to the same norm N/M\sqrt{N/M} (both are possible at once). How does the dimension-contrastive criterion Lnc\loss_{nc} compare with the sample-contrastive criterion Lc\loss_c?

  1. Lnc=Lc\loss_{nc}=\loss_c exactly
  2. Lnc=Lc+128\loss_{nc}=\loss_c+128
  3. Lnc=Lc−256\loss_{nc}=\loss_c-256
  4. They are unrelated: one compares samples and the other dimensions
Show the answer

C. Lnc=Lc−256\loss_{nc}=\loss_c-256

In Lnc+∑j∥Ej,⋅∥4=Lc+∑i∥E⋅,i∥4\loss_{nc}+\sum_j\norm{E_{j,\cdot}}^4=\loss_c+\sum_i\norm{E_{\cdot,i}}^4, the column term is N=256N=256 and the row term is M (N/M)2=N2/M=512M\,(N/M)^2=N^2/M=512. So Lnc=Lc+256−512=Lc−256\loss_{nc}=\loss_c+256-512=\loss_c-256. A constant offset leaves the minimizers unchanged: under these normalizations the two criteria are the same objective.

Question 4

Two runs of the same self-supervised method reach RankMe values of 40 and 400 on 512-dimensional embeddings. Which conclusion is justified?

  1. The second run will certainly transfer better to every downstream task
  2. The first run has suffered complete collapse
  3. 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
  4. 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).