通过矩阵对角化提升自适应优化器收敛速度
Improving Adaptive Moment Optimization via Preconditioner Diagonalization
- 构建结构化预条件矩阵并映射到对角空间
- 在大模型上实现2倍于Adam的训练加速
- 兼容高效优化器,降低计算开销
现代自适应优化方法(如Adam及其变体)已成为深度学习中最常用的工具。这些算法能根据梯度统计动态调整更新步长,相比传统随机梯度下降,在模型规模和超参数调优方面更具鲁棒性。然而,现有方法使用的梯度统计信息未能充分捕捉梯度协方差,导致参数空间某些方向更新不佳,可能影响收敛速度。本文通过维护一个结构化的预条件矩阵来记录协方差信息,不采用直接近似,而是引入可逆变换,将该矩阵映射至近似对角的空间,从而在变换空间中实现对角近似。这一设计带来显著的计算优势。实验表明,该方法可显著提升现代自适应优化器的收敛速度。在大型语言模型LLaMA上,相较于基线Adam实现了2倍加速。同时,该方法可与内存高效的Adafactor等优化器结合,有效控制计算开销。
原文摘要 · Abstract (English)
Modern adaptive optimization methods, such as Adam and its variants, have emerged as the most widely used tools in deep learning over recent years. These algorithms offer automatic mechanisms for dynamically adjusting the update step based on estimates of gradient statistics. Compared to traditional algorithms like Stochastic Gradient Descent, these adaptive methods are typically more robust to model scale and hyperparameter tuning. However, the gradient statistics employed by these methods often do not leverage sufficient gradient covariance information, leading to suboptimal updates in certain directions of the parameter space and potentially slower convergence. In this work, we keep track of such covariance statistics in the form of a structured preconditioner matrix. Unlike other works, our approach does not apply direct approximations to estimate this matrix. We instead implement an invertible transformation that maps the preconditioner matrix into a new space where it becomes approximately diagonal. This enables a diagonal approximation of the preconditioner matrix in the transformed space, offering several computational advantages. Empirical results show that our approach can substantially enhance the convergence speed of modern adaptive optimizers. Notably, for large language models like LLaMA, we can achieve a speedup of 2x compared to the baseline Adam. Additionally, our method can be integrated with memory-efficient optimizers like Adafactor to manage computational overhead.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。