Neural Collapse
The symmetric geometry that last-layer features converge to at the end of training.
Keep training a classifier after it gets every training example right, and its last layer becomes strangely tidy. Each example's features shrink onto its class mean, the class means spread into the most symmetric arrangement possible, and the classifier's weights line up with them. This is neural collapse: a geometry that recurs across datasets and architectures, and that a simple model of the last layer explains exactly.
What you’ll learn
- State the four neural-collapse properties NC1–NC4 precisely, with the statistics used to measure them.
- Derive the geometry of a simplex equiangular tight frame, including the cosine , and show that it is the most separated arrangement of equal-norm vectors.
- Prove that in the norm-constrained unconstrained-features model with balanced classes, cross-entropy is minimized exactly by collapsed configurations, and state the landscape result under weight decay.
- Describe collapse under squared error, class imbalance, intermediate layers and language models, and weigh the evidence on what it implies for generalization and transfer.
The terminal phase of training
Papyan, Han and Donoho (2020) followed classifiers into the terminal phase of training: the epochs after the training error first reaches zero, while the cross-entropy keeps falling toward zero. Across seven standard image datasets and three standard architectures they measured the same four phenomena in the last layer. Write for the last-layer features of example of class ( per class, classes), for the class means, for the global mean, and for the classifier's row for class .
In words: the last layer turns into a perfect, maximally symmetric code. Every class is a single point, the points are as far apart as points of equal norm can be, and the linear classifier is just a template-matching rule against those points. Papyan et al. argued that this simple geometry benefits generalization, robustness and interpretability; how far that is true is the subject of the last step.
The simplex equiangular tight frame
Take unit vectors with a common pairwise inner product . Centering means they sum to zero, so
The same identity shows this is the most separated arrangement possible. For any unit vectors, forces the average pairwise cosine to be at least , so the most similar pair always has cosine . The simplex equiangular tight frame (simplex ETF) attains this with equality for every pair at once.
In matrix form, with any having orthonormal columns, has exactly this Gram matrix. Its columns span a -dimensional subspace, so the frame needs , and is a multiple of the projection onto that subspace: the frame is tight.
For the means are opposite (); for they sit at the corners of an equilateral triangle (); for , a regular tetrahedron (). As grows the angle approaches : many classes can be nearly orthogonal, but never more than slightly obtuse.
A network trained to collapse on CIFAR-10 ( classes). What cosine similarity do any two centered class means approach?
Show the answer
-0.11
, an angle of about . Each class mean is slightly further than orthogonal from every other, the best that ten equal-norm, zero-sum vectors can do.
Why: the unconstrained features model
A deep network is so flexible that its last-layer features can be placed almost anywhere. The unconstrained features model (Mixon, Parshall & Pi, 2020) takes this literally: treat the features as free variables, optimized together with the classifier. Fang, He, Long and Su (2021) called the version with norm constraints the layer-peeled model, since it peels the top layer away from the rest of the network. With examples:
For example of class with logits , apply Jensen's inequality to the average of the exponentials ( is convex):
With , the argument equals . Since is convex and increasing, Jensen again over all examples, then Cauchy–Schwarz, give
Balance gives , so a bound that no configuration can beat:
Equality forces collapse. Cauchy–Schwarz is tight only if with one constant , and the norm bound only if : features equal their class's classifier row (NC1, NC3). The first Jensen step is tight only if each example's wrong-class logits are all equal, and the second only if all margins are equal. Equal norms, equal pairwise inner products and zero sum: the rows of form a simplex ETF (NC2), and NC4 follows. Conversely the ETF configuration attains the bound, which is why is needed.
The landscape result matters: gradient descent with small random perturbations escapes strict saddles, so in this model training finds collapse from almost any start. The model's weakness is its premise. Real features are computed by a network from the inputs and cannot be placed freely, and the model says nothing about test data, on which the network never trained.
Beyond the balanced, cross-entropy case
- Squared error. Collapse is not special to cross-entropy. Han, Papyan and Donoho (2022) observed it with the mean squared error loss across three architectures and five datasets. They split the loss into a part that assumes the classifier is the least-squares optimum for the current features and a part measuring its deviation; the second part stays negligible in training, which motivates the "central path", along which they derived exact dynamics that predict collapse.
- Imbalanced classes. In the layer-peeled model with many examples per majority class and few per minority class, Fang et al. (2021) found minority collapse: as the imbalance ratio grows, the minority classes' classifier vectors converge to one another, so the model can no longer tell those classes apart, however long it trains. They confirmed the effect in real networks, and it is one more reason for the rebalancing methods of Reshaping Cross-Entropy.
- Intermediate layers. Separation by class does not appear only at the end. He and Su (2023) found that, across architectures and datasets, each layer improves a measure of class separation by a roughly constant factor, so separation improves geometrically with depth, and Hui, Belkin and Nakkiran (2022) report a partial "cascading" collapse in earlier layers.
- Language models. Next-token prediction breaks every textbook condition for collapse: the vocabulary is imbalanced and much larger than the embedding width, so no simplex ETF can even exist (); the same context can be followed by different tokens; and models see their data for only a few epochs. Wu and Papyan (2024) nevertheless found collapse-like properties emerging with scale and regularization in causal language models, tracking better generalization.
A language model has a vocabulary of 50,000 tokens and a final hidden width of 4,096. Why can its output embeddings not form a simplex ETF?
- Its loss is not cross-entropy
- A simplex ETF of vectors spans dimensions, and is far more than
- Simplex ETFs exist only for even
- Its classes are balanced
Show the answer
B. A simplex ETF of vectors spans dimensions, and is far more than
The ETF's Gram matrix has rank , so it needs . With the vectors can at best be spread "as evenly as possible" in dimensions, and how close trained models come is an empirical question.
What collapse does and does not explain
The geometry is robustly reproduced on training data; its meaning is debated.
- An optimization phenomenon? Hui, Belkin and Nakkiran (2022) separated collapse of the training features from collapse on the test distribution. They found the first common and the second absent, and concluded that neural collapse is primarily an optimization phenomenon with unclear connections to generalization. They also found that training longer can make the last-layer features transfer worse to downstream tasks: collapse is not always desirable for representation learning.
- A route to transfer? Galanti, György and Hutter (2022) argued, theoretically and empirically, that collapse carries over to new samples of the training classes and to new classes, which would explain why features of large classifiers work so well for few-shot transfer.
- A design prior. If the classifier converges to a simplex ETF anyway, it can be fixed at one from the start. Zhu et al. (2021) report that a fixed ETF classifier with feature dimension equal to the number of classes cut memory use for a ResNet-18 by more than 20% without hurting generalization.
Key takeaways
- In the terminal phase of training, last-layer features collapse onto their class means (NC1), the centered means form a simplex ETF (NC2), the classifier rows align with them (NC3), and classification reduces to the nearest class mean (NC4).
- A simplex ETF of equal-norm, zero-sum vectors has pairwise cosine , the most separated arrangement possible, and needs dimensions.
- In the unconstrained-features model with balanced classes, cross-entropy is minimized exactly by collapsed configurations (under norm constraints or weight decay with ), and for the landscape has no spurious local minima.
- Collapse also appears with squared error and partly in intermediate layers and language models; imbalance causes minority collapse.
- Collapse on training data is robust, but its links to generalization and transfer are contested: test features often do not collapse, and over-collapsed features can transfer worse.
Check yourself
In the interactive lesson these are scored with your confidence, and what you miss comes back for review.
What does NC1, variability collapse, state?
- The class means converge to the origin
- The within-class covariance of the last-layer features vanishes relative to the between-class covariance
- The classifier weights converge to zero
- The training loss reaches exactly zero
Show the answer
B. The within-class covariance of the last-layer features vanishes relative to the between-class covariance
NC1 says each example's features converge to its class mean, measured by . The means themselves spread out into a simplex ETF (NC2).
With classes, what pairwise cosine do the centered class means of a collapsed network approach?
Show the answer
C.
Equal norms and a zero sum force , so , an angle of about .
In the layer-peeled (unconstrained features) model with balanced classes and norm constraints, which statement is proved?
- Every minimizer of the cross-entropy has collapsed features, with classifier rows forming a simplex ETF
- Collapse occurs on the test set as well as the training set
- Collapse requires the squared-error loss
- The minimizers depend on the training inputs
Show the answer
A. Every minimizer of the cross-entropy has collapsed features, with classifier rows forming a simplex ETF
Two applications of Jensen's inequality and one of Cauchy–Schwarz give a lower bound on the loss that is attained exactly, and only, by collapsed simplex-ETF configurations.
What is "minority collapse" (Fang et al., 2021)?
- Minority-class features collapse to their class means faster than majority features
- The network stops predicting the majority classes
- As the imbalance grows, the classifier vectors of the minority classes converge to one another, so those classes become indistinguishable
- The training loss on minority classes reaches zero first
Show the answer
C. As the imbalance grows, the classifier vectors of the minority classes converge to one another, so those classes become indistinguishable
In the layer-peeled model with imbalanced classes, the minority classes' classifier rows move together as the imbalance ratio grows, so the model loses the ability to separate them, however long it trains.
Further reading
- V. Papyan, X. Y. Han & D. L. Donoho, "Prevalence of neural collapse during the terminal phase of deep learning training," PNAS 117 (2020).
- D. G. Mixon, H. Parshall & J. Pi, "Neural collapse with unconstrained features," arXiv:2011.11619 (2020).
- C. Fang, H. He, Q. Long & W. J. Su, "Exploring deep neural networks via layer-peeled model: Minority collapse in imbalanced training," PNAS 118 (2021).
- Z. Zhu, T. Ding, J. Zhou, X. Li, C. You, J. Sulam & Q. Qu, "A geometric analysis of neural collapse with unconstrained features," NeurIPS (2021).
- X. Y. Han, V. Papyan & D. L. Donoho, "Neural collapse under MSE loss: Proximity to and dynamics on the central path," ICLR (2022).
- L. Hui, M. Belkin & P. Nakkiran, "Limitations of neural collapse for understanding generalization in deep learning," arXiv:2202.08384 (2022).