Grokking: Generalization Beyond Overfitting on Small Algorithmic Datasets

Alethea Power, Yuri Burda, Harri Edwards, Igor Babuschkin, Vedant Misra

2022 · ICLR Workshop

Grokking: Generalization Beyond Overfitting on Small Algorithmic Datasets

Problem

Framing

Small algorithmic datasets expose a gap between interpolation and true rule learning: networks can memorize every seen equation yet fail on held-out ones for orders of magnitude more steps. The paper identifies a delayed phase transition, "grokking," where the same model later jumps from chance-level validation accuracy to near-perfect generalization.

Currently Used Methods

Foundational

Proposed Method

Architecture

The paper uses a decoder-only Transformer on equations of the form ab=ca \circ b = c, with each symbol tokenized separately. The network has 2 layers, width 128, and 4 attention heads, for about 41054 \cdot 10^5 non-embedding parameters.

Results figure: optimization choice and task type both shift final validation accuracy versus training-data fraction; weight decay helps most on S_5 and harder operations need more data.

Loss / Objective

Training minimizes next-token cross-entropy on the answer token only.

L(θ)=E(a,b,c)Dtrain[logpθ(ca,,b,=)]\mathcal{L}(\theta) = - \mathbb{E}_{(a,b,c) \sim \mathcal{D}_{\mathrm{train}}} \left[ \log p_{\theta}\big(c \mid a, \circ, b, =\big) \right]

Algorithm

For noisy-update ablations, the paper perturbs Adam updates with Gaussian noise.

WW+lr(ΔW+ϵ),ϵN(0,I)W \leftarrow W + \mathrm{lr} \cdot (\Delta W + \epsilon), \qquad \epsilon \sim \mathcal{N}(0, I)

Training Procedure

Evaluation

Datasets

Metrics

Headline results

Verified plot: for modular division with 50% training data, train accuracy saturates near 10^3 steps while validation accuracy stays near chance until roughly 10^5-10^6 steps, then rapidly climbs.

Verified page crop: optimization ablations list and the corresponding modular-division loss plot, where validation loss rises until about 10^5 steps before a second descent.

Ablations

Method Strengths and Weaknesses

Strengths

Weaknesses

Suggestions from the authors

Links

Prior Papers

Further Papers

No vault papers identified as further work yet.