研究证实权重矩阵秩压缩是 Grokking 的结果而非原因
Subspace Crystallization in Grokking: Rank Compression Tracks the Phase Transition
一篇很扎实的 grokking 机理研究,实验设计干净:先记住、后泛化的时间线被精确量化,还证明了压缩秩反而会阻碍 grokking。
一篇 arXiv 论文在 mean-field MLP 和单层 transformer 上训练模运算任务,检验 grokking 与权重矩阵有效秩下降的因果关系。实验显示所有 transformer 在 250 步内记住训练数据,而 grokking 起点(测试准确率首达 95%)出现在 6,500 到 21,000 步之间,有效秩最陡下降发生在起点后约 900 步。论文提出“子空间结晶”概念: transformer 过渡期所需的保留 99% 测试准确率的奇异方向数从四分之一以上降到约十分之一。强行限制低秩并不能加速 grokking,限制嵌入层秩还使 20 次运行中 15 次无法出现 grokking。
Subspace Crystallization in Grokking: Rank Compression Tracks the Phase Transition
Grokking describes understanding something deeply and intuitively. In neural networks, it is the phenomenon where a network generalizes long after memorizing its training data. This delay has been linked to a fall in the effective rank of the network's weight matrices, but whether this rank compression drives grokking or follows it is still unresolved. We study a mean-field MLP and a one-layer transformer trained on modular arithmetic and observe that: (i) Compression follows the onset, not memorization. Every transformer memorizes its training data within 250 steps, while the grokking onset (the first step at which test accuracy reaches 95%) varies from 6,500 to 21,000 steps. The steepest fall in effective rank comes about 900 steps after the onset, however late the onset occurs, and networks that memorize without grokking compress far less. (ii) Subspace crystallization. We call the span of the fewest top singular directions of a weight matrix that preserve 99% of test accuracy its sufficient subspace. Its size can shrink as the margin between the correct and the best wrong output grows, so we also count the directions needed to keep the outputs within 10%. In the transformer, this count falls during the transition from a quarter or more of the available directions to about a tenth, which we call subspace crystallization. (iii) Imposing low rank does not speed up grokking. Against a factorized full-rank control, capping the rank of the transformer's MLP input weights delays the onset, and capping the rank of its embedding stops 15 of 20 runs from grokking. Compression is therefore a signature of grokking rather than its cause.