Three Mechanisms of Feature Learning in a Linear Network

Yizhou Xu, Liu Ziyin

TL;DR

Researchers have derived an exact analytical solution for the training dynamics of a finite-width, one-hidden-layer linear network. By solving this "minimal" model, they identified three distinct mechanisms—alignment, disalignment, and rescaling—that drive feature learning, providing a theoretical bridge between idealized infinite-width models and the complex behavior of real-world deep networks.

What Problem Does This Paper Address?

In deep learning theory, we often talk about two regimes: the kernel regime (where the model behaves like a linear predictor and features don't change much) and the feature learning regime (where the model actively adapts its internal representations). While the infinite-width limit (Neural Tangent Kernel or NTK) is well-understood, it often fails to capture the "magic" of feature learning that makes deep learning so effective in practice.

The challenge is that feature learning dynamics are notoriously difficult to solve analytically, especially for finite-width networks. There is a lack of solvable models that can exhibit both kernel and feature learning phases. This paper fills that gap by providing a precise mathematical characterization of how hyperparameters like width, initialization scale, and learning rates dictate which regime a network enters.

Methods

The authors analyze a two-layer network with power activations, focusing primarily on the linear case ($\beta=1$). To make the math tractable, they assume the training data lies in a one-dimensional subspace.

Key technical steps include:

  1. Analytical Reduction: They reduce the high-dimensional gradient flow of the weights into a simpler set of ordinary differential equations (ODEs) using a new coordinate system ($p_i, q_i$).
  2. Exact Solution: For linear networks, they provide a closed-form solution for the training trajectory from any arbitrary initialization.
  3. Alignment Metric: They define a quantity $\zeta$ (cosine similarity) to measure how well the weights of the two layers align during training.
  4. Phase Diagrams: They use a scaling parameter $\kappa$ to map out exactly when a network will behave like a kernel method versus when it will learn features.

Datasets

While the core theory is derived for 1D data, the authors validate their findings using:

  • MNIST: Used to test alignment in four-layer and six-layer fully connected networks (FCNs).
  • CIFAR-10: Used to evaluate the performance of ResNet-18 and two-layer FCNs under different initialization scales.
  • Synthetic Data: 1D data and Gaussian distributions were used to verify the exactness of the ODE solutions.

Key Insights and Ideas

  • Three Mechanisms of Feature Learning:
    • Alignment: Layers rotate to point in the same direction. This is the "healthy" mode of feature learning, typically occurring with smaller initializations.
  • Disalignment: Layers rotate away from each other. This happens when the initialization is too large, forcing the model to "cancel out" its own initial output to fit the data.
  • Rescaling: The magnitude of the weights changes to match the target signal.
  • The "Kernel Phase" as a Failure of Alignment: In the kernel regime, layers remain nearly orthogonal throughout training. This forces the model to have a disproportionately large norm to fit the data, which the authors suggest is a primary cause of the poor generalization often seen in kernel-like models.
  • Initialization is Destiny: The scale of initialization ($\sigma$) is a critical switch. A small $\sigma$ encourages alignment and feature learning, while a large $\sigma$ pushes the model toward the kernel regime or the inefficient disalignment regime.
Figure 1: The evolution of ζ of two-layer networks with different settings. Specifically, we test linear, ReLU, sigmoid, swish, and leaky ReLU activations for both alignment (upper) and disalignment (lower) cases. For the linear network, we show the theoretical predictions obtained from (14) as lines and experimental results as points. The results for nonlinear networks are qualitatively similar.

Key Results

  • Theoretical vs. Empirical Match: The exact solutions for the linear network perfectly match experimental training curves. Remarkably, these patterns (alignment/disalignment) qualitatively hold for nonlinear networks like ReLU, Sigmoid, and Swish (see Figure 1).
  • Performance Gap: On CIFAR-10, turning a model from the kernel phase into the feature learning phase (by adjusting $\gamma$ and $\eta$) improved test accuracy by approximately 5%. Conversely, forcing a Xavier-initialized model into the kernel phase decreased accuracy by 10%.
  • Weight Norms and Generalization: Models initialized with larger scales converge to solutions with much higher weight norms, even if they achieve 100% training accuracy. This correlates with worse test performance, supporting the idea that alignment is key to efficient generalization.
Figure 3: The initialization scale σ correlates negatively with the performance of Resnet-18 on the CIFAR-10 dataset. Left: test accuracy. Here, σ is a constant multiplier we apply to the initialized weights of the model under the Kaiming init. Right: the norm of all weights. While all models achieve a 100% training accuracy, models initialized with a larger scale converge to solutions with higher weight norms, which is a sign that the layers are misaligned.

Limitations and Future Work

  • 1D Data Constraint: The analytical solutions rely on the assumption that data lies in a 1D subspace. While empirical tests suggest the insights generalize to high-dimensional data, the mathematical proof for the general case remains an open challenge due to a lack of conservation laws in higher dimensions.
  • Deterministic Focus: The study looks at gradient flow (continuous-time GD). Real-world training uses discrete steps and stochasticity (SGD), which introduces noise that might further influence alignment.
  • Depth: The exact solution is for one hidden layer. While the authors show similar alignment behavior in deeper networks (Figure 2/6), a full analytical theory for deep networks is still missing.
Figure 2: The alignment angle ζ between different layers of a four-layer FCN with ReLU activation trained on MNIST. (b) shows the final alignment for different initialization scale σ, while (a) shows training curves corresponding to σ = 1. The dashed lines in (b) show the initial alignment. See Appendix C for experiments on a six-layer network.

Summary updated

BibTeX
@inproceedings{xu2025three,
  author = {Yizhou Xu and Liu Ziyin},
  title = {{Three Mechanisms of Feature Learning in a Linear Network}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=Wh4SE2S7Mo},
}
Figure