Combining Axes Preconditioners through Kronecker Approximation for Deep Learning

Sai Surya Duvvuri, Fnu Devvrit, Rohan Anil, Cho-Jui Hsieh, Inderjit S Dhillon

TL;DR

CASPR (Combining AxeS PReconditioners) is a novel adaptive optimization technique that bridges the gap between the computational efficiency of Shampoo and the theoretical power of full-matrix Adagrad. By utilizing a Kronecker-sum based approximation to combine gradient information across different parameter axes, CASPR achieves tighter convergence guarantees and better generalization than existing methods—with nearly the same computational overhead as Shampoo.

The Preconditioning Bottleneck

In deep learning, how we scale our gradient updates (preconditioning) significantly impacts both convergence speed and model generalization.

The theoretical "gold standard" is full-matrix Adagrad, which utilizes the second-moment information of all gradient coordinates. However, for a model with $d$ parameters, this requires $O(d^2)$ memory and $O(d^3)$ computation. This is completely infeasible for modern neural networks containing millions or billions of parameters. To cope, practitioners typically rely on diagonal methods like Adam or RMSProp, which only scale parameters individually and ignore correlations between them.

Shampoo was a breakthrough optimizer that used Kronecker products to approximate full-matrix statistics for matrix-shaped parameters, offering a practical middle ground. However, a significant "approximation gap" remains between Shampoo and ideal full-matrix Adagrad. CASPR was developed to close this gap.

Introducing CASPR

The authors introduce CASPR (Combining AxeS PReconditioners). Instead of the Kronecker product approach used by Shampoo, CASPR utilizes a Kronecker-sum based approximation.

The high-level mechanism works as follows:

  1. Axes Preconditioners: For any matrix-shaped parameter (e.g., a weight matrix in a Dense layer), CASPR computes separate "axes" preconditioners for the rows and the columns.
  2. Kronecker Sum: It combines these axes preconditioners using a sum rather than a product. Mathematically, this allows the authors to prove that CASPR is "sandwiched" between Shampoo and full-matrix Adagrad in Loewner order (a standard metric for comparing positive semi-definite matrices). Essentially, CASPR is mathematically closer to the ideal full-matrix statistic than Shampoo.
  3. Efficient Implementation: Despite the more complex underlying math, the authors derive a matrix update rule that only requires computing the same row and column statistics as Shampoo. Consequently, CASPR can be implemented as a minor modification to existing Shampoo codebases without increasing the asymptotic computational cost.

Theoretical Insights

  • The "Sandwich" Property: The paper's most critical theoretical insight proves that CASPR is bounded between Shampoo and full-matrix Adagrad. This provides formal justification for its superior performance: it captures more of the "true" second-moment information.
  • Tighter Regret Bounds: The authors prove that CASPR has a tighter "regret bound" (a measure of how much an optimizer deviates from the optimal path) in online convex optimization compared to Shampoo.
  • Practicality over Complexity: CASPR achieves these theoretical gains without requiring more memory or significantly more FLOPs than Shampoo, making it a highly practical, drop-in replacement.

Empirical Results

The authors evaluated CASPR across a diverse set of tasks, consistently outperforming both AdamW and Shampoo. Crucially, wall-clock time experiments confirmed that CASPR and Shampoo take almost identical amounts of time to train, proving that the theoretical improvements do not incur a practical speed penalty.

Graph Neural Networks (OGBG-molpcba): On this large-scale GNN benchmark for molecular property prediction, CASPR achieved a 1.4% relative improvement in test average precision over Shampoo and a 7% improvement over AdamW.

Test Average Precision on OGBG-molpcba

Transformers (Universal Dependencies): For parts-of-speech tagging across multiple languages, CASPR showed a 1% relative improvement in best validation accuracy over Shampoo and over 3% compared to AdamW.

Validation Accuracy on Universal Dependencies

Language Modeling (C4 Dataset): When training auto-regressive large language models (LLMs) ranging from 14M to 234M parameters, CASPR reached lower log perplexity than Shampoo. For a 234M parameter model, CASPR achieved a log perplexity of 2.794 compared to Shampoo's 2.802.

Limitations and Future Work

While CASPR demonstrates clear benefits for matrix-shaped parameters, the paper primarily focuses on 2D weight matrices. Higher-dimensional tensors (like those in attention layers) are currently handled by flattening them into 2D matrices; developing a native "multi-axis" Kronecker sum approach for tensors remains an open area for exploration. Additionally, adapting CASPR to approximate the Fisher Information Matrix used in Natural Gradient Descent (NGD) could potentially unlock even faster convergence for massive-scale models.

Summary updated

BibTeX
@inproceedings{duvvuri2024combining,
  author = {Sai Surya Duvvuri and Fnu Devvrit and Rohan Anil and Cho-Jui Hsieh and Inderjit S Dhillon},
  title = {{Combining Axes Preconditioners through Kronecker Approximation for Deep Learning}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=8j9hz8DVi8},
}
Figure