The Weight Gram Matrix Captures Sequential Feature Linearization in Deep Networks

Taehun Cha, Daniel Beaglehole, Adityanarayanan Radhakrishnan, Donghun Lee

TL;DR

This paper reveals that the weight Gram matrix ($W^\top W$) acts as the fundamental mathematical bridge connecting weight updates to feature evolution in deep neural networks. By introducing a metric called "Target Linearity," the authors prove that deep networks learn representations by sequentially straightening and aligning data with target labels, layer by layer. This framework provides a unified explanation for diverse deep learning phenomena, from Neural Collapse to why linear interpolation works in generative models.

What Problem Does This Paper Address?

While deep learning owes its massive success to feature learning—the ability of a network to discover useful representations of data—mathematically tracking how these features evolve during training remains incredibly difficult.

Existing theoretical frameworks generally fall into two camps:

  1. Parameter-centric theories (like the Neural Tangent Kernel or "lazy" regime), which simplify the math by assuming features stay effectively fixed during training. However, this fails to capture true feature learning.
  2. Highly specific case studies (e.g., tracking simple polynomial or teacher-student setups), which don't easily generalize to realistic, high-dimensional settings.

This paper addresses this gap by providing a general, feature-centric framework that directly explains how gradient descent reshapes representations across the layers of a deep network.

Methods

The authors build their framework on a few elegant mathematical insights:

  • The Feature Learning Equation: Using a simple application of the chain rule, the authors derive an identity showing that the product of feature gradients and features equals the product of the weight matrix and weight gradients ($\nabla_h f \cdot h^\top = W^\top \nabla_W f$). This highlights the weight Gram matrix ($W^\top W$) as the natural link between weight updates and feature changes.
  • Virtual Updates & Virtual Covariance Shift (VCS): The authors design a thought experiment: what if we directly updated hidden features using the loss gradient instead of updating weights? They define this as a "virtual update." They prove (Theorem 1) that standard gradient descent implicitly updates the weight Gram matrix to track the covariance structure of these virtually updated features.
  • Gradient Whitening: To test if the Gram matrix really carries the dominant signal for feature learning, they develop an optimization step that strips away any gradient components that don't alter $W^\top W$. They call this the "whitened gradient."
  • Target Linearity (TL): They define a novel metric to quantify representation quality: the $R^2$ coefficient of determination of a linear regression from the hidden features to the target labels. To make this mathematically tractable for analysis, they introduce a simplified "surrogate" function.

Datasets

The authors validate their framework across a wide variety of standard benchmarks and architectures:

  • Image Classification: MNIST, SVHN, CIFAR-10, and CIFAR-100 (using fully connected and convolutional networks).
  • Generative Modeling: MNIST and CIFAR-10 applied to Variational Autoencoders (VAEs).
  • Natural Language Processing: Pre-trained and fine-tuned BERT models evaluated on downstream tasks from GLUE (SST-2, MNLI) and token classification (CoNLL-2003 POS and NER).
  • Synthetic Data: A synthetic "staircase" target dataset used to contrast feature learning regimes.

Key Insights and Ideas

  • Feature Learning is a "Moving-Target" Problem: In the rich feature-learning regime, training is a dynamic dance. As features evolve, they induce a constantly shifting "best linear predictor" ($f_{OLS,t}$) that the network continuously chases. This stands in stark contrast to the lazy/NTK regime where the target function space is fixed from initialization.
Figure 3: Training dynamics in the lazy (left) versus rich regimes (right). In the lazy regime, the network remains close to its linearization, and the feature map H∞is effectively fixed. In the rich regime, finite-width features Ht evolve during training, inducing a moving target fOLS,t that ft chases, while feature updates simultaneously reshape fOLS,t+1 toward y.
  • Sequential Linearization: Deep networks act like geometric unrollers. Layer by layer, they progressively flatten complex, non-linear data structures (like a Swiss roll) into a straight line that aligns perfectly with the target task. By the time the data reaches the final layers, the "hard" non-linear work is done, explaining why simple linear probes work so well on deep features.
Virtual updates progressively unrolling a Swiss roll dataset
  • A Unified Lens for Diverse Phenomena: The authors show that Neural Collapse (where last-layer features of the same class perfectly cluster into a symmetric shape) is simply the mathematical upper bound—the extreme case—of target linearization. Furthermore, they prove that high Target Linearity is a sufficient condition to explain why smoothly interpolating between latent vectors in a VAE generates smooth, realistic transitions in pixel space.

Key Results

  • Isolating the Gram Matrix is Sufficient: Training networks using the "whitened gradient" (which only allows updates that change the weight Gram matrix) matches or even exceeds the test accuracy of standard gradient descent on MNIST, SVHN, and CIFAR-10.
Figure 2: Test accuracy of standard gradient descent (Original, dashed) versus the whitened update (Whiten, solid) on MNIST, SVHN, CIFAR-10, and CIFAR-100, plotted across 20 training epochs. Shaded regions denote standard deviation across 5 runs.
  • High Empirical Alignment: The proposed Virtual Covariance Shift tracks actual weight Gram matrix updates with an incredibly high Pearson correlation ($\rho \approx 0.98$), significantly outperforming prior formulations like the Average Gradient Outer Product ($\rho \approx 0.71$).
  • BERT's Hidden Pipeline: Measuring Target Linearity across BERT layers reveals that self-supervised pre-training inherently builds target-linear representations for downstream tasks. Fine-tuning then reorganizes these profiles into a clean, monotonically increasing curve of linearity with depth.

Limitations and Future Work

While powerful, the theoretical guarantees in the paper rely on first-order Taylor expansions and assume activations are $m$-positively homogeneous (like ReLU or linear functions). Extending these rigorous proofs to highly non-homogeneous activations (like Sigmoid or GELU) remains an open challenge, though the authors provide strong empirical evidence that the principles still hold true in practice. Additionally, exploring how Target Linearity directly influences generalization bounds is a promising avenue for future research.

Summary updated

BibTeX
@inproceedings{cha2026weight,
  author = {Taehun Cha and Daniel Beaglehole and Adityanarayanan Radhakrishnan and Donghun Lee},
  title = {{The Weight Gram Matrix Captures Sequential Feature Linearization in Deep Networks}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=PZQcUnAHHK},
}
Figure