HyperAIHyperAI

Command Palette

Search for a command to run...

Outstanding Paper Honorable MentionICML 2026

그로킹의 본질을 탐구하다: 릿지 회귀에서 그로킹의 이론적 증명

Mingyue Xu Gal Vardi Itay Safran

초록

본 논문은 릿지 회귀라는 고전적 설정에서 과적합 이후 오랜 시간이 지나 비로소 일반화가 일어나는 현상, 즉 그로킹을 연구한다. 과매개변수 선형 회귀 모델을 가중치 감쇠가 포함된 경사 하강법으로 학습할 때의 종단 간(end-to-end) 그로킹 결과를 증명한다. 구체적으로, 다음 세 단계가 발생함을 보인다: (i) 학습 초기에 모델이 훈련 데이터에 과적합하며, (ii) 과적합이 나타난 후에도 오랜 기간 낮은 일반화 성능이 지속되고, (iii) 일반화 오차가 결국 임의로 작아진다. 또한 이론적·실험적으로 하이퍼파라미터를 적절히 조절하면 그로킹을 원리적으로 증폭하거나 제거할 수 있음을 보인다. 기존에 알려진 바에 따르면, 본 연구는 훈련 하이퍼파라미터에 대한 그로킹 지연 시간(본 논문에서는 이를 '그로킹 시간'이라 명명한다)의 최초의 엄밀한 정량적 상한을 제시한다. 마지막으로, 선형 설정을 넘어 비선형 신경망에서도 본 정량적 상한이 그로킹의 거동을 포착함을 실험적으로 입증한다. 본 연구 결과는 그로킹이 딥러닝의 고유한 실패 양상이 아니라 특정 훈련 조건의 결과이며, 따라서 모델 구조나 학습 알고리즘의 근본적 변경 없이도 회피할 수 있음을 시사한다.

One-sentence Summary

This work proves the first rigorous quantitative bounds on grokking time in over-parameterized ridge regression trained with gradient descent and weight decay, demonstrating that grokking unfolds through overfitting, prolonged poor generalization, and eventual convergence, with the delay controllable through hyperparameter tuning rather than architectural changes and empirically validated on non-linear neural networks.

Key Contributions

  • The paper proves end-to-end grokking in over-parameterized linear ridge regression trained with gradient descent and weight decay, including early overfitting, sustained poor generalization, and eventual arbitrarily small generalization error.

  • The paper establishes quantitative bounds on the generalization delay, termed grokking time, in terms of training hyperparameters, and shows theoretically and empirically that proper hyperparameter tuning can amplify or eliminate grokking.

  • The paper empirically shows that the derived bounds also capture grokking on nonlinear neural networks, and that a threshold-based accuracy metric recovers the familiar test error plateau in regression.

Introduction

In deep learning and related ML systems, grokking is a counterintuitive overfitting phenomenon where training accuracy becomes perfect early, while test generalization improves only much later. This matters because it challenges standard regularization intuition and reveals hidden dynamics in how models converge during optimization. Prior theory often links grokking to regime changes in training, such as lazy-to-rich dynamics or weight-decay effects, but earlier analyses generally lack rigorous end-to-end guarantees, fail to prove that poor generalization persists long after overfitting, or study overly narrow settings. The authors leverage an over-parameterized linear ridge regression framework to provide the first provable end-to-end grokking result, showing that gradient descent can quickly fit the training data, maintain worse generalization for a quantifiable delay, and later converge to a well-generalizing global optimum, while also giving explicit hyperparameter bounds and demonstrating that weight decay can control the grokking time.

Method

The authors leverage a teacher-student regression pipeline to isolate the mechanism behind grokking. Each input xi∈Rd\pmb{x}_i \in \mathbb{R}^dxi​∈Rd is sampled from a marginal distribution Dx\mathcal{D}_{\pmb{x}}Dx​, and its label is given exactly by a fixed teacher function N∗(x)N^*(\pmb{x})N∗(x). The student model is linear in a feature representation:

N(x;θ)=⟨θ,ϕ(x)⟩,N(\pmb{x};\pmb{\theta}) = \langle \pmb{\theta}, \phi(\pmb{x}) \rangle,N(x;θ)=⟨θ,ϕ(x)⟩,

where ϕ(x):Rd↦Rm\phi(\pmb{x}) : \mathbb{R}^d \mapsto \mathbb{R}^mϕ(x):Rd↦Rm is a fixed feature map and θ∈Rm\pmb{\theta} \in \mathbb{R}^mθ∈Rm is trainable. The realizable assumption means that there exists some θ∗\pmb{\theta}^*θ∗ such that N∗(x)=⟨θ∗,ϕ(x)⟩N^*(\pmb{x}) = \langle \pmb{\theta}^*, \phi(\pmb{x}) \rangleN∗(x)=⟨θ∗,ϕ(x)⟩.

Training is performed with ridge regression, which combines the empirical squared loss with an ℓ2\ell_2ℓ2​ regularization term:

Ln(θ;λ)=12n∑i=1n(⟨θ−θ∗,ϕ(xi)⟩)2+λ2∥θ∥22.L_n(\pmb{\theta};\lambda) = \frac{1}{2n}\sum_{i=1}^n \left( \langle \pmb{\theta} - \pmb{\theta}^*, \phi(\pmb{x}_i) \rangle \right)^2 + \frac{\lambda}{2}\|\pmb{\theta}\|_2^2.Ln​(θ;λ)=2n1​i=1∑n​(⟨θ−θ∗,ϕ(xi​)⟩)2+2λ​∥θ∥22​.

The parameter is optimized using vanilla gradient descent:

θ(t+1)=θ(t)−ηn∑i=1n⟨θ(t)−θ∗,ϕ(xi)⟩ϕ(xi)−ηλθ(t),\pmb{\theta}^{(t+1)} = \pmb{\theta}^{(t)} - \frac{\eta}{n} \sum_{i=1}^n \langle \pmb{\theta}^{(t)} - \pmb{\theta}^*, \phi(\pmb{x}_i) \rangle \phi(\pmb{x}_i) - \eta \lambda \pmb{\theta}^{(t)},θ(t+1)=θ(t)−nη​i=1∑n​⟨θ(t)−θ∗,ϕ(xi​)⟩ϕ(xi​)−ηλθ(t),

where η\etaη is the learning rate and λ\lambdaλ is the weight decay strength. The method studies training from a random initialization θ(0)∼N(0,ν2Im)\pmb{\theta}^{(0)} \sim \mathcal{N}(\pmb{0}, \nu^2 \pmb{I}_m)θ(0)∼N(0,ν2Im​), which makes the early dynamics and the eventual decay of unused directions analytically tractable.

The central mechanism behind grokking is a subspace decomposition of the learned weights. Let V=span⁡{ϕ(x1),…,ϕ(xn)}V = \operatorname{span}\{\phi(\pmb{x}_1),\ldots,\phi(\pmb{x}_n)\}V=span{ϕ(x1​),…,ϕ(xn​)} denote the feature subspace spanned by the training examples. In the overparameterized regime m≫nm \gg nm≫n, the optimization can be understood by splitting θ\pmb{\theta}θ into a component θ∥\pmb{\theta}_\parallelθ∥​ inside VVV and a component θ⊥\pmb{\theta}_\perpθ⊥​ in the complementary subspace. The empirical gradient primarily updates θ∥\pmb{\theta}_\parallelθ∥​, allowing the model to fit the training data quickly. However, θ⊥\pmb{\theta}_\perpθ⊥​ is invisible to the empirical loss and is mainly reduced by weight decay. Therefore, when λ\lambdaλ is very small, training loss can decrease rapidly while the component responsible for poor population performance decays slowly.

This gives rise to two relevant time points. The first is

t1=max⁡({t∈N:Ln(θ(t))≥ϵ}),t_1 = \max\left(\left\{t \in \mathbb{N}: L_n(\pmb{\theta}^{(t)}) \geq \epsilon \right\}\right),t1​=max({t∈N:Ln​(θ(t))≥ϵ}),

which marks the end of rapid training loss reduction. The second is

t2=min⁡({t∈N:L(θ(t))≤c}),t_2 = \min\left(\left\{t \in \mathbb{N}: L(\pmb{\theta}^{(t)}) \leq c \right\}\right),t2​=min({t∈N:L(θ(t))≤c}),

which marks the point where population loss becomes small. The authors show that, under sufficient sample size, large feature dimension, sufficiently small weight decay, and a compatible learning rate, t1t_1t1​ can be small while t2t_2t2​ can be arbitrarily large. Their bounds imply

t1≤nln⁡(6b2∥θ(0)∥22ϵ)2ηλmin⁡+(Φ⊤Φ),t_1 \leq \frac{ n \ln\left( \frac{6b^2 \|\pmb{\theta}^{(0)}\|_2^2}{\epsilon} \right) }{ 2\eta \lambda_{\min}^+(\pmb{\Phi}^\top \pmb{\Phi}) },t1​≤2ηλmin+​(Φ⊤Φ)nln(ϵ6b2∥θ(0)∥22​​)​,

and

t2≥ln⁡((m−n)ν22(cλmin⁡(Σ)+∥θ∗∥2)−2)4ηλ,t_2 \geq \frac{ \ln\left( \frac{(m-n)\nu^2}{2} \left( \sqrt{\frac{c}{\lambda_{\min}(\pmb{\Sigma})}} + \|\pmb{\theta}^*\|_2 \right)^{-2} \right) }{ 4\eta \lambda },t2​≥4ηλln(2(m−n)ν2​(λmin​(Σ)c​​+∥θ∗∥2​)−2)​,

where Φ\pmb{\Phi}Φ is the empirical feature matrix, Σ=E[ϕ(x)ϕ(x)⊤]\pmb{\Sigma} = \mathbb{E}[\phi(\pmb{x})\phi(\pmb{x})^\top]Σ=E[ϕ(x)ϕ(x)⊤] is the feature covariance matrix, and bbb bounds the feature norm. These expressions make clear why a small λ\lambdaλ can delay generalization without preventing fast training convergence.

To connect the theoretical bounds with observable hyperparameter behavior, the authors evaluate how λ\lambdaλ, sample size nnn, feature dimension mmm, and initialization scale ν2\nu^2ν2 change t1t_1t1​ and t2t_2t2​. As shown in the figure below:

The plots indicate that decreasing λ\lambdaλ primarily increases t2t_2t2​, because the orthogonal component θ⊥\pmb{\theta}_\perpθ⊥​ decays more slowly under weak weight decay. Reducing nnn can shorten t1t_1t1​ by making the training set easier to fit, thereby widening the interval t2−t1t_2 - t_1t2​−t1​. Increasing mmm has a comparatively muted effect in the plotted regime, while increasing ν2\nu^2ν2 shifts both t1t_1t1​ and t2t_2t2​ upward at logarithmic rates, with t2t_2t2​ growing faster, which amplifies the grokking gap.

The empirical ridge regression pipeline uses the identity feature map in some experiments, so that the student predicts ⟨θ,x⟩\langle \pmb{\theta}, \pmb{x} \rangle⟨θ,x⟩. Samples are generated under distributional assumptions on the features, often i.i.d. spherical Gaussian vectors, so that the covariance structure and the positive eigenvalue of the empirical Gram matrix can be estimated. The learning rate is fixed, and the model is trained by gradient descent with weight decay until both training and generalization behavior are observed.

The authors also extend the training protocol to a two-layer ReLU network. The network takes an input x∈Rd\pmb{x} \in \mathbb{R}^dx∈Rd, applies a first-layer weight matrix W\pmb{W}W, passes the resulting hidden units through ReLU⁡\operatorname{ReLU}ReLU, and combines them with a second-layer vector a\pmb{a}a. The output has the form

N(x;W,a)=∑j=1majReLU⁡(⟨wj,x⟩).N(\pmb{x};\pmb{W},\pmb{a}) = \sum_{j=1}^m a_j \operatorname{ReLU}\left(\langle \pmb{w}_j, \pmb{x} \rangle\right).N(x;W,a)=j=1∑m​aj​ReLU(⟨wj​,x⟩).

Both W\pmb{W}W and a\pmb{a}a are trained jointly with gradient descent and weight decay. The zero teacher is used as a simplified target, and the initialization scale ν2\nu^2ν2 controls the initial norm of the first-layer weights. This nonlinear setup serves to check whether the same hyperparameter trends predicted by the ridge regression analysis appear beyond the linear feature model.

Experiment

The experiments use ridge regression and gradient descent with weight decay to empirically test the theoretical grokking behavior, comparing training and generalization error timelines under controlled hyperparameters. The results confirm that small weight decay can produce the predicted separation between early overfitting and later generalization, closely matching the theoretical bounds. Extensions to random-feature networks and fully trained nonlinear ReLU networks exhibit qualitatively similar grokking behavior, suggesting that the observed phenomenon is not limited to the idealized linear setting.


AI로 AI 구축

아이디어에서 출시까지 — 무료 AI 코코딩, 즉시 사용 가능한 환경, 최적의 GPU 가격으로 AI 개발을 가속화하세요.

AI 협업 코딩
바로 사용 가능한 GPU
최적의 가격

HyperAI Newsletters

최신 정보 구독하기
한국 시간 매주 월요일 오전 9시 에 이번 주의 최신 업데이트를 메일로 발송합니다
이메일 서비스 제공: MailChimp