Provable Scaling Laws of Feature Emergence from Learning Dynamics of Grokking

Yuandong TianarXiv 2025 · DOI

Introduction

Deep learning models often exhibit "grokking," a phenomenon where a model transitions abruptly from memorization to generalization long after training loss has plateaued. While empirically well-documented in tasks like modular arithmetic, a rigorous mathematical explanation has remained elusive. Traditional frameworks like the Neural Tangent Kernel (NTK) assume weights remain near initialization, failing to capture the significant weight movement characteristic of grokking. This paper introduces the $Li_2$ framework, providing provable scaling laws for feature emergence by analyzing the actual learning dynamics of neural networks.

The $Li_2$ Framework

The $Li_2$ framework decomposes the learning process into three distinct stages, transitioning from initial random weights to a state of complete feature representation. This progression maps the model's journey from sharp optima (memorization) to flat optima (generalization).

The three stages of learning in the $Li_2$ framework, mapping the transition from memorization to generalization.

Stage I: Lazy Learning

In the initial phase, the model's top layer quickly overfits to the random features provided by the hidden layer. This is characterized as "Lazy Learning" or ridge regression on random features. While this leads to memorization, a critical side effect occurs: the backpropagated gradient ($G_F$) begins to "leak" structured information about the target labels $\tilde{Y}$. This leaked signal is the precursor to true feature learning.

Stage II: Independent Feature Learning

As training continues, hidden nodes utilize the leaked signal to learn features independently. This process is proven to follow the gradient ascent of a specific energy function $\mathcal{E}$, which acts as a nonlinear version of Canonical Correlation Analysis (CCA). The paper uses Group Representation Theory to show how models learn the "irreps" (irreducible representations) of mathematical groups during this stage.

Stage III: Interactive Feature Learning

Once nodes begin representing features, they interact. The dynamics naturally push nodes to learn diverse features through repulsion, ensuring the network covers "missing pieces" of the solution rather than converging on redundant local optima.

Mechanistic Dynamics of Learning

The transition between these stages is driven by the evolution of weights $W$ and $V$ and the information carried by the gradient $G_F$. The paper validates these dynamics using Group Arithmetic Tasks, such as modular addition ($a + b \pmod M$), which serve as the "fruit flies" of grokking research.

Mechanistic evolution of weights and gradients from initialization to complete feature learning.

As shown in the figure above, the "leakage" of target information in the gradient $G_F$ during Stage I is the catalyst for feature learning in Stage II. By Stage III, the weights $W$ are "complete," and the gradient $G_F$ vanishes as the model's predictions $\hat{Y}$ converge to the targets $\tilde{Y}$. For Abelian groups, the theory shows that $2M-2$ nodes suffice for generalization, a significant improvement over the $M^2$ nodes required for simple memorization.

Key Insights and Scaling Laws

The $Li_2$ framework yields several theoretical and practical insights:

  • Weight Decay as a Throttle: Weight decay ($\eta$) is shown to act effectively as the learning rate for the feature-learning stage. This provides a theoretical basis for why high weight decay often accelerates grokking.
  • Scaling Law of Generalization: The paper proves a phase transition boundary for generalization. Specifically, generalization requires $n \gtrsim d_k^2 M \log(M/\delta)$ samples. Below this threshold, the model is mathematically constrained to a memorization state. This law was found to match experimental results across various group structures.
  • Zero-Init Strategy: A novel practical takeaway is the "zero-init" strategy. By initializing output layer weights to zero, the initial gradient signal is cleaned of noise from random features, potentially speeding up grokking by 10x.
  • Muon Optimizer: The framework explains the effectiveness of the Muon optimizer as a mechanism to ensure hidden nodes don't crowd into the same local optima, thereby enforcing the feature diversity required for complex tasks.

Conclusion

By moving beyond the NTK regime and studying the explicit dynamics of weight movement, the $Li_2$ framework provides the first provable scaling laws for grokking. It characterizes the transition from memorization to generalization as a structured three-stage process of feature emergence, offering both a theoretical foundation and practical strategies for training more efficient models.

Summary updated

BibTeX
@misc{tian2025provable,
  author = {Yuandong Tian},
  title = {{Provable Scaling Laws of Feature Emergence from Learning Dynamics of Grokking}},
  year = {2025},
  eprint = {2509.21519},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2509.21519},
}
Figure