VICReg (Variance–Invariance–Covariance Regularisation; Bardes, Ponce and LeCun, ICLR 2022) makes the anti-collapse mechanism explicit, with three terms. Invariance: the mean squared distance between the two views' embeddings. Variance: a hinge keeping each dimension's standard deviation above 1 across the batch. Covariance: a penalty on off-diagonal covariances, decorrelating dimensions. It needs no negatives, momentum, predictor or batch-wise normalisation, and its two branches can even have different architectures. This page covers the three terms and the two collapse modes they prevent. In the exercises you implement the terms, then train VICReg and two ablations. Full VICReg reached probe accuracy 0.70 with a well-spread, rank-6 embedding. Without the variance term, the embedding collapsed to a point (std 0.001, probe 0.27). Without the covariance term, it collapsed onto about 1.6 effective dimensions (probe 0.46). All three seeds agree.
★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.
Three rules: agree, stay spread out, do not repeat
VICReg writes down three simple rules for a good embedding. Two views of the same image should land close together (invariance). Across a batch, every dimension should keep varying: no dimension may shrink to a constant (variance). Different dimensions should carry different information (covariance). Each rule blocks a different way the network could cheat. The demo shows how an embedding’s spread over dimensions shrinks 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
VICReg’s explicit terms make training easy to monitor and debug. Because its branches need not share architecture, it also suits multimodal pairs such as camera and lidar.
📝 Quick check (Level 0)
0/3 answered
1. The variance term keeps each dimension…
2. The covariance term makes dimensions…
3. The invariance term pulls together…
Level 1: Beginner
★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.
By hand
Invariance: s(Z, Z’) = mean ‖z − z’‖², the MSE between the views (1 for vectors of ones against zeros).
Variance: v(Z) = (1/d) Σ_j max(0, γ − √(Var(z_j) + ε)) with γ = 1. A dimension with std 0.3 costs 0.7; std 1.5 costs 0.
Implement VICReg's variance, invariance and covariance terms.
📝 Quick check (Level 2)
0/3 answered
1. VICReg's branches must share architecture?
2. A warning sign of collapse:
3. VICReg needs negatives or a predictor?
Level 3: Advanced
★★★★☆ Advanced⏱ 25 minGraduate level, with full derivations and proofs.
Theory
Explicit regularisation.
Methods like BYOL and SimSiam avoid collapse implicitly, through architecture and optimisation (predictor, stop-gradient, EMA).
VICReg puts the safeguards into the loss: the variance hinge forbids collapse to a point, and the covariance penalty forbids collapse onto a subspace.
Its behaviour depends far less on delicate training details.
Relation to Barlow Twins. Barlow Twins standardises features (fixing variance) and decorrelates the cross-correlation between branches. VICReg keeps variance with a hinge instead of normalisation, decorrelates within each branch, and uses an MSE invariance term. The two are close cousins, but VICReg’s terms act on each branch separately.
Information view. The variance and covariance terms approximately maximise the entropy of the embedding distribution (spread, decorrelated), while invariance maximises agreement between views. Together they approximate maximising information shared across views.
📝 Quick check (Level 3)
0/3 answered
1. VICReg prevents collapse…
2. Barlow Twins fixes variance by…
3. Variance + covariance terms approximately maximise…
Level 4: Expert
★★★★★ Expert⏱ 30 minResearchers: original papers and open problems.
Which term prevents which collapse?
History.
A. Bardes, J. Ponce and Y. LeCun, “VICReg: variance-invariance-covariance regularization for self-supervised learning” (ICLR 2022).
Follow-ups include VICRegL (local features, 2022) and links to joint-embedding predictive architectures (I-JEPA).
Exercise 2.
Setup: the same style-dominated world as before, with encoder 32 → 64 → 16 and projector 16 → 32 → 16, 1000 steps.
Variants: the full VICReg loss (λ = μ = 25, ν = 1); without the variance term (μ = 0); and without the covariance term (ν = 0).
Measurements: probe accuracy, plus the projector outputs’ mean standard deviation and effective rank (of 16).
variant
probe accuracy
projector std
effective rank
raw observations
0.522
—
—
VICReg
0.700
0.977
6.31
no variance term
0.272
0.001
2.48
no covariance term
0.464
1.076
1.60
Without the variance term, the embedding collapses to a point (std 0.001): invariance is trivially satisfied, and the probe falls far below raw features.
Without the covariance term, it collapses dimensionally: each dimension still varies (std about 1), but they move together, giving an effective rank of 1.6. The probe drops by 0.24.
Each term blocks exactly one failure mode, as designed. Seeds 1 and 2 gave the same pattern: VICReg 0.73 and 0.70; no variance 0.28 and 0.30 (std 0); no covariance 0.62 and 0.55 (rank 1.9 and 1.8).
🐍 Exercise 2 (research): which term prevents which collapse?
Train VICReg and ablations without the variance and without the covariance term, measuring probe accuracy, spread and effective rank.
VICReg in AI, robotics and aerospace
Multimodal pre-training: camera–lidar or image–telemetry pairs with different encoders per modality.
Robust training: explicit terms make collapse visible early, which helps unattended training on new sensor data.
Design lesson: if you know the failure modes, regularise against each one directly, and log each term.
References
A. Bardes, J. Ponce and Y. LeCun (2022). “VICReg: variance-invariance-covariance regularization for self-supervised learning.” ICLR.
J. Zbontar, L. Jing, I. Misra, Y. LeCun and S. Deny (2021). “Barlow Twins: self-supervised learning via redundancy reduction.” Proc. ICML.
No variance: complete collapse (std 0.001). No covariance: dimensional collapse (rank 1.6). Full VICReg: 0.70, rank 6.3.
Practice
Show:
Level 0
Problem 1Level 0
Year VICReg appeared at ICLR?
2022.
Problem 2Level 0
Variance hinge for a dimension with std 0.3?
0.7.
Problem 3Level 0
Number of terms in the VICReg loss?
3.
Level 1
Problem 4Level 1
Covariance term of [[1, 0.5], [0.5, 1]]?
0.25.
Problem 5Level 1
Total loss for inv 0.1, var 0.2, cov 3 with weights 25, 25, 1?
10.5.
Problem 6Level 1
MSE between (1, 2) and (1, 4)?
2.
Problem 7Level 1
Variance hinge for std 1.5?
0.
Level 2
Problem 8Level 2
VICReg probe accuracy in exercise 2?
0.7.
Problem 9Level 2
Probe accuracy without the variance term?
0.272.
Problem 10Level 2
Probe accuracy without the covariance term?
0.464.
Problem 11Level 2
Effective rank without the covariance term?
1.6.
Problem 12Level 2
Effective rank of full VICReg?
6.31.
Problem 13Level 2
Projector std without the variance term?
0.001.
Level 3
Problem 14Level 3
Prove that point collapse maximises the variance term.
If z is the same for every sample, Var(z_j) = 0 for all j, so each hinge term is max(0, γ − √ε) ≈ γ, the largest possible value (std ≥ 0). The variance term then equals γ, so point collapse incurs the maximum penalty μγ and cannot minimise the loss once μ > 0. ∎
Problem 15Level 3
Explain why removing the covariance term gave dimensional collapse but not point collapse.
The variance hinge still forces each dimension’s std up to about 1, preventing point collapse. Nothing stops the dimensions from being copies of one another, though, and copying a single invariant feature into every dimension satisfies invariance and variance cheaply. The embedding then occupies about 1.6 effective dimensions, losing information. ∎
Problem 16Level 3
Compare VICReg with Barlow Twins.
Barlow Twins standardises features and drives the cross-branch correlation matrix to the identity: invariance through the diagonal, decorrelation through the off-diagonal. VICReg uses an MSE invariance term, a variance hinge instead of standardisation, and decorrelates each branch’s own covariance, allowing different encoders per branch. Both avoid both collapse modes. ∎
Problem 17Level 3
Advise on camera–lidar self-supervised pre-training.
Use VICReg with separate encoders for images and point clouds, mapping both to a shared expander. Pair views from the same time and place, keep λ = μ = 25, ν = 1 initially, and log the three terms and effective rank. Evaluate on downstream detection or segmentation with few labels. ∎
Level 4
Problem 18Level 4
VICReg probe accuracy with seed 1?
0.726.
Problem 19Level 4
No-covariance probe accuracy with seed 1?
0.622.
Problem 20Level 4
VICReg’s invariance weight λ?
25.
Coding practice
🐍 Code 1 (Level 0): std hinge
max(0, γ − std).
🐍 Code 2 (Level 0): total loss
λ·inv + μ·var + ν·cov.
🐍 Code 3 (Level 0): MSE
Mean squared difference.
🐍 Code 4 (Level 0): covariance term
Σ off-diagonal² / d.
🐍 Code 5 (Level 0): collapse diagnosis
Complete, dimensional or healthy.
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.
VICReg: 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.