HyperAIHyperAI

Command Palette

Search for a command to run...

그라킹의 이해: 릿지 회귀에서의 증명 가능한 그라킹

Mingyue Xu Gal Vardi Itay Safran

초록

우리는 고전적인 릿지 회귀 설정에서 그라킹(grokking), 즉 과적합 이후 오랜 시간이 지나서야 일반화가 시작되는 현상을 연구한다. 가중치 감쇠를 사용한 경사 하강법으로 과잉 매개변수화된 선형 회귀 모델을 학습할 때의 종단 간 그라킹 결과를 증명한다. 구체적으로, 우리는 다음 단계들이 발생함을 증명한다: (i) 훈련 초기에 모델이 훈련 데이터에 과적합됨; (ii) 과적합이 나타난 후에도 오랫동안 낮은 일반화 성능이 지속됨; 그리고 (iii) 일반화 오차가 결국 임의로 작아짐. 더욱이, 우리는 이론적 및 경험적으로 적절한 하이퍼파라미터 조정을 통해 그라킹이 원리적으로 증폭되거나 제거될 수 있음을 보인다. 우리가 아는 한, 이는 일반화 지연(우리가 '그라킹 시간'이라고 부르는 것)에 대한 훈련 하이퍼파라미터 측면에서의 최초의 엄밀한 정량적 한계이다. 마지막으로, 선형 설정을 넘어, 우리의 정량적 한계가 비선형 신경망에서의 그라킹 행동 또한 포착함을 경험적으로 입증한다. 우리의 결과는 그라킹이 딥러닝의 본질적인 실패 모드가 아니라 특정 훈련 조건의 결과이며, 따라서 이를 피하기 위해 모델 아키텍처나 학습 알고리즘의 근본적인 변경을 필요로 하지 않음을 시사한다.

One-sentence Summary

The authors establish the first rigorous quantitative bounds on grokking time for over-parameterized linear regression with gradient descent and weight decay, prove that hyperparameter tuning can amplify or eliminate grokking, and empirically demonstrate that these bounds capture grokking behavior in non-linear neural networks, suggesting that grokking is not an inherent failure mode of deep learning but a controllable consequence of specific training conditions.

Key Contributions

  • The paper establishes the first rigorous quantitative bounds on grokking time for over-parameterized linear regression trained with gradient descent and weight decay, proving a progression from overfitting through persistent poor generalization to arbitrarily small test error.
  • Both theoretical analysis and experiments show that grokking can be systematically amplified or eliminated by tuning hyperparameters, such as the weight decay coefficient, providing a principled control mechanism.
  • Beyond the linear setting, the quantitative bounds empirically capture grokking behavior on non-linear neural networks, supporting the conclusion that grokking results from specific training conditions rather than a fundamental deficiency of deep learning.

Introduction

The authors study grokking, a counterintuitive phenomenon where test performance improves long after a model perfectly fits the training data. Prior theoretical analyses have attributed grokking to transitions between lazy and rich training regimes or to the role of weight decay, but none provided a rigorous end-to-end guarantee that poor generalization persists after overfitting before eventually resolving. The authors fill this gap by analyzing overparameterized ridge regression with a teacher-student setup, showing for the first time that even a linear model trained with gradient descent and weight decay can exhibit provable grokking. They establish quantitative bounds on training error convergence, a slower generalization error decay that demonstrates prolonged overfitting, and eventual convergence to a global minimum with good test performance, all fully controllable through hyperparameters like the weight decay coefficient.

Method

Theauthors investigate the phenomenon of grokking within the context of ridge regression. They consider a fundamental regression problem where a student linear regression model N(x;θ)=θ,ϕ(x)N(\boldsymbol{x}; \boldsymbol{\theta}) = \langle \boldsymbol{\theta}, \phi(\boldsymbol{x}) \rangleN(x;θ)=θ,ϕ(x)⟩ is trained to learn a realizable teacher function N(x)=θ,ϕ(x)N^*(\boldsymbol{x}) = \langle \boldsymbol{\theta}^*, \phi(\boldsymbol{x}) \rangleN(x)=θ,ϕ(x)⟩. Here, ϕ(x)\phi(\boldsymbol{x})ϕ(x) is a fixed feature map and θ\boldsymbol{\theta}θ represents the trainable parameters.

The training process utilizes ridge regression, which minimizes the empirical mean squared loss augmented with an 2\ell_22-regularization term. The training objective is defined as:

Ln(θ;λ)=12ni=1n(N(xi;θ)N(xi))2+λ2θ22L_n(\boldsymbol{\theta}; \lambda) = \frac{1}{2n} \sum_{i=1}^n (N(\boldsymbol{x}_i; \boldsymbol{\theta}) - N^*(\boldsymbol{x}_i))^2 + \frac{\lambda}{2} \|\boldsymbol{\theta}\|_2^2Ln(θ;λ)=2n1i=1n(N(xi;θ)N(xi))2+2λθ22

where λ>0\lambda > 0λ>0 is the weight decay parameter. The model is optimized using vanilla Gradient Descent (GD) with a fixed step size η\etaη, updating the parameters via θ(t+1)=θ(t)ηθLn(θ(t);λ)\boldsymbol{\theta}^{(t+1)} = \boldsymbol{\theta}^{(t)} - \eta \nabla_{\boldsymbol{\theta}} L_n(\boldsymbol{\theta}^{(t)}; \lambda)θ(t+1)=θ(t)ηθLn(θ(t);λ).

To formalize grokking, the authors define the training loss convergence time t1t_1t1 and the generalization loss convergence time t2t_2t2. Grokking occurs when there is a significant delay between these two events (t2t1t_2 \gg t_1t2t1). In the over-parameterized regime (mnm \gg nmn), the GD optimization process effectively updates the projection of the weight vector onto the data-spanning subspace to fit the training data quickly. However, the component in the complementary subspace converges at a much slower rate dictated by the weight decay, leading to harmful overfitting before eventual generalization.

The authors provide quantitative bounds for the grokking time t2t1t_2 - t_1t2t1 and analyze how different training hyperparameters influence this delay.

As shown in the figure below, the theoretical bounds closely match empirical results regarding hyperparameter dependencies. Specifically, decreasing the weight decay λ\lambdaλ extends the generalization delay, as t2t_2t2 is inversely proportional to λ\lambdaλ. Decreasing the sample size nnn amplifies grokking by speeding up the convergence of the training loss. Increasing the feature dimension mmm has little effect on t1t_1t1 and t2t_2t2, while increasing the initialization scale ν2\nu^2ν2 increases both t1t_1t1 and t2t_2t2 simultaneously at logarithmic rates.

Experiment

The experiments confirm the theoretical framing of grokking by demonstrating that gradient descent with weight decay can first achieve low training error while generalization remains poor, and then eventually generalize well after a delay that can be made arbitrarily long through smaller weight decay. The observed dependencies of the early and late critical time points on hyperparameters closely track the derived bounds for linear ridge regression, and this qualitative behavior persists in both random-features networks and fully trained two-layer ReLU networks, indicating that the analytical insights may hold beyond the simplified linear setting.


AI로 AI 구축

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

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

HyperAI Newsletters

최신 정보 구독하기
한국 시간 매주 월요일 오전 9시 에 이번 주의 최신 업데이트를 메일로 발송합니다
이메일 서비스 제공: MailChimp
그라킹의 이해: 릿지 회귀에서의 증명 가능한 그라킹 | 문서 | HyperAI초신경