Table of Contents
Fetching ...

Improving Adaptive Moment Optimization via Preconditioner Diagonalization

Son Nguyen, Bo Liu, Lizhang Chen, Qiang Liu

TL;DR

This work tackles inefficiencies in adaptive moment optimizers by introducing preconditioner diagonalization through an invertible gradient-space transform. By rotating gradients with full-rank projections and applying a diagonal preconditioner in the rotated space, the method improves the estimation of second-order statistics while enabling back-projection to the original parameter space; a periodic SVD-based scheme keeps the extra cost manageable. Convergence guarantees are established via a Hamiltonian descent framework, and empirical results show substantial speedups and accuracy/robustness gains across image classification and language modeling tasks, including 1.8–2x speedups on LLaMA pretraining. The approach also integrates with memory-efficient optimizers (Adafactor, Hfac), offering practical improvements for large-scale models and providing a flexible, theoretically grounded paradigm for adaptive optimization in dynamic subspaces.

Abstract

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.

Improving Adaptive Moment Optimization via Preconditioner Diagonalization

TL;DR

This work tackles inefficiencies in adaptive moment optimizers by introducing preconditioner diagonalization through an invertible gradient-space transform. By rotating gradients with full-rank projections and applying a diagonal preconditioner in the rotated space, the method improves the estimation of second-order statistics while enabling back-projection to the original parameter space; a periodic SVD-based scheme keeps the extra cost manageable. Convergence guarantees are established via a Hamiltonian descent framework, and empirical results show substantial speedups and accuracy/robustness gains across image classification and language modeling tasks, including 1.8–2x speedups on LLaMA pretraining. The approach also integrates with memory-efficient optimizers (Adafactor, Hfac), offering practical improvements for large-scale models and providing a flexible, theoretically grounded paradigm for adaptive optimization in dynamic subspaces.

Abstract

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.

Paper Structure

This paper contains 22 sections, 1 theorem, 32 equations, 11 figures, 6 tables, 3 algorithms.

Key Result

Proposition 1

Using this general approach, we formulate continuous-time forms for AdaDiag and AdaDiag++: Both yield the same Hamiltonian function: $\mathcal{H}(\bm{\mathrm{W}}, \bm{\mathrm{M}}, \bm{\mathrm{V}}) = \mathcal{L}(\bm{\mathrm{W}}) + \dfrac{1}{2} \left \langle \bm{\mathrm{M}} / (\sqrt{\bm{\mathrm{V}}} + \epsilon), \bm{\mathrm{M}} \right \rangle$.

Figures (11)

  • Figure 1: Histograms of off-diagonal elements $\mathcal{C} (\bm{\mathrm{G}}_\tau)$ (original) and $\mathcal{C} (\widetilde{\bm{\mathrm{G}}}_\tau)$ (two-sided projection), corresponding to the two first layers of ResNet50 trained on ImageNet1k. In this experiment, we set the frequency $T = 500$ and plot histograms at iterations with and without SVD applied.
  • Figure 2: Sparsity of one-sided projection.
  • Figure 3: Illustration of network reparameterization induced by full-rank gradient projection.
  • Figure 4: Top-1 Accuracy of optimizers in pretraining ResNet50, ViT-B/32, and ViT-S/16 from scratch on the ImageNet1k. For better ViT's visualization, we crop the learning curve up to epoch 80.
  • Figure 5: Training progression for pre-training LLaMA models on C4 dataset.
  • ...and 6 more figures

Theorems & Definitions (1)

  • Proposition 1