← All posts

Diagnosing representation collapse

Post 1 of 1

Zero loss, empty representation

Posts in this series · 1

Train a classifier and the labels keep it honest: there is an external answer it has to match. Joint-embedding self-supervised methods have no such anchor. They hide part of an input, predict the hidden part’s representation from the visible part, and score the prediction against the encoder’s own output. Both sides of the comparison are produced by the thing being trained.

That creates a shortcut. If the encoder maps every input to the same vector, the prediction is exact and the loss is zero. The constant encoder is not a local minimum the optimizer stumbles into; it is a global optimum of the objective, sitting in the open, available from the first step.

The stop-gradient, the moving-average target and the explicit distribution regularizer all exist to keep training away from it. What follows is what “degenerate” actually means, the linear algebra you need to read it off a run, and why the most convenient diagnostics are the ones most likely to tell you everything is fine.

The energy picture

The cleanest framing is the energy-based one. Think of a scalar energy assigned to each pair of inputs: low when they are compatible, high when they are not. Training should carve a landscape with valleys on the data manifold and high ground elsewhere.

A purely predictive loss can reach its minimum in two ways. It can learn structure, so that energy is low exactly where it should be. Or it can flatten the landscape, so energy is low everywhere. The second is degeneracy, and the loss cannot tell you which happened.

This also explains a failure that has nothing to do with the encoder. If the predictor takes a latent variable with too much capacity, it can map any context to any target. Energy becomes low off the manifold as well as on it, and nothing has collapsed in the encoder at all. The discrimination has collapsed. This is why formulations of joint-embedding architectures insist on limiting the information content of that latent.

The one object every diagnostic is computed on

Before the failure modes, the algebra. Suppose you push N inputs through an encoder f and stack the outputs as rows. For the sake of something concrete, say 10,000 driving clips encoded to 256 dimensions each:

Z∈RN×d,zi=f(xi)∈RdZ \in \mathbb{R}^{N \times d}, \qquad z_i = f(x_i) \in \mathbb{R}^{d}
The embedding matrixA grid with one row per input clip and one column per embedding dimension. A highlighted row is a single clip's embedding vector. A highlighted column is one feature read across every clip.dim 1dim 2dim 3⋯dim 256clip 00001clip 00002clip 00003⋮clip 10000a row is one clip, described by 256 numbersa column is one feature, measured across 10,000 clips

Rows answer “what is this clip?”. Columns answer “what does this feature respond to?”

Same numbers, two readings. Rank questions live in the row view, correlation questions in the column view.

Figure 1. The embedding matrix. Every diagnostic in this post is a statement about this one matrix. Schematic.

Read a row and you are asking what the encoder thinks about one clip. Read a column and you are asking what one feature responds to. Sort it and you get the clips that excite that coordinate most. Rank questions are easiest in the row view, correlation questions in the column view.

Two derived objects. The mean μ is the column-wise average, a single vector in the same space as the embeddings: the “average input” according to the encoder. It is rarely near zero, and that will matter later. The covariance is

C=1NZˉ⊤Zˉ∈Rd×d,Zˉ=Z−1μ⊤C = \tfrac{1}{N}\bar{Z}^{\top}\bar{Z} \in \mathbb{R}^{d \times d}, \qquad \bar{Z} = Z - \mathbf{1}\mu^{\top}

Tiny example with two features over three clips, centred columns (1,0,−1)(1, 0, -1) and (2,0,−2)(2, 0, -2): C12=(1⋅2+0+(−1)(−2))/3=4/3C_{12} = (1 \cdot 2 + 0 + (-1)(-2))/3 = 4/3. Positive, because the two features rise and fall together.

Note the shape change: Z is 10,000 × 256, but C is 256 × 256. The dataset dimension has been summed away. C is not about clips any more; it is a table of relationships between features. Entry Cjk takes column j and column k, centres both, multiplies elementwise and averages. It answers this question: across the dataset, when feature j runs above its average, does feature k do the same?

Reading the covariance matrix cell by cellTwo five by five grids. In the first only the diagonal is dark: every feature varies and none move together. In the second several off-diagonal cells are shaded, meaning groups of features carry duplicated information.feature kfeature jDecorrelatedoff-diagonals near zeroRedundantfeatures duplicating each other

Diagonal is a feature’s variance; off-diagonal is variation two features share

Figure 2. What one cell of the covariance means. The diagonal is a feature’s own variance; off-diagonal entries are variation two features share. Schematic.

Eigenvalues are variances

C is symmetric and positive semi-definite, and that second property has a concrete reading worth internalising. For any unit vector v, project every embedding onto v and take the variance of those N numbers:

Var⁡(Zˉv)=v⊤Cv  ≥  0\operatorname{Var}(\bar{Z}v) = v^{\top} C v \;\ge\; 0

So the quadratic form vᵀCv is “how much do my embeddings spread along direction v”. It is non-negative because variance cannot be negative. That is all positive semi-definite means here.

Now ask which direction has the most spread. Maximising vᵀCv over unit vectors gives the top eigenvector u₁, and the maximum value is the top eigenvalue λ₁. Repeat in the orthogonal complement for u₂, λ₂, and so on. The spectral theorem says this works cleanly for symmetric matrices:

C=UΛU⊤,U⊤U=I,Λ=diag⁡(λ1≥⋯≥λd≥0)C = U\Lambda U^{\top}, \qquad U^{\top}U = I, \qquad \Lambda = \operatorname{diag}(\lambda_1 \ge \dots \ge \lambda_d \ge 0)

Picture a rugby ball: u1u_1 points along its long axis with a large λ1\lambda_1, and u2u_2, u3u_3 point across it with smaller values.

λᵢ is the variance along direction uᵢ. That one sentence is why eigenvalue spectra became the standard collapse diagnostic: it turns an abstract algebra question into “how fat is the cloud in each direction”.

Covariance eigenvectors are the axes of the data ellipseA tilted cloud of embeddings with an ellipse fitted to it. Two arrows leave the mean along the ellipse axes: a long one for the direction of greatest variance and a short one for the least.u₁ · most variance, √λ₁u₂ · least variance, √λ₂mean

Ask “how much do embeddings spread along this direction?” and the answer is an eigenvalue

The eigenvectors are orthogonal, so they form a frame in which the covariance is diagonal and the cloud is axis-aligned.

Figure 3. Eigenvectors are the axes of the data ellipse. In the eigenframe the covariance is diagonal and the cloud is axis-aligned, with semi-axis lengths the square roots of the eigenvalues. Schematic.

Papers say “singular value” where you expected “eigenvalue” because the two are the same information in different clothes. Writing Z̄ = UΣVᵀ gives C = (1/N)·VΣ²Vᵀ, so λᵢ = σᵢ²/N. In practice take the SVD of the embedding matrix directly rather than forming C: squaring the matrix squares the condition number and destroys precision exactly in the small-eigenvalue tail you care most about.

Coordinates are arbitrary, and that has consequences

Nothing in this kind of training makes “dimension 37” mean anything. Which coordinate ends up carrying rain or traffic density is an accident of initialisation, and the information is smeared across coordinates.

A rotation is a change of measuring rulers. The cloud sits fixed; you choose a different frame to describe it in. Distances, angles and shape are unchanged. Only the numbers you write down change.

The same cloud described in two coordinate framesTwo panels holding the identical tilted cloud. On the left the rulers are the encoder output units; on the right they are the eigenvectors. One highlighted point is projected onto each frame. The points do not move.unit 1unit 2u₁u₂Encoder coordinatesEigen-coordinatesthe point reads (−24, −31)the same point reads (−35, −18)

Distances and angles are unchanged. Only the numbers written down change.

Figure 4. A rotation changes the rulers, not the cloud. The highlighted point is one input, described twice. Schematic.

Concretely, u₁ is a 256-long vector of weights. Think of it as a recipe. Applying it, u₁ᵀzᵢ, gives one number per input: a synthetic feature built as a weighted blend of all 256 coordinates. The eigendecomposition picks the recipe whose outputs have the largest spread, then the next largest orthogonal to it.

Worth saying plainly: there is no guarantee eigenvectors align with human concepts. They are directions of maximum variance, and variance is not semantics. If your dataset has wildly varying camera exposure, u₁ will be exposure. This is a real failure mode when people over-read PCA plots of embeddings.

The split that matters for diagnostics is what survives a rotation:

That is why a method like VICReg needs two separate terms. Its variance term pushes the diagonal of C up so every coordinate actually varies; its covariance term pushes off-diagonal entries down so coordinates stop duplicating each other. Both are frame-dependent by construction: together they push the encoder’s own output axes towards being the eigenframe with equal variance along each. Diagonalising without equalising still permits a spectrum cliff; equalising without diagonalising still permits redundancy.

Degeneracy is a family, not a state

With the algebra in place the failure modes separate cleanly.

Four states a representation can be inFour point clouds. A healthy cloud fills the space. A dimensionally collapsed cloud is flattened onto a line. A cone-anisotropic cloud keeps its spread but points one way from the origin. A completely collapsed cloud is a single point. Shape here is schematic, not measured data.HealthyDimensionalConeCompleteall directions usedspread on one linespread, one headingone point, no info

Only the fourth is what “collapse” usually brings to mind

The middle two keep a healthy-looking spread and still lose the structure retrieval depends on.

Figure 5. Four shapes a representation can take. Only the last is what “collapse” usually brings to mind. Schematic.

Complete collapse. The constant encoder. Covariance is zero in every direction; rank is zero.

Dimensional collapse. Variation survives but occupies a few directions out of many. A nominally 256-dimensional embedding might effectively live in twelve. Jing et al. attribute this to implicit regularisation in gradient descent rather than to the loss having a bad optimum. Broad distinctions survive, fine ones do not, which is the worst case for search: the rare item you most wanted to find lands on top of a common one.

Informational collapse. Full rank, but heavily correlated coordinates create redundant dimensions. Distinct from dimensional collapse in that per-coordinate variance is preserved. This is the failure VICReg’s covariance term targets.

Latent-variable degeneracy. The predictor-side failure from earlier: energy low off the manifold because the latent carries too much capacity. The encoder need not collapse at all.

Cluster collapse. In prototype-based methods, every sample routed to one prototype.

One term worth separating: neural collapse (Papyan, Han and Donoho) is a different phenomenon. In the terminal phase of supervised training, class means converge to a simplex equiangular tight frame. Reviewers conflate it with the above often enough that it is worth a footnote in anything you write.

A methodological point that matters more than it sounds: measure at the right layer. In methods with a projector, the loss lives in projector space and the backbone can retain rank while the projector collapses, or the reverse. In predictive architectures you have a context encoder, a target encoder and a predictor, and degeneracy can be asymmetric across them.

Reading a spectrum

The standard figure plots log λᵢ against index, sorted descending. The log axis is not cosmetic: healthy spectra span many orders of magnitude and a linear axis flattens every interesting eigenvalue against zero.

Two eigenvalue spectra on a log axisOne curve decays gradually across every index. The other falls off a cliff after the first few indices and then flattens near the numerical floor, which is dimensional collapse.log λᵢgradual decayrank cliffthe red cloudeigenvalue index i

The cliff is dimensional collapse: a handful of directions carry everything

Log scale is not cosmetic. On a linear axis the whole tail is flattened against zero by the first eigenvalue.

Figure 6. Gradual decay against a rank cliff. The cliff is dimensional collapse: a handful of directions carry everything and the rest sit at numerical noise. Schematic.

Rank itself is discrete and brittle. The flattened cloud almost never has an exactly-zero eigenvalue; it has λ₂ ≈ 10⁻⁹. Technically full rank, effectively one-dimensional. Every “effective rank” measure exists to give a continuous, threshold-free answer instead:

stable rank=∑iσi2σ12,RankMe=exp⁡ ⁣(−∑ipilog⁡pi),  pi=σi∑jσj\text{stable rank} = \frac{\sum_i \sigma_i^2}{\sigma_1^2}, \qquad \text{RankMe} = \exp\!\Big(-\sum_i p_i \log p_i\Big),\; p_i = \frac{\sigma_i}{\sum_j \sigma_j}

Example with three directions: σ=(1,1,1)\sigma = (1, 1, 1) gives stable rank 3 and RankMe 3. With σ=(1,0.01,0.01)\sigma = (1, 0.01, 0.01), stable rank is 1.0002/1≈11.0002 / 1 \approx 1, and RankMe is about 1.1.

RankMe is the exponentiated Shannon entropy of the normalised singular values: mass on one direction gives about 1, mass spread evenly over k gives about k. It is the continuous relaxation of counting non-zeros. A related diagnostic fits λᵢ ∝ i−α and reports the exponent. For predictive architectures specifically, LiDAR was built because entropy-of-spectrum measures underperform there, using a discriminant-style rank in predictor space.

Here is the structural catch. Every one of these is a ratio. Scale cancels. If a representation shrinks toward numerical noise, that noise is isotropic, and isotropic noise has excellent rank. A ratio-valued diagnostic can rise while a representation dies, not because it malfunctioned but because it answered the question it was asked, which was about shape, at a moment when the informative question was about magnitude. Read any rank number beside total variance, never instead of it.

Rank is not the whole story: angular structure

Retrieval using cosine similarity discards norms entirely. Only angles survive to influence the ranking, and angle is a different axis from rank.

Angular structure and the pairwise cosine distributionThree unit circles. In the first, every embedding points one way and all pairwise cosines pile up at one. In the second, embeddings spread but stay inside a narrow cone, so cosines concentrate in a high band. In the third, embeddings spread around the circle and cosines spread across the range. Schematic, not measured data.Complete collapseCone anisotropyAngular spread−11−11−11

The bar is where pairwise cosines land. Retrieval ranks inside that band and nowhere else.

Figure 7. Where the pairwise cosines land. Retrieval ranks inside that band and nowhere else. Schematic.

The canonical decomposition is Wang and Isola’s alignment and uniformity: alignment is the expected distance between positive pairs, uniformity measures how close the embedding distribution is to uniform on the sphere. Complete collapse is uniformity at its worst; the simplex frame of neural collapse is maximal angular separation. Most degenerate solutions sit somewhere on that axis.

Rank metrics are global and linear. Retrieval only cares about the ordering of angles in each query’s neighbourhood. This is a local, ordinal property. These come apart. The clearest symptom is hubness: in high-dimensional angular spaces a few points appear in a disproportionate share of nearest-neighbour lists, which you can check directly by counting how often each item appears in others’ top-k.

A caution about the third panel: it is a 2D cartoon of something that behaves differently at real dimensionalities. In high d, random unit vectors are near-orthogonal by default, so cosines concentrate near zero with variance about 1/d even under a random encoder. Angular spread is the null hypothesis, not the achievement. What distinguishes a good representation is positive-pair mass sitting well above that concentration.

Centering decides which object you measured

This is the piece that most often explains two diagnostics disagreeing about the same encoder.

Centering changes which object a rank diagnostic measuresThe same cloud read two ways. Participation ratio subtracts the mean first, so it sees only the spread and is blind to where the cloud sits. RankMe works on the raw embeddings, so the mean contributes a rank-one term to the spectrum it measures. Schematic.originmean μRankMe · raw embeddingsμ contributes to the spectrumParticipation ratio · centeredμ subtracted, then measured− μ

Same cloud, same shape, different reading. Translation is invisible to one and not the other.

Figure 8. Translation is invisible to one diagnostic and not the other. Schematic.

Covariance-based measures subtract the mean first, so they describe spread and nothing else. Measures computed on the raw embedding matrix keep the mean, which contributes a rank-one term to the spectrum. Algebraically the two second-moment matrices differ by exactly that:

1NZ⊤Z=C+μμ⊤\tfrac{1}{N}Z^{\top}Z = C + \mu\mu^{\top}

In words: raw spread = spread around the centre + where the centre is.

So a representation can have a beautiful centered spectrum while the uncentered one is dominated by a single rank-one term. That is the cone: every embedding pointing roughly the same way from the origin, documented as anisotropy in language models by Ethayarajh among others. Since retrieval never centers, cosine ranking is then decided by a thin residual. Computing the spectrum both ways and reading the gap tells you how much of your apparent structure is just the mean.

Whitening closes the loop: transform z̃ = C−1/2(z − μ) so the new covariance is the identity. All eigenvalues are equal, and the condition number is one. This is the operation behind Barlow Twins driving a cross-correlation matrix to identity, and behind post-hoc “all-but-the-top” fixes. It is also why near-zero eigenvalues are dangerous beyond rank counting: inverting one amplifies noise, which is why these methods regularise the inverse.

Two families of fix

Methods divide by where they put the solution, and it is worth knowing which camp a method is in before claiming anything about it.

Dynamics. BYOL, SimSiam and predictive architectures leave the degenerate optimum in the landscape and rely on the optimisation trajectory not reaching it. Stop-gradient, the moving-average target and the predictor create a system whose trajectories avoid collapse; Tian et al. analyse this in terms of predictor eigenspace alignment. Collapse-avoidance here is an optimization property.

Landscape. VICReg and Barlow Twins instead remove the degenerate optimum by construction, adding terms that are large exactly when the representation degenerates.

Which camp a method belongs to determines whether a claim about it is a stability claim or a loss-design claim, and reviewers will ask.

What to measure

The useful summary is not a ranking of metrics but a note of which axis each one can see.

What each measurement is sensitive to, by definitionA property table. Total variance and mean feature std are scale-sensitive. Mean pairwise cosine and retrieval precision are direction-sensitive. Participation ratio and RankMe are sensitive to neither, because both are ratios of spectra. The probe and retrieval rows need labels. These are definitional properties of each quantity, not experimental results.MEASUREMENTSCALEDIRECTIONLABELSTotal varianceMean feature stdMean pairwise cosineParticipation ratioRankMeLinear probe, standardizedLinear probe, unstandardizedRetrieval P@10●NoNo●NoNoNo●NoNoNoNoNoNoNoNoNo●●No●No●●

Both rank measures are blind to scale and to direction because they are ratios of a spectrum

That is the reason neither can serve as a collapse detector on its own, and why each is read beside total variance.

Figure 9. Definitional properties, not experimental results. Each mark follows from how the quantity is computed. Schematic.

A practical logging set, with the reason each earns its place:

The underlying rule is simple enough to state in one line: a metric can only detect a failure along an axis it is sensitive to. Scale-invariant measures cannot see a loss of scale; rotation-invariant measures cannot see a bad choice of frame; centered measures cannot see a drifting mean. None of them are wrong. They are answering a question that is not the one collapse happens to be posing.

If you take one thing: no single number establishes that a representation is healthy. “Did it collapse” is the wrong question; “which of these failure modes happened, and which of my measurements could even have seen it” is the one that leads somewhere.