SOAP:使用Adam改进并稳定Shampoo
SOAP: Improving and Stabilizing Shampoo using Adam
AI总结:
SOAP算法通过在Shampoo预处理器的特征基中运行Adam,仅增加一个超参数便有效缓解了降低特征分解频率导致的性能下降,在语言模型预训练中显著提升了计算效率。
摘要:
越来越多的证据表明,在深度学习优化任务中,作为一种高阶预处理方法的Shampoo优于Adam。然而,与仅更新一阶矩和二阶矩运行平均值的Adam相比,Shampoo的缺点包括额外的超参数和计算开销。本研究在Shampoo(以1/2幂实现)与Adafactor(Adam的一种内存高效近似方法)之间建立了正式联系,表明Shampoo等价于在Shampoo预处理器的特征基中运行Adafactor。这一见解促成了一个更简单且计算高效的算法的设计:在预处理器的特征基中使用Adam的Shampoo(SOAP)。在提高Shampoo的计算效率方面,最直接的方法是简单地降低计算Shampoo特征分解的频率。不幸的是,正如我们的实验结果所示,这会导致性能下降,且下降程度随该频率的降低而加剧。SOAP通过像Adam那样不断更新二阶矩的运行平均值,但在当前(缓慢变化的)坐标基中进行,从而缓解了这种性能下降。此外,由于SOAP等价于在旋转空间中运行Adam,因此与Adam相比,它仅引入了一个额外的超参数(预处理频率)。我们在360m和660m规模的模型语言模型预训练上对SOAP进行了实证评估。在大批量设置下,与AdamW相比,SOAP将迭代次数减少了40%以上,实际运行时间减少了35%以上;与Shampoo相比,这两项指标均提升了约20%。SOAP的实现可在 https://github.com/nikhilvyas/SOAP 获取。
英文摘要:
There is growing evidence of the effectiveness of Shampoo, a higher-order preconditioning method, over Adam in deep learning optimization tasks. However, Shampoo's drawbacks include additional hyperparameters and computational overhead when compared to Adam, which only updates running averages of first- and second-moment quantities. This work establishes a formal connection between Shampoo (implemented with the 1/2 power) and Adafactor -- a memory-efficient approximation of Adam -- showing that Shampoo is equivalent to running Adafactor in the eigenbasis of Shampoo's preconditioner. This insight leads to the design of a simpler and computationally efficient algorithm: $\textbf{S}$hampo$\textbf{O}$ with $\textbf{A}$dam in the $\textbf{P}$reconditioner's eigenbasis (SOAP). With regards to improving Shampoo's computational efficiency, the most straightforward approach would be to simply compute Shampoo's eigendecomposition less frequently. Unfortunately, as our empirical results show, this leads to performance degradation that worsens with this frequency. SOAP mitigates this degradation by continually updating the running average of the second moment, just as Adam does, but in the current (slowly changing) coordinate basis. Furthermore, since SOAP is equivalent to running Adam in a rotated space, it introduces only one additional hyperparameter (the preconditioning frequency) compared to Adam. We empirically evaluate SOAP on language model pre-training with 360m and 660m sized models. In the large batch regime, SOAP reduces the number of iterations by over 40% and wall clock time by over 35% compared to AdamW, with approximately 20% improvements in both metrics compared to Shampoo. An implementation of SOAP is available at https://github.com/nikhilvyas/SOAP.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。