Block Low-Rank Preconditioner with Shared Basis for Stochastic Optimization

Jui-Nan Yen, Sai Surya Duvvuri, Inderjit S. Dhillon, Cho-Jui HsiehNeurIPS 2023

TL;DR

This paper introduces a novel adaptive optimization method that significantly reduces the memory and computational costs of second-order optimizers for deep learning. By approximating diagonal blocks of the preconditioner with shared low-rank bases, the method achieves performance comparable to state-of-the-art techniques while being much more efficient.

What Problem Does This Paper Address?

Training modern deep neural networks often relies on adaptive optimization methods that go beyond simple gradient descent. Second-order methods, which consider the curvature of the loss function, can offer faster convergence but come with a hefty price tag: high computational complexity and memory requirements, especially for large models. While block-diagonal preconditioners offer a compromise, they still struggle with memory constraints, forcing the use of smaller blocks that limit performance. This paper tackles the challenge of making powerful second-order optimization practical for large-scale neural networks by developing a more efficient approximation of the preconditioner.

Methods

The core innovation lies in a "shared-basis block low-rank approximation" for the preconditioner. Instead of storing full diagonal blocks or independent low-rank approximations for each block, the authors propose using a single, shared low-rank basis across all blocks within a layer. Each block's approximation is then formed by combining this shared basis with a smaller, block-specific coefficient matrix. This approach drastically reduces memory requirements.

The authors also provide theoretical justification for this shared basis by analyzing the structure of the second-moment matrix in fully connected layers, showing that diagonal blocks tend to lie in a common low-dimensional subspace. An efficient online algorithm is developed to update this shared basis and the block coefficients during training, leveraging randomized SVD for computational efficiency.

Datasets

The proposed method was evaluated on two standard benchmarks:

  • Autoencoder benchmark: Trained on the MNIST dataset.
  • Transformer benchmark: Utilized the ancient Greek data from the Universal Dependencies dataset for a part-of-speech tagging task.

Key Insights and Ideas

  • Shared Subspace: The key insight is that diagonal blocks of the preconditioner often share a common low-dimensional subspace, allowing for a single basis to represent them efficiently.
  • Block-Diagonal Structure: The paper mathematically demonstrates that for fully connected layers, diagonal blocks of the second-moment matrix have a higher Frobenius norm than their corresponding off-diagonal blocks, supporting the block-diagonal approximation.
  • Efficiency Gains: By sharing the basis, the memory complexity is reduced from what would be required for independent low-rank approximations, making it more feasible for large models.
  • Theoretical Justification: The paper provides theoretical backing for the shared-basis approach, linking it to the low-rank nature of intermediate feature matrices in neural networks.

Key Results

The proposed method, termed "Block Low-Rank Preconditioner with Shared Basis," demonstrated strong performance across both benchmarks:

  • Autoencoder Benchmark: Achieved similar training performance to Shampoo but with 3.2x lower time and 1.5x lower memory.
  • Transformer Benchmark: Outperformed other methods, achieving ~1.8% improvement in validation error compared to Shampoo(1024) while using 3.5x lower time and less memory.
  • The method consistently outperformed first-order methods like Adam and was competitive with or superior to other second-order methods in terms of both speed and accuracy.

Limitations and Future Work

  • Rank Dependence: The space complexity of the proposed method scales quadratically with the rank k used in the low-rank approximation. While k=32 was sufficient for the tested benchmarks, this could still be a burden for extremely large-scale models.
  • Future Work: The authors suggest exploring methods to reduce the dependence on k while preserving performance, which would be a valuable direction for future research.

Summary updated

BibTeX
@inproceedings{yen2023block,
  author = {Jui-Nan Yen and Sai Surya Duvvuri and Inderjit S. Dhillon and Cho-Jui Hsieh},
  title = {{Block Low-Rank Preconditioner with Shared Basis for Stochastic Optimization}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=JzQlGqBm8d},
}
Figure