SimSiam (Chen and He, CVPR 2021) strips non-contrastive learning to its core: one network processes two views, a predictor sits on one side, and the loss is the negative cosine similarity between the prediction and the other view's output. That output is treated as a constant. There are no negatives, no momentum encoder and no large batches. Chen and He showed that the stop-gradient is what prevents collapse, and suggested SimSiam can be read as an expectation–maximisation-like alternation. This page covers the architecture, the stop-gradient and the collapse diagnostics. In the exercises you implement the loss and an effective-rank measure, then train SimSiam and two ablations. SimSiam reached probe accuracy 0.67 with healthy embedding spread. Without stop-gradient (0.22) and without the predictor (0.30), it collapsed on all three seeds, with spread falling to 0.05.
★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.
Make two views agree, but only push one of them
SimSiam uses a single network on two altered views of an image. One side gets a small extra “predictor” and is trained to match the other side’s output. The trick is that the other side is held fixed while computing the update; no gradient flows into it. Without that one line, the network quickly learns to output the same thing for every image, which matches perfectly and means nothing. The demo shows the spread of an embedding shrinking as it collapses.
Self-supervised learning lab
Effective rank 15.6 of 16 dimensions. Non-contrastive methods need stop-gradients, predictors, centring or variance terms to keep the spectrum from collapsing to a few directions.
Why engineers care
SimSiam needs neither large batches nor a momentum encoder, which makes it one of the cheapest self-supervised methods to run on in-house data.
📝 Quick check (Level 0)
0/3 answered
1. SimSiam uses how many networks?
2. The 'other side' during an update is…
3. Without stop-gradient the network…
Level 1: Beginner
★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.
By hand
Architecture: shared encoder plus projector f gives z₁ = f(x₁), z₂ = f(x₂); a predictor h gives p₁ = h(z₁), p₂ = h(z₂).
Loss: L = ½D(p₁, sg(z₂)) + ½D(p₂, sg(z₁)) with D(p, z) = −cos(p, z), where sg is stop-gradient.
The minimum is −1 (aligned); halves of −1 and −0.5 give −0.75.
Collapse: a constant output also reaches −1, so the objective alone cannot rule it out.
Diagnostics:
the standard deviation of normalised outputs (about 1/√d when healthy, 0 when collapsed);
effective rank, exp(entropy of normalised singular values): 16 for 16 equal singular values, 1 for a single direction.
📝 Quick check (Level 1)
0/3 answered
1. D(p, z) for parallel p and z:
2. Symmetrised loss for halves −1 and −0.5:
3. Effective rank of a fully collapsed embedding:
Level 2: Intermediate
★★★☆☆ Intermediate⏱ 25 minUndergraduate students and practising engineers.
SimSiam in code
Exercise 1.
Negative cosine was −1 for parallel vectors.
Effective rank was above 6 for random 8-D data and 1 for data along a single direction.
Practice.
In PyTorch, z.detach() is the stop-gradient.
Use a predictor bottleneck (2048 → 512 → 2048 in the paper), batch norm in the projector, and SGD with a fixed predictor learning rate.
SimSiam works with batch sizes of 256 or even smaller.
Monitor the output standard deviation during training: a drop toward 0 signals collapse.
Implement negative cosine, the symmetrised SimSiam loss and effective rank.
📝 Quick check (Level 2)
0/3 answered
1. Stop-gradient in PyTorch:
2. SimSiam needs large batches?
3. A collapse signal:
Level 3: Advanced
★★★★☆ Advanced⏱ 25 minGraduate level, with full derivations and proofs.
Theory
An EM-like view (Chen and He).
Treat the target representations η_x as extra variables. The loss is minimised alternately: (1) with η fixed, update the network to match η; (2) set η to the network’s output averaged over augmentations.
Stop-gradient implements step 1, where the target is fixed, and the predictor approximates the expectation over augmentations in step 2.
Back-propagating into the target merges the two steps into a single objective whose easiest solution is collapse.
Relation to BYOL. SimSiam is BYOL with momentum 0. Chen and He showed that the momentum encoder is not essential, while the stop-gradient and predictor are, though how robust this is depends on training details such as the learning rate.
Dynamics. Analyses of linear models show that the predictor aligns with the correlation structure of the representations, and stop-gradient keeps the dominant directions from shrinking, preventing dimensional collapse.
📝 Quick check (Level 3)
0/3 answered
1. In the EM view, stop-gradient implements…
2. SimSiam is BYOL with…
3. Back-propagating into the target leads to…
Level 4: Expert
★★★★★ Expert⏱ 30 minResearchers: original papers and open problems.
Is the stop-gradient really what prevents collapse?
History.
X. Chen and K. He, “Exploring simple Siamese representation learning” (CVPR 2021).
Y. Tian, X. Chen and S. Ganguli (ICML 2021), dynamics of non-contrastive learning.
L. Jing et al. (ICLR 2022), dimensional collapse in self-supervised learning.
Exercise 2.
Setup: the same style-dominated world, encoder (32 → 64 → 16), projector and predictor (16 → 32 → 16) as before, 1500 Adam steps at learning rate 0.003, symmetric loss.
Variants: SimSiam; without stop-gradient (gradients flow into both branches); and without the predictor.
variant
probe accuracy
embedding spread
raw observations
0.522
0.176
SimSiam
0.672
0.171
no stop-gradient
0.216
0.054
no predictor
0.304
0.058
Stop-gradient is essential: without it, the spread collapsed 3-fold and accuracy fell far below raw features. Seeds 1 and 2 gave 0.29 and 0.22.
So is the predictor: removing it collapsed training as well (0.28 and 0.26 on seeds 1 and 2).
SimSiam itself trained stably, at 0.59–0.68 across three seeds, without negatives or momentum.
A caveat from the BYOL page: the same network (BYOL without momentum) collapsed at learning rate 0.01. Stop-gradient is necessary but not sufficient; optimisation settings matter too.
🐍 Exercise 2 (research): is the stop-gradient really what prevents collapse?
Train SimSiam, SimSiam without stop-gradient and SimSiam without the predictor, measuring probe accuracy and embedding spread.
SimSiam in AI, robotics and aerospace
Low-cost pre-training: a strong default when compute is limited and data is unlabelled.
Edge and embedded learning: small batches and no extra encoders make on-device adaptation plausible.
Design lesson: when an objective has trivial solutions, check which architectural or optimisation choices keep training away from them, and verify with ablations.
References
X. Chen and K. He (2021). “Exploring simple Siamese representation learning.” Proc. CVPR.
Y. Tian, X. Chen and S. Ganguli (2021). “Understanding self-supervised learning dynamics without contrastive pairs.” Proc. ICML.
L. Jing, P. Vincent, Y. LeCun and Y. Tian (2022). “Understanding dimensional collapse in contrastive self-supervised learning.” ICLR.
SimSiam 0.67 (spread 0.17); without stop-gradient 0.22, without predictor 0.30 (spread 0.05).
Practice
Show:
Level 0
Problem 1Level 0
Year SimSiam appeared at CVPR?
2021.
Problem 2Level 0
Minimum SimSiam loss?
-1.
Problem 3Level 0
D(p, z) for orthogonal p and z?
0.
Level 1
Problem 4Level 1
Symmetrised loss for halves −1 and −0.5?
-0.75.
Problem 5Level 1
Effective rank of 16 equal singular values?
16.
Problem 6Level 1
Effective rank of a single nonzero singular value?
1.
Problem 7Level 1
Per-dimension std of a healthy normalised 16-D embedding (≈ 1/√16)?
0.25.
Level 2
Problem 8Level 2
SimSiam probe accuracy in exercise 2?
0.672.
Problem 9Level 2
Probe accuracy without stop-gradient?
0.216.
Problem 10Level 2
Probe accuracy without the predictor?
0.304.
Problem 11Level 2
SimSiam embedding spread?
0.171.
Problem 12Level 2
Spread ratio SimSiam / no-stop-gradient (0.171/0.054, 1 decimal)?
3.2.
Problem 13Level 2
SimSiam probe accuracy with seed 2?
0.592.
Level 3
Problem 14Level 3
Prove that a constant network attains SimSiam’s minimum.
If f(x) = c for all x, then z₁ = z₂ = c and p₁ = p₂ = h(c). Choosing h so that h(c) is parallel to c (for example h = identity) gives cos(p, z) = 1 for every pair, so the loss equals −1, its minimum value. ∎
With gradients flowing into both branches, the loss can be lowered by moving both outputs toward each other, and the fastest common direction is to make all outputs alike, shrinking the embedding’s variety. The EM-like alternation that keeps targets fixed is lost, and training drifts to the collapsed minimum (spread 0.05). ∎
Problem 16Level 3
Compare SimSiam with BYOL.
Both use a predictor on one branch and no negatives. BYOL’s target is a momentum (EMA) copy; SimSiam’s target is the same network with stop-gradient (momentum 0). SimSiam is simpler and cheaper; BYOL’s slow target can add stability, as our learning-rate sensitivity suggests. ∎
Problem 17Level 3
Advise on monitoring a SimSiam run on in-house data.
Log the per-dimension std of normalised outputs and the effective rank every few hundred steps; a fall toward 0 or 1 signals collapse. Check the stop-gradient implementation (detach), keep the predictor learning rate fixed, and run periodic linear-probe evaluations on a small labelled set. ∎
Level 4
Problem 18Level 4
No-stop-gradient accuracy with seed 1?
0.29.
Problem 19Level 4
Embedding spread without the predictor?
0.058.
Problem 20Level 4
Learning rate used for SimSiam in exercise 2?
0.003.
Coding practice
🐍 Code 1 (Level 0): D
−cos.
🐍 Code 2 (Level 0): symmetrise
Average of both directions.
🐍 Code 3 (Level 0): minimum
Best possible loss.
🐍 Code 4 (Level 0): spread drop
before / after.
🐍 Code 5 (Level 0): effective rank
k equal values.
Topic test
A timed test drawn at random from this topic's question bank. Each attempt gets new questions. For a longer test across the whole chapter, see the chapter test, or mix topics in the question bag.
SimSiam: topic test
10 questions, drawn at random from a bank of 21. Every attempt is different.
⏱ Time limit: 15 minutes. The test submits itself when time runs out.
Levels covered: 0, 1, 2, 3, 4. No hints or solutions until you submit.