Why Do You Grok? A Theoretical Analysis of Grokking Modular Addition

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Mohamadi, Mohamad Amin, Li, Zhiyuan, Wu, Lei, Sutherland, Danica J.
Natura: Preprint
Pubblicazione: 2024
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866910530965340160
author Mohamadi, Mohamad Amin
Li, Zhiyuan
Wu, Lei
Sutherland, Danica J.
author_facet Mohamadi, Mohamad Amin
Li, Zhiyuan
Wu, Lei
Sutherland, Danica J.
contents We present a theoretical explanation of the ``grokking'' phenomenon, where a model generalizes long after overfitting,for the originally-studied problem of modular addition. First, we show that early in gradient descent, when the ``kernel regime'' approximately holds, no permutation-equivariant model can achieve small population error on modular addition unless it sees at least a constant fraction of all possible data points. Eventually, however, models escape the kernel regime. We show that two-layer quadratic networks that achieve zero training loss with bounded $\ell_{\infty}$ norm generalize well with substantially fewer training points, and further show such networks exist and can be found by gradient descent with small $\ell_{\infty}$ regularization. We further provide empirical evidence that these networks as well as simple Transformers, leave the kernel regime only after initially overfitting. Taken together, our results strongly support the case for grokking as a consequence of the transition from kernel-like behavior to limiting behavior of gradient descent on deep networks.
format Preprint
id arxiv_https___arxiv_org_abs_2407_12332
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Why Do You Grok? A Theoretical Analysis of Grokking Modular Addition
Mohamadi, Mohamad Amin
Li, Zhiyuan
Wu, Lei
Sutherland, Danica J.
Machine Learning
We present a theoretical explanation of the ``grokking'' phenomenon, where a model generalizes long after overfitting,for the originally-studied problem of modular addition. First, we show that early in gradient descent, when the ``kernel regime'' approximately holds, no permutation-equivariant model can achieve small population error on modular addition unless it sees at least a constant fraction of all possible data points. Eventually, however, models escape the kernel regime. We show that two-layer quadratic networks that achieve zero training loss with bounded $\ell_{\infty}$ norm generalize well with substantially fewer training points, and further show such networks exist and can be found by gradient descent with small $\ell_{\infty}$ regularization. We further provide empirical evidence that these networks as well as simple Transformers, leave the kernel regime only after initially overfitting. Taken together, our results strongly support the case for grokking as a consequence of the transition from kernel-like behavior to limiting behavior of gradient descent on deep networks.
title Why Do You Grok? A Theoretical Analysis of Grokking Modular Addition
topic Machine Learning
url https://arxiv.org/abs/2407.12332