ViViT: Curvature Access Through The Generalized Gauss-Newton’s Low-Rank Structure

Felix Dangel, Lukas Tatzel, Philipp Hennig

TL;DR

This paper introduces ViViT, a novel method for efficiently computing curvature information (specifically, the Generalized Gauss-Newton approximation) in deep neural networks. By exploiting the low-rank structure of this curvature, ViViT enables efficient calculation of eigenvalues, eigenvectors, and per-sample directional derivatives, offering a flexible trade-off between computational cost and accuracy, and providing insights into curvature noise.

What Problem Does This Paper Address?

Training, compressing, and explaining deep neural networks often requires understanding the curvature of the loss landscape, typically approximated by the Hessian or its Generalized Gauss-Newton (GGN) approximation. However, existing methods for accessing this curvature information either rely on computationally expensive implicit matrix multiplications or make simplifying assumptions (like the Kronecker-factored approach, K-FAC) that ignore mini-batch noise and can limit accuracy. This gap hinders the development of advanced methods that could benefit from richer curvature information, especially concerning the impact of data sampling on curvature.

Methods

ViViT leverages the inherent low-rank structure of the GGN, which can be expressed as an outer product of vectors derived from per-sample contributions. This factorization allows for efficient computation of the GGN's eigenspectrum (eigenvalues and eigenvectors) by solving a much smaller problem related to a Gram matrix. Crucially, this computation can be performed in parallel with gradient computation during a single backward pass. ViViT also introduces approximations that allow for a tunable cost-accuracy trade-off, ranging from the exact GGN to a computationally cheaper version. A key innovation is the ability to compute per-sample directional derivatives, providing a measure of curvature uncertainty across the mini-batch.

Datasets

The paper uses standard datasets for training and evaluation, including:

  • FASHION-MNIST
  • CIFAR-10
  • CIFAR-100

These datasets are used with various deep convolutional and residual network architectures.

Key Insights and Ideas

  • GGN's Low-Rank Structure is Key: The paper demonstrates that the GGN's low-rank structure is not just a theoretical curiosity but a practical avenue for efficient computation of its properties.
  • Curvature Noise Matters: ViViT's ability to compute per-sample directional derivatives provides a direct way to quantify how mini-batch sampling affects curvature, a crucial aspect for robust optimization and uncertainty estimation.
  • Flexible Cost-Accuracy Trade-off: The proposed approximations allow users to tailor the computational cost to their needs, making advanced curvature analysis accessible even with limited resources.
  • GGN as a Good Hessian Proxy: The experiments show a strong overlap between the eigenspaces of the full-batch GGN and Hessian, reinforcing the GGN's utility as a practical and computationally more tractable alternative.

Key Results

  • Efficient Eigen-computation: ViViT significantly outperforms traditional power iteration methods for computing multiple eigenpairs, especially as the number of requested eigenpairs increases.
  • Scalability: The method scales to large batch sizes, with approximations further increasing the applicable batch sizes beyond those typically used for training.
  • Curvature Uncertainty Quantification: ViViT provides a measure of curvature noise through per-sample directional derivatives, showing that curvature signal decreases during training and can vary significantly across directions.
  • Implementation: A fully-featured PyTorch implementation is provided, extending the BACKPACK library.

Limitations and Future Work

  • Approximation Trade-offs: While ViViT offers a cost-accuracy trade-off, the paper acknowledges that approximations inherently reduce the precision of the curvature information. The choice of approximation depends on the specific application and computational budget.
  • Future Work: The authors suggest that the rich curvature information provided by ViViT can be used to develop novel second-order optimization methods that adapt to noise dynamics and to integrate into diagnostic tools for debugging and understanding deep learning models. The paper also hints at applications in uncertainty quantification and model compression.

Summary updated

BibTeX
@article{dangel2023vivit,
  author = {Felix Dangel and Lukas Tatzel and Philipp Hennig},
  title = {{ViViT: Curvature Access Through The Generalized Gauss-Newton’s Low-Rank Structure}},
  journal = {Trans. Mach. Learn. Res.},
  year = {2023},
  url = {https://openreview.net/forum?id=XdNtdlJeNG},
}
Figure