HyperAIHyperAI

Command Palette

Search for a command to run...

Grokkingを理解する:リッジ回帰における証明可能なGrokking

Mingyue Xu Gal Vardi Itay Safran

概要

我々は、古典的なリッジ回帰の設定において、過学習のずっと後に汎化が始まる現象であるgrokkingを研究する。重み減衰を用いた勾配降下法による過パラメータ化線形回帰モデルの学習について、エンドツーエンドのgrokkingの結果を証明する。具体的には、以下の段階が生じることを証明する:(i) 訓練初期にモデルが訓練データに過学習する;(ii) 過学習が顕在化した後も長期間にわたり汎化性能が低いままである;(iii) 最終的に汎化誤差が任意に小さくなる。さらに、理論的および実験的に、適切なハイパーパラメータ調整により、grokkingを原理的な方法で増幅または除去できることを示す。我々の知る限り、これらは訓練ハイパーパラメータに基づく汎化遅延(我々が「grokking時間」と呼ぶもの)に関する初めての厳密な定量的限界である。最後に、線形設定を超えて、我々の定量的限界が非線形ニューラルネットワークにおけるgrokkingの挙動も捉えることを実験的に実証する。我々の結果は、grokkingが深層学習の本質的な失敗モードではなく、特定の訓練条件の結果であり、したがって回避するためにモデルアーキテクチャや学習アルゴリズムの根本的な変更を必要としないことを示唆している。

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 によって提供されています