Feature Collapse

Thomas Laurent, James von Brecht, Xavier Bresson

Introduction

Deep learning relies on the premise that neural networks learn "good features"—representations that retain task-relevant information while discarding irrelevant noise. However, a rigorous mathematical definition of a "good feature" has historically remained elusive.

This paper formalizes a phenomenon known as feature collapse. While the well-documented "neural collapse" describes how inputs of the same class converge to a single point at the last layer of a network, feature collapse focuses on the early layers. It is the process by which a network learns to map different inputs that share similar semantic roles (e.g., different words representing the same underlying concept) to nearly identical representations.

The Synthetic Data Model

To study feature collapse under controlled, mathematically tractable conditions, the authors design a synthetic "sentence" classification task.

They define a vocabulary where words are partitioned into latent "concepts." For example, the words "potato," "carrot," and "leek" all belong to the "veggie" concept. Sentences are then generated from sequences of these latent concepts. Crucially, replacing a word in a sentence with another word from the same concept does not change the sentence's overall class label.

Synthetic data model illustrating how words are generated from latent concepts to form classifiable sentences.

The researchers compare two simple two-layer linear network architectures on this task:

  1. Standard Network ($h$): A shared embedding layer followed by a linear classification head.
  2. LayerNorm Network ($h^*$): Identical to the standard network, but with a Layer Normalization module applied to the word embeddings before they reach the classifier.

The Frequency Bias and LayerNorm

The study evaluates these networks across different data distributions, mimicking the statistical properties of natural language. They test a uniform case (all words appear equally) and a long-tailed case (following Zipf's law, where a few words are extremely common and most are rare).

A key insight from the paper is the discovery of a frequency bias in standard networks. Without LayerNorm, the magnitude of a word's learned embedding depends heavily on its frequency in the training data. Frequent words develop large embeddings, while rare words receive small ones. This disparity prevents "full collapse" and severely harms generalization, as the network treats rare words as less important even if they play the exact same semantic role as frequent ones.

LayerNorm acts as a critical leveler. By forcing all word representations to maintain the same magnitude, it eliminates the frequency bias. This allows the network to achieve full feature collapse, even when trained on highly skewed, long-tailed data distributions.

Key Results and Generalization

The theoretical and empirical results demonstrate a strong link between feature collapse and a model's ability to generalize:

  • Uniform Distribution: Both networks achieve 100% test accuracy and exhibit perfect feature collapse. Words belonging to the same concept map to the exact same vector space.
  • Long-Tailed Distribution (Large Data): Both networks generalize well, but the standard network only achieves "directional collapse"—embeddings point in the same direction but vary in length based on word frequency.
  • Long-Tailed Distribution (Small Data): Under data scarcity, the standard network's accuracy plummets to 45%. It fails to collapse features because the noise from word frequencies overwhelms the latent concept signal. In contrast, the LayerNorm network maintains 100% accuracy and successfully collapses the features.
Visualization of perfect feature collapse, where embeddings tightly cluster into distinct groups corresponding to their latent concepts.

The authors back these empirical findings with mathematical proofs, showing that in the large sample limit, the LayerNorm network provably learns to assign identical embeddings to tokens that play identical roles.

Conclusion

By formalizing feature collapse, this research provides a clearer theoretical understanding of how early network layers build meaningful, interpretable representations. While the proofs focus on simple linear networks, preliminary evidence suggests these principles extend to complex architectures like Transformers, highlighting the fundamental role of normalization techniques in modern deep learning.

Summary updated

BibTeX
@inproceedings{laurent2024feature,
  author = {Thomas Laurent and James von Brecht and Xavier Bresson},
  title = {{Feature Collapse}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
}
Figure