Is Grokking a Computational Glass Relaxation?

Xiaotian Zhang, Yue Shang, Entao Yang, Ge Zhang
5/1/2025
9 citations

No official code found. Best implementation: xtzhang28/Grokking (1 star, Python, last commit 2025-11-23).

Abstract

Understanding neural network's (NN) generalizability remains a central question in deep learning research. The special phenomenon of grokking, where NNs abruptly generalize long after the training performance reaches a near-perfect level, offers a unique window to investigate the underlying mechanisms of NNs'generalizability.

Show full abstract

Here we propose an interpretation for grokking by framing it as a computational glass relaxation: viewing NNs as a physical system where parameters are the degrees of freedom and train loss is the system energy, we find memorization process resembles a rapid cooling of liquid into non-equilibrium glassy state at low temperature and the later generalization is like a slow relaxation towards a more stable configuration. This mapping enables us to sample NNs'Boltzmann entropy (states of density) landscape as a function of training loss and test accuracy. Our experiments in transformers on arithmetic tasks suggests that there is NO entropy barrier in the memorization-to-generalization transition of grokking, challenging previous theory that defines grokking as a first-order phase transition. We identify a high-entropy advantage under grokking, an extension of prior work linking entropy to generalizability but much more significant. Inspired by grokking's far-from-equilibrium nature, we develop a toy optimizer WanD based on Wang-landau molecular dynamics, which can eliminate grokking without any constraints and find high-norm generalizing solutions. This provides strictly-defined counterexamples to theory attributing grokking solely to weight norm evolution towards the Goldilocks zone and also suggests new potential ways for optimizer design.

View on arXivView PDF

Code Implementations(1)

xtzhang28/GrokkingCommunity70%

Code of "Is Grokking a Computational Glass Relaxation?"

10Python, ShellNov 23, 20251 years ago

Similar Papers

Cite this paper

@article{zhang2025grokking,
  title  = {Is Grokking a Computational Glass Relaxation?},
  author = {Xiaotian Zhang and Yue Shang and Entao Yang and Ge Zhang},
  year   = {2025},
  eprint = {2505.11411},
  archivePrefix = {arXiv},
  doi    = {10.48550/arXiv.2505.11411},
  url    = {https://doi.org/10.48550/arXiv.2505.11411},
  journal = {Neural Information Processing Systems}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2505.11411.svg)](https://codeofpaper.com/paper/2505.11411)

Discussion