arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2510.00236cs.LG
收藏

每例梯度:理解与改进优化器的新前沿

Per-example gradients: a new frontier for understanding and improving optimizers

Google DeepMind(谷歌DeepMind)

Vincent Roulet, Atish Agarwala

AI总结:

本文通过每例梯度变换分析了signSGD和Adam预条件器,揭示了优化中的关键操作位置与参数选择对性能的影响。

摘要:

深度学习中的训练算法通常将一批样本视为单一对象;它们在小批量上平均梯度,然后以各种方式处理平均值。计算其他统计量可能在自动微分(AD)框架中被视为资源消耗过大的问题。我们证明并非如此。一般来说,梯度统计可以通过对AD图进行手术来实现,这在某些情况下与小批量梯度计算相比几乎不产生计算和内存开销。此外,我们还表明,在某些模型类别中,包括Transformer,JAX的向量化转换提供了一种可行的实现方法用于原型设计和实验。然后,我们通过每例梯度变换的视角重新审视了优化中的两种非线性操作。我们首先研究了signSGD,并证明了在梯度处理链中sign操作的最佳位置对成功至关重要,可以通过简单的信噪比论证预测。接下来,我们研究了Adam预条件器的每例变种,并证明当预条件器由梯度分布的均值而非方差主导时,优化效果最佳——与传统观点相反。总体而言,我们展示了每例梯度信息能够带来新的分析和算法设计的可能性。

英文摘要:

Training algorithms in deep learning usually treat a mini-batch of samples as a single object; they average gradients over the mini-batch, and then process the average in various ways. Computing other statistics beyond the average may have been seen as prohibitively resource intensive in automatic differentiation (AD) frameworks. We show that this is not the case. Generally, gradient statistics can be implemented through a surgery of the AD graph, which, in some cases, incur almost no computational and memory overheads compared to the mini-batch gradient computation. Additionally, we show that in certain classes of models, including transformers, JAX's vectorization transformation offers a viable implementation for prototyping and experimentation. We then revise our understanding of two nonlinear operations in optimization through the lens of per-example gradient transformations. We first study signSGD and show that the optimal placement of the sign operation in the gradient processing chain is crucial to success and can be predicted with a simple signal-to-noise ratio argument. Next we study per-example variations of the Adam preconditioner, and show that optimization is best served when the preconditioner is dominated by the mean rather than the variance of the gradient distribution - in contrast to conventional wisdom. Overall we demonstrate that per-example gradient information enables new analyses and possibilities for algorithm design.

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

↑