TL;DR
This paper introduces AdaDiag, a novel optimization framework that boosts the convergence speed of adaptive methods like Adam by periodically rotating the gradient space using full-rank Singular Value Decomposition (SVD). This rotation naturally aligns gradients to make their covariance matrix approximately diagonal, capturing crucial curvature information and unlocking up to a 2x sample efficiency speedup when training large language models.
What Problem Does This Paper Address?
Popular deep learning optimizers like Adam and RMSprop rely on a diagonal approximation of the gradient covariance matrix to adjust learning rates for individual parameters. While this approach is highly memory-efficient, it completely ignores the off-diagonal elements—the correlations between gradients of different parameters.
Ignoring these correlations leads to suboptimal updates and slower training, especially when navigating complex, non-convex loss landscapes filled with saddle points and sharp valleys. True second-order methods (like Natural Gradient Descent) capture these correlations using a full preconditioner matrix, but they are computationally prohibitive for modern deep networks, requiring quadratic storage ($O(d^2)$) and cubic computation time ($O(d^3)$). The authors set out to bridge this gap: How can we leverage gradient correlations without incurring catastrophic computational overhead?
Methods
Instead of trying to directly approximate or compress a massive, non-diagonal preconditioner matrix, the authors propose a clever alternative: change the coordinate space so the matrix becomes diagonal.
The core algorithm, AdaDiag, works as follows:
- Periodic SVD: Every $T$ steps (e.g., every 200 or 500 iterations), the algorithm performs a full-rank Singular Value Decomposition (SVD) on the gradient matrix $G_t$ to obtain orthogonal rotation matrices $P_t$ and $Q_t$.
- Gradient Projection: In the intermediate steps, gradients are projected into a transformed space ($\tilde{G}_t = P_t^\top G_t Q_t$). In this rotated space, the gradient covariance matrix naturally becomes approximately diagonal.
- Diagonal Adaptive Update: Standard element-wise moving averages (like those in Adam) are computed in this transformed space, which is now mathematically justified due to the induced diagonal structure.
- Invertible Back-Projection: Because $P_t$ and $Q_t$ are full-rank and orthogonal, the transformation is entirely invertible. The updates are projected back to the original parameter space to update the model weights.
The authors introduce two flavors: AdaDiag (one-sided projection) and AdaDiag++ (two-sided projection). Crucially, they demonstrate that this framework can be seamlessly integrated with memory-efficient optimizers like Adafactor and Hfac, resulting in AdafacDiag and HfacDiag.
Datasets
The authors evaluated their methods across two primary domains:
- Image Classification: Pretraining ResNet50, ViT-S/16, and ViT-B/32 from scratch on the ImageNet1k dataset.
- Language Modeling: Pretraining LLaMA-based large language models (60M, 130M, and 350M parameters) on the C4 (Colossal Clean Crawled Corpus) dataset.
Key Insights and Ideas
- Rotation Over Approximation: Rather than trying to approximate off-diagonal correlations in the original space, rotating the space forces the off-diagonal elements toward zero. This makes the standard diagonal approximation significantly more accurate.
- Why Full-Rank SVD Matters: Recent methods like GaLore use truncated (low-rank) SVD to save memory. However, the authors show that truncated SVD actually destroys the diagonal sparsity structure of the gradient covariance matrix. Full-rank SVD is essential to preserve complete bases and properly diagonalize the preconditioner.
- Subspace Stability: Computing SVD at every step is too expensive. However, because optimization trajectories tend to stay within stable low-dimensional subspaces over short horizons, performing SVD periodically (e.g., every 500 steps) adds negligible computational overhead (<10% wall-clock time) while retaining the optimization benefits.
Key Results
Image Classification
On ImageNet1k, AdaDiag and AdaDiag++ consistently converged faster and achieved higher final top-1 accuracy compared to AdamW and Shampoo across ResNet and Vision Transformer architectures.
Language Modeling
The most dramatic improvements were observed in language modeling. When training LLaMA models on the C4 dataset, AdaDiag achieved a 1.5x to 2x speedup in sample efficiency over standard Adam, reaching the same validation perplexity in half the training steps.
Furthermore, when combined with memory-efficient frameworks, HfacDiag matched the memory efficiency of low-rank methods like GaLore while delivering substantially better downstream performance.
Limitations and Future Work
- Memory Overhead: Storing the full-rank orthogonal matrices $P_t$ and $Q_t$ introduces additional memory overhead. Although this is successfully mitigated by integrating the method with Adafactor and Hfac, it remains a factor for extremely large layers.
- Scale Constraints: Due to hardware resource constraints, the authors limited their evaluation to models up to 350 million parameters. Testing the framework on multi-billion parameter models remains an open direction.
- Dynamic Subspace Theory: While the continuous-time Hamiltonian framework provided convergence guarantees, a deeper theoretical understanding of how momentum interacts across different rotated subspaces over time is still needed.
Summary updated