arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2501.04697cs.LGcs.AIcs.CVstat.ML

数值稳定性边缘的Grokking现象

Grokking at the Edge of Numerical Stability

Imperial College London(伦敦帝国理工学院)

Lucas Prieto, Melih Barsbey, Pedro A. M. Mediano, Tolga Birdal

AI总结:

本研究揭示无正则化下Grokking任务会引发Softmax坍塌阻碍泛化,提出StableMax激活函数与⊥Grad训练算法,阐明了Grokking的泛化延迟机制与正则化依赖关系。

摘要:

Grokking(顿悟式泛化)是指模型在长期过拟合后突然实现泛化的惊人现象,对我们关于深度学习的认知构成了挑战。尽管学界在理解Grokking现象方面已取得显著进展,但泛化延迟背后的原因及其对正则化的依赖性仍不明确。在本研究中,我们提出,在无正则化的条件下,Grokking任务会将模型推至数值稳定性的边缘,在Softmax函数中引入浮点误差,我们将该现象称为Softmax坍塌(Softmax Collapse, SC)。我们证明,SC会阻碍Grokking现象的发生,而缓解SC则可在无正则化的情况下实现Grokking。在探究SC的根本原因时,我们发现,在越过过拟合临界点后,梯度会与我们所称的朴素损失最小化(naïve loss minimization, NLM)方向高度对齐。梯度的这一分量不会改变模型的预测结果,但会通过缩放logits(通常是沿权重当前方向缩放权重)来降低损失。我们证明,logits的这种缩放解释了Grokking特有的泛化延迟现象,且最终会引发SC,使后续学习停滞。为验证我们的假设,我们提出了两项应对Grokking任务挑战的核心贡献:StableMax,一种可防止SC、实现无正则化Grokking的新型激活函数;以及⊥Grad,一种通过完全阻止NLM来促进Grokking任务快速泛化的训练算法。这些贡献为Grokking现象提供了新的见解,阐明了其泛化延迟、对正则化的依赖以及现有诱导Grokking方法的有效性。本文代码可在https://github.com/LucasPrietoAl/grokking-at-the-edge-of-numerical-stability获取。

英文摘要:

Grokking, the sudden generalization that occurs after prolonged overfitting, is a surprising phenomenon challenging our understanding of deep learning. Although significant progress has been made in understanding grokking, the reasons behind the delayed generalization and its dependence on regularization remain unclear. In this work, we argue that without regularization, grokking tasks push models to the edge of numerical stability, introducing floating point errors in the Softmax function, which we refer to as Softmax Collapse (SC). We demonstrate that SC prevents grokking and that mitigating SC enables grokking without regularization. Investigating the root cause of SC, we find that beyond the point of overfitting, the gradients strongly align with what we call the naïve loss minimization (NLM) direction. This component of the gradient does not alter the model's predictions but decreases the loss by scaling the logits, typically by scaling the weights along their current direction. We show that this scaling of the logits explains the delay in generalization characteristic of grokking and eventually leads to SC, halting further learning. To validate our hypotheses, we introduce two key contributions that address the challenges in grokking tasks: StableMax, a new activation function that prevents SC and enables grokking without regularization, and $\perp$Grad, a training algorithm that promotes quick generalization in grokking tasks by preventing NLM altogether. These contributions provide new insights into grokking, elucidating its delayed generalization, reliance on regularization, and the effectiveness of existing grokking-inducing methods. Code for this paper is available at https://github.com/LucasPrietoAl/grokking-at-the-edge-of-numerical-stability.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑