Formation of Representations in Neural Networks

Liu Ziyin, Isaac L. Chuang, Tomer Galanti, Tomaso A Poggio

Abstract & TL;DR

Understanding neural representations is crucial for opening the black box of modern AI systems. This paper introduces the Canonical Representation Hypothesis (CRH), a theoretical framework proposing that neural networks naturally align their internal representations, weights, and gradients during training. By balancing the "push" of gradient noise against the "pull" of regularization, networks converge toward compact, structured solutions that unify previously separate deep learning phenomena, such as "neural collapse" and the "neural feature ansatz."

The Representation Problem

Despite the massive success of deep learning, the internal organization of data within neural networks remains largely a mystery. While it is understood that data becomes more abstract as it passes through layers, there has been no universal law explaining the relationship between a layer’s activations (R), its weights (W), and the gradients (G) that update it.

Previous research has identified isolated patterns—such as "Neural Collapse" (where last-layer features simplify into geometric structures) or the "Neural Feature Ansatz" (which relates weight updates to data features). However, these were often treated as separate quirks of specific architectures or tasks. This work seeks a unified theory of representation formation applicable across diverse models, from simple Multilayer Perceptrons (MLPs) to massive Transformers.

Proposed Methods: CRH and PAH

The authors propose two primary hypotheses to explain representation formation:

  1. Canonical Representation Hypothesis (CRH): This posits six specific "alignment relations." Essentially, it suggests that the covariance matrices of representations ($H$), weights ($Z$), and gradients ($G$) should become proportional to one another during training (e.g., $H \propto G \propto Z$).
  2. Polynomial Alignment Hypothesis (PAH): Recognizing that perfect alignment does not always occur, the authors propose that when CRH is "broken," these quantities instead follow reciprocal power-law relations (e.g., $H \propto G^\alpha$).
Covariance matrices of representations, weights, and gradients showing strong visual alignment.

To prove why this alignment happens, the authors utilize a noise-regularization balance theory. Inspired by the fluctuation-dissipation theorem in physics, they argue that Stochastic Gradient Descent (SGD) noise "expands" the representation while weight decay (regularization) "contracts" it. At equilibrium, these opposing forces drive the weights and representations to align with the most informative gradient directions.

Experimental Validation

The authors validated their theory across a diverse set of environments:

  • Vision: ResNet-18 trained on CIFAR-10 and CIFAR-100 (both supervised and self-supervised).
  • Language: A 6-layer, 100M-parameter Transformer trained on the OpenWebText (OWT) corpus.
  • Synthetic: Custom-built "teacher-student" networks used to isolate the effects of hyperparameters like width, depth, and weight decay strength.

Key Insights

  • The "Universal" Law: Alignment is not a fluke; it is a mathematical necessity of stable training under SGD and weight decay. If a direction in the data does not contribute to the gradient, the noise-regularization balance eventually "zeros it out," leading to a compact representation.
  • Unification of Deep Learning "Lore": The authors demonstrate that Neural Collapse is simply the CRH occurring in the final layer of a classifier. Similarly, the Neural Feature Ansatz is essentially a "finite-time" version of their alignment equations.
  • Phases of Learning: Similar to phases of matter, neural network layers exist in different "phases" defined by their power-law exponents. The study identifies at least 9 distinct phases where different scaling laws govern how features are emphasized or suppressed.
  • Invariance by Design: When CRH holds, the network becomes naturally invariant to task-irrelevant transformations. If a change in input does not alter the loss, the alignment ensures the internal representation ignores that change.

Key Results

  • Empirical Proof of Alignment: In ResNets and Transformers, the authors measured the Pearson correlation ($\alpha$) between the covariance matrices of $H$, $G$, and $Z$. They found remarkably high alignment ($\alpha > 0.7$) that steadily improves as training progresses.
Alignment metric alpha increasing over epochs in the last layer, demonstrating the emergence of CRH.
  • Predictive Power Laws: In Transformers, different layers follow specific power-law exponents (1, 2, or 3) for the relationship between representations and gradients, exactly as predicted by the PAH framework.
  • Depth and Alignment: Alignment tends to be stronger in deeper layers. This suggests that the "tunnel effect"—where representations become increasingly compressed and structured—is a direct result of these alignment laws.
  • The Role of Weight Decay: The strength of the alignment is directly tied to weight decay. Without sufficient regularization, the balance is lost, and structured representations fail to emerge.

Limitations and Future Work

  • Architecture Constraints: The current theory is primarily derived for and tested on fully connected (linear) layers. While some results for convolutional layers are shown, a more rigorous extension to CNNs and Attention mechanisms is needed.
  • Final State vs. Trajectory: The paper focuses on the final stage of training (stationarity). It does not yet fully explain the "middle" of the training process where the most rapid learning occurs.
  • Algorithmic Applications: While the paper is theoretical, it hints at practical uses. For example, manually injecting noise into specific gradient directions to "force" the model to learn more interpretable or robust features remains an open question for future engineering research.

Summary updated

BibTeX
@inproceedings{ziyin2025formation,
  author = {Liu Ziyin and Isaac L. Chuang and Tomer Galanti and Tomaso A Poggio},
  title = {{Formation of Representations in Neural Networks}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=Njx1NjHIx4},
}
Figure