arXiv:2607.20552cs.LG2026-07被引 1

用热力学方法提前预测并加速神经网络的泛化过程。

Thermodynamic Weight Decay: Exploring Grokking Acceleration via Attention Specific Heat

论文配图:Thermodynamic Weight Decay: Exploring Grokking Acceleration via Attention Specific Heat
图 1 · 摘自论文原文
  • 将注意力方差类比为热容,通过峰值预判泛化时机。
  • 新优化器在4000轮内实现2802轮泛化,基线无法泛化。
  • 无需调参,适用于多种任务,可解释性强。

Grokking——神经网络在记忆训练数据后长时间才出现泛化现象——耗时数千轮且难以预测。基于Transformer注意力与热力学系统的形式同构性,我们把注意力logits的方差视为比热容Cv,发现其峰值总在泛化前出现。提出CvAdamW:一种在线监测Cv的AdamW变体,检测到相变时动态调整权重衰减以注入热能。通过迭代改进,解决初始化噪声、小批量波动和滑跳致盲三种失败模式,引入记忆门与指数移动平均减震器。在模97加法任务中,该方法在4000轮预算内于第2802轮实现grokking,而基线始终未泛化。进一步提出无量纲z-score重构,消除任务特定超参数,在10组种子上验证:冷启动版本使平均泛化延迟减少257轮(6.0%),中位数166轮,显著优于8/10种子;所有10组种子均在泛化前出现Cv峰值。结果表明,神经网络存在可探测的泛化前兆,物理启发的按比例干预可在固定算力下促进泛化。代码与数据公开。

原文摘要 · Abstract (English)

Grokking -- the delayed generalization of neural networks long after they have memorized their training data -- wastes thousands of training epochs and is notoriously unpredictable. Building on the recent result that Transformer attention is formally isomorphic to a thermodynamic system, we treat the variance of attention logits as a specific heat Cv and show that its peak reliably precedes the generalization transition. We introduce CvAdamW, a drop-in AdamW variant that monitors Cv online and injects thermal energy by dynamically scaling weight decay when a phase transition is detected. Through a strictly iterative development process we identify three failure modes -- initialization noise, mini-batch micro-ripples, and slingshot blinding -- and resolve them with a memorization gate and an exponential-moving-average shock absorber. On modular arithmetic (a+b mod 97), CvAdamW enables grokking at epoch 2802 in a 4000-epoch budget where the baseline never groks. We further propose a scale-invariant z-score reformulation that removes task-specific hyperparameters, and evaluate it across 10 paired seeds. A paired analysis shows the cold-start variant reduces mean grokking latency by 257 epochs (6.0%; median 166 epochs; Wilcoxon p=0.049, Cohen's d=0.68, bootstrap 95% CI [53,489]), improving 8 of 10 seeds; on this single task Cv peaks before grokking in all 10 seeds. Our results indicate that neural networks may expose detectable precursors of impending generalization transitions, and that a physically motivated, proportional intervention can facilitate generalization within a fixed compute budget. Code and data are public.

神经网络热力学泛化加速

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。