TL;DR
A self-supervised encoder is trained with a loss that only asks for useful features, so the easiest way to score well can be to make every input produce the same vector. This is representation collapse. The loss looks good, but the features carry almost no information about the input, and the damage often shows up only later, when a classifier is trained on top of them.
Collapse comes in two strengths: complete collapse, where all vectors are identical, and dimensional collapse, where the vectors vary but only along a few directions. Negatives, stop-gradient tricks and variance penalties are the standard defences.
Where you'll see it: when a SimCLR-, BYOL- or VICReg-style image encoder is pretrained without labels and its loss curve looks fine but its linear-probe accuracy stays low. It also matters for JEPA-style predictive models, which must avoid the same trivial solution.
Intuition
A student who copies the answer key
Imagine a training exercise where a student is graded only on whether two versions of the same photo get matching answers. The student could ignore the photos entirely and always write the number 7. Every pair matches, the score is perfect, and nothing was learned. Self-supervised learning has no human labels, so the objective is the only grader, and an objective that rewards agreement alone can be satisfied by ignoring the input.
That is collapse. The encoder finds a constant function, which trivially makes two views agree. The fix is always to make the constant answer score badly, so the model must keep information that tells one example from another.
Why the loss does not catch it
Contrastive methods add negatives: other images in the batch that must end up different from the anchor. If every embedding is the same, the negatives score just as well as the positive, and the loss does not drop. So contrastive loss already blocks complete collapse. Non-contrastive methods remove the negatives and need another mechanism, such as an asymmetric predictor with stop-gradient, or a penalty on the variance and correlation of the features.
Dimensional collapse is harder to see. The embeddings are not identical, but they stretch along only a handful of directions, as if a three-dimensional cloud had been flattened into a sheet or a line. The loss can still look healthy because the few directions it uses are enough to separate the training pairs. The downstream task is what suffers.
flowchart TD
A["Objective rewards agreement"] --> B{"Anything stops the encoder?"}
B -- "No" --> C["Complete collapse: all embeddings equal"]
B -- "Partly" --> D["Dimensional collapse: spread in few directions"]
B -- "Negatives, stop-gradient, variance penalty" --> E["Informative, spread-out features"]
C --> F["Loss looks perfect, linear probe is poor"]
D --> F
The math
Setup
Let an encoder map an input to a feature, and a projection head map that feature to an embedding . In many methods is then scaled to unit length. Take a batch of embeddings , each a vector in , and stack them as the rows of a matrix .
Subtract the batch mean to get the centred matrix , whose rows are . The empirical covariance matrix of the batch is
This is the Covariance Matrix of the embeddings. Its diagonal holds the variance of each coordinate, and its off-diagonal entries hold how pairs of coordinates move together. Let its eigenvalues be . Each eigenvalue measures how much the embeddings spread along one principal direction; the eigenvectors are those directions (see Eigenvalues and Eigenvectors).
Two kinds of collapse
Complete collapse. Every embedding is the same vector, so , , and all eigenvalues are zero. The Matrix Rank of is 0.
Dimensional collapse. The embeddings vary, but , or most of the eigenvalue mass sits in a few directions. Because the spread is uneven, a single rank number can hide the problem, so practitioners use an effective rank. With , define
with . This is the exponential of the entropy of the normalised spread. If all directions carry equal variance, . If one direction carries everything, . A healthy encoder has an effective rank close to ; a collapsing one has it close to 1.
Why the losses allow it
A positive-only objective, such as for two views and of the same input, is minimised at , which holds exactly when all embeddings point the same way. Nothing in that loss penalises the constant solution.
The InfoNCE loss used in Contrastive Learning has the form
where is the Cosine Similarity between embeddings, is a temperature, and the positive is the other view of the same image. If every embedding is identical, every , so each term in the fraction equals and the loss is . That is the loss of a model that guesses uniformly among the candidates. Collapse is not a zero-loss solution here, which is why negatives matter.
Non-contrastive methods use a predictor on one branch and a stop-gradient operator on the target, with a loss such as on normalised vectors. Stop-gradient means the target is treated as a constant during backpropagation. Methods of this kind work in practice, but the full reason they avoid collapse is still debated, so treat any single explanation with caution.
Variance and covariance regularisers attack the problem directly. A VICReg-style term penalises any feature dimension whose standard deviation falls below a threshold, and a second term penalises off-diagonal entries of . Both keep the spread across directions high and the correlations between directions low.
Worked examples
Take four unnormalised embeddings in to keep the arithmetic simple. Ignore normalisation for this example.
Case A, a line: , , , .
- The mean is , so no centring is needed.
- Sum of is . Sum of is . Sum of is .
- Divide by : .
- The determinant is , so one eigenvalue is 0. The trace is , so the eigenvalues are and .
- , so .
Interpretation: the points look like two dimensions, but they carry only one. This is dimensional collapse, and the loss would not necessarily notice.
Case B, spread out: , , , .
- Sum of is 2, sum of is 2, sum of is 0. So .
- Both eigenvalues are , so .
- .
Interpretation: the effective rank reaches the full dimension . Case A had effective rank 1 with the same number of points, so the two cases differ only in spread.
Use a batch of images, so there are embeddings. Each anchor has one positive and negatives. Set the temperature .
Collapsed state. All eight embeddings are identical, so every similarity is .
- Each term in the denominator is . There are terms, including the positive.
- The fraction is .
- The loss is for every anchor.
Healthy state. The positive similarity is and the six negatives sit at similarity .
- The positive score is , and each negative score is .
- The loss is . Here , so .
- The loss is .
Interpretation: the collapsed state scores about 1.95 and the healthy state about 0.69, so the loss does punish collapse here. A positive-only loss would not, since both states would score equally well, or the collapsed one would score better.
Tradeoffs and failure modes
Collapse is easy to cause and easy to miss, so the first step is to measure the representation, not only the loss.
| Situation | Problem | Better choice |
|---|---|---|
| Positive-only loss with no predictor or stop-gradient | Complete collapse is a global minimum | Add a predictor with stop-gradient, or a variance and covariance penalty |
| Contrastive loss with very few negatives | Weak push-apart signal, so features stay less discriminative | Larger batch, or a memory queue of past embeddings |
| Loss falls but linear-probe accuracy stays low | Probably dimensional collapse | Check effective rank and per-dimension standard deviation on held-out data |
| Strong variance or decorrelation penalty | Features become noisy and lose class structure | Tune the penalty weights against a downstream check |
| Stop-gradient without an asymmetric predictor | Target and online branch can drift together | Keep the predictor, or follow a published recipe |
Practical checks. Track the mean per-dimension standard deviation of the embeddings and the effective rank of on a fixed held-out batch, every few hundred steps. A sharp drop in either is an early warning. Also check that augmentations are strong enough: weak augmentations make the two views nearly identical, so the task can be solved without learning much.
Edge case. A low but nonzero effective rank can be correct for a dataset with few real factors of variation. Compare against a supervised or randomly initialised baseline before concluding that the encoder is broken.
History
Siamese networks, with two weight-sharing branches compared by a distance, were used for signature verification in the early 1990s. In 2006, Hadsell, Chopra and LeCun wrote down a contrastive loss that pulls matched pairs together and pushes others apart, which is the ancestor of the losses above.
Modern self-supervised vision methods began to use this structure at scale around 2020. SimCLR, published in 2020, uses large batches of augmented views and an InfoNCE-style loss, so its negatives block complete collapse directly. BYOL, also from 2020, showed that negatives were not strictly required, which made the question of what prevents collapse sharper. Later in 2020 and in 2021, SimSiam, Barlow Twins and VICReg each proposed a different non-contrastive route: a predictor with stop-gradient, a cross-correlation objective, and an explicit variance and covariance regulariser.
Dimensional collapse is the name given to the subtler failure, where the embeddings span only a few directions. The exact dates of its naming are uncertain, so this lesson does not give one. Joint-embedding predictive models such as Joint-Embedding Predictive Architecture face the same trivial-solution risk, and their lesson covers the exponentially averaged target encoder that they use against it, described in Exponential Moving Average.
Check yourself
QuestionIn one sentence, what is the difference between complete collapse and dimensional collapse?Show answer
Complete collapse means every embedding is the same vector, so the covariance matrix is zero and its rank is 0. Dimensional collapse means the embeddings vary but spread along only a few directions, so the covariance has rank below the feature dimension or a small effective rank.
QuestionThree embeddings in are , and . Find the covariance matrix, its eigenvalues, and the effective rank.Show answer
The mean is , so the centred points are , and . Every entry of is 2, so . The trace is and the determinant is , so the eigenvalues are and . Then and . The points lie on a line, so the representation is dimensionally collapsed.
QuestionWhy does a positive-only objective allow collapse, while InfoNCE with negatives does not reach zero loss at collapse?Show answer
A positive-only objective such as negative cosine similarity between two views is minimised when all embeddings point the same way, and nothing in it penalises that. InfoNCE includes the other items in the batch in its denominator. When every embedding is identical, each anchor's loss equals , the loss of a uniform guess among the candidates, which is above zero and above the loss of any state that separates the examples. The negatives therefore make collapse a poor solution.
QuestionA self-supervised encoder's training loss drops steadily, but a linear classifier on its features is only slightly better than chance. Which check would you run first, and what would you do if it showed a problem?Show answer
Measure the per-dimension standard deviation and the effective rank of the covariance matrix on a held-out batch. If both are low, the encoder has collapsed or nearly collapsed, despite the loss. Fixes include adding negatives or a larger batch, using a predictor with stop-gradient, adding a variance and covariance penalty, or strengthening the augmentations so the two views differ more.
Sources
- A Simple Framework for Contrastive Learning of Visual Representations (Chen et al., 2020)
- Bootstrap Your Own Latent (Grill et al., 2020)
- Exploring Simple Siamese Representation Learning (Chen and He, 2020)
- Barlow Twins: Self-Supervised Learning via Redundancy Reduction (Zbontar et al., 2021)
- VICReg: Variance-Invariance-Covariance Regularization for Self-Supervised Learning (Bardes, Ponce, LeCun, 2021)