English

Grokfast: Accelerated Grokking by Amplifying Slow Gradients

Machine Learning 2024-06-06 v2 Artificial Intelligence

Abstract

One puzzling artifact in machine learning dubbed grokking is where delayed generalization is achieved tenfolds of iterations after near perfect overfitting to the training data. Focusing on the long delay itself on behalf of machine learning practitioners, our goal is to accelerate generalization of a model under grokking phenomenon. By regarding a series of gradients of a parameter over training iterations as a random signal over time, we can spectrally decompose the parameter trajectories under gradient descent into two components: the fast-varying, overfitting-yielding component and the slow-varying, generalization-inducing component. This analysis allows us to accelerate the grokking phenomenon more than ×50\times 50 with only a few lines of code that amplifies the slow-varying components of gradients. The experiments show that our algorithm applies to diverse tasks involving images, languages, and graphs, enabling practical availability of this peculiar artifact of sudden generalization. Our code is available at https://github.com/ironjr/grokfast.

Keywords

Cite

@article{arxiv.2405.20233,
  title  = {Grokfast: Accelerated Grokking by Amplifying Slow Gradients},
  author = {Jaerin Lee and Bong Gyun Kang and Kihoon Kim and Kyoung Mu Lee},
  journal= {arXiv preprint arXiv:2405.20233},
  year   = {2024}
}

Comments

17 pages, 13 figures. Typo fixed. Project page: https://jaerinlee.com/research/grokfast

R2 v1 2026-06-28T16:47:28.238Z