Formation of Representations in Neural Networks

Liu Ziyin, Isaac Chuang, Tomer Galanti, Tomaso Poggio

TL;DR

This paper introduces the Canonical Representation Hypothesis (CRH), proposing that a neural network's latent representations, weights, and gradients mutually align during training due to a fundamental balance between gradient noise and weight decay. When this perfect alignment breaks down, it does so predictably, following reciprocal power laws described by the Polynomial Alignment Hypothesis (PAH). This framework successfully unifies major deep learning phenomena, such as neural collapse and the neural feature ansatz, under a single theoretical umbrella.

What Problem Does This Paper Address?

Despite the massive success of deep learning, how neural networks organize their internal representations during training has largely remained a "black box." We know networks learn increasingly abstract features as data moves deeper through their layers, but we lack a universal mathematical law explaining why or how these representations, weight matrices, and gradients interact.

Prior work has spotted isolated pieces of the puzzle—like neural collapse (where last-layer representations collapse into simple geometric structures in classification tasks) or the neural feature ansatz (which describes how weights evolve relative to gradients). However, these phenomena have been treated as separate quirks of specific architectures or loss functions. This paper aims to bridge the gap by providing a unified, physics-inspired theory that explains representation formation across different tasks, architectures, and loss functions.

Methods

The authors introduce two main theoretical frameworks:

  1. Canonical Representation Hypothesis (CRH): This posits that within any given hidden layer, three dual objects—latent representations ($H$), weights ($Z$), and neuron gradients ($G$)—become mutually aligned after training. This leads to six distinct alignment relations (e.g., representation-gradient alignment, gradient-weight alignment) split into "forward" and "backward" pathways.
  2. Polynomial Alignment Hypothesis (PAH): Recognizing that perfect alignment doesn't always hold, the authors prove a "Master Theorem" showing that when CRH breaks, the spectra of these matrices form reciprocal power-law scaling relations (e.g., $A^\alpha \propto B^\beta \propto C^\delta$).

To justify CRH, the authors present a minimal-assumption mathematical proof demonstrating that alignment naturally emerges from a noise-regularization balance during Stochastic Gradient Descent (SGD). Similar to the fluctuation-dissipation theorem in physics, the discretization noise of SGD expands the representation space, while weight decay (regularization) contracts it, forcing the system into a compact, mutually aligned equilibrium.

Datasets

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

  • Synthetic Datasets (fc1, fc2): Generated using a two-layer teacher network with sine activations to perform controlled hyperparameter studies.
  • CIFAR-10 & CIFAR-100: Used to train a standard ResNet-18 for supervised image classification (res1) and self-supervised learning (res2).
  • OpenWebText (OWT): Used to train a 100-million parameter, six-layer transformer (llm) to test the theory on large language models.

Key Insights and Ideas

  • The Fluctuation-Dissipation Analogy: One of the coolest "aha" moments is viewing neural network training through the lens of statistical mechanics. The alignment isn't an accident; it's a dynamic balance where gradient noise and weight decay perfectly counteract each other at stationarity.
  • The 64 Phases of Learning: When perfect alignment breaks, it doesn't fail randomly. Depending on which subset of alignment equations holds, a layer can exist in one of up to 64 distinct "phases" characterized by specific power-law exponents.
  • Deep Layers Compress More: Alignment gets progressively stronger in the deeper layers of a network. Once a layer achieves near-perfect alignment, all subsequent layers inherit this property, leading to highly compact, low-rank representations that filter out task-irrelevant noise.
  • Unification of Deep Learning Theory: The authors prove that under perfect classification settings, Neural Collapse is mathematically equivalent to the CRH. Similarly, the Neural Feature Ansatz emerges as a specific instance of Finite-Time CRH breaking.

Key Results

The authors provide strong empirical evidence showing that their alignment metrics hold true across MLPs, ResNets, and Transformers:

  • Universal Alignment: In a ResNet-18 trained on CIFAR-10, all six alignment relations increase significantly during training, approaching near-perfect correlation ($\alpha > 0.7$) in the final layers.
Figure 1: Six alignment relations in the penultimate layer and output layer of a ResNet18 trained on CIFAR-10 (res1). Left: forward CRH. Right: backward CRH. We see that all six relations hold significantly across two fully connected layers. Also, we show that the matrix cov(g, h) is well aligned with WW ⊺in the appendix Section C.7, which is a strong piece of evidence supporting the key theoretical step that the cross terms will be aligned with the weights (and G, H).
  • Predictable Power Laws: In Large Language Models, the eigenvalues of the representation and gradient matrices obey the exact power laws predicted by the PAH Master Theorem. The first layer displays an exponent of 3, the second an exponent of 2, and subsequent layers stabilize at an exponent of 1.
Power-law alignment between eigenvalues in a six-layer transformer
  • Compactness and Alignment: The paper demonstrates a clear negative correlation between representation rank deficiency (compactness) and alignment error, proving that stronger alignment directly corresponds to cleaner, more compressed data representations.

Limitations and Future Work

While highly general, the current formulation of CRH and PAH has a few notable limitations:

  • Layer Constraints: The theory currently applies strictly to fully connected layers (or architectures like Transformers where attention head outputs can be treated as such). Extending this framework to convolutional or recurrent layers remains an open challenge.
  • Static vs. Dynamic: The authors primarily focus on characterizing the final stationary stage of representation formation. A complete, time-dependent theory detailing the exact trajectory of these alignments throughout the entire training process is left for future work.

Summary updated

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