相同函数,不同轨迹:没有标准优化器对Transformer重参数化是等变的
Same Function, Different Trajectory: No Standard Optimizer Is Equivariant to Transformer Reparameterization
AI总结:
该研究发现代表相同函数的Transformer可遵循不同训练轨迹,提出SAGGS及Soft SAGGS方法纠正Transformer矩阵尺度不平衡,在WikiText-103等数据集上降低了困惑度,且在检查点重启实验中表现优异。
摘要:
我们证明,代表相同函数的两个Transformer可以遵循不同的训练轨迹。例如,将查询矩阵加倍并将其键矩阵减半会保留模型的函数,但会改变优化器看到的梯度尺度。我们的理论分析表明,标准的块局部一阶优化器在共享学习率下无法按参数比例缩放更新。对于AdamW,仅变换一阶和二阶矩估计值无法纠正参数与更新尺度之间的不匹配。为了使从等价检查点重启的运行遵循相同轨迹,我们平衡矩阵对并一起变换它们的矩估计值,使不同但等价的训练状态处于相同起点。为了在不改变预测的情况下纠正成对Transformer矩阵之间的尺度不平衡,我们提出了对称感知梯度几何稳定化(Symmetry-Aware Gradient Geometry Stabilization,SAGGS),它会周期性地均衡精确对称对的Frobenius范数,以及其阻尼变体Soft SAGGS。在WikiText-103上,1.01亿参数规模下,SAGGS将困惑度(PPL)降低了0.374±0.026;在3100万参数的现代架构复现中,Soft SAGGS将PPL降低了0.780±0.040,两者均在尺度不平衡条件下取得结果。在1.238亿参数的检查点重启实验中,相互缩放矩阵对在重启时几乎不改变验证损失,但使最终PPL增加了3.78±0.42;硬重平衡和软重平衡则将PPL恢复至与对照组相差0.02以内。
英文摘要:
We show that two Transformers representing the same function can follow different training trajectories. For example, doubling a query matrix and halving its key matrix preserves the model's function but changes the gradient scales seen by the optimizer. Our theoretical analysis establishes that standard block-local first-order optimizers fail to scale updates with parameters under a shared learning rate. For AdamW, transforming the first- and second-moment estimates alone does not correct the mismatch between parameter and update scales. To make runs restarted from equivalent checkpoints follow the same trajectory, we balance matrix pairs and transform their moment estimates together, bringing distinct but equivalent training states to the same starting point. To correct scale imbalance between paired Transformer matrices without changing predictions, we propose Symmetry-Aware Gradient Geometry Stabilization (SAGGS), which periodically equalizes the Frobenius norms of exact symmetry pairs, and its damped variant, Soft SAGGS. SAGGS reduces perplexity (PPL) by $0.374\pm0.026$ at 101M parameters on WikiText-103, and Soft SAGGS reduces PPL by $0.780\pm0.040$ in a 31M modern-architecture replication, both under scale imbalance. In a 123.8M checkpoint-resume experiment, reciprocally rescaling matrix pairs barely changes validation loss at restart but increases final PPL by $3.78\pm0.42$; hard and soft rebalancing recover to within $0.02$ PPL of the control.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。