ViViT: Curvature access through the generalized Gauss-Newton's low-rank structure

Felix Dangel, Lukas Tatzel, Philipp Hennig

Introduction

Modern deep learning optimization primarily relies on first-order gradients. While second-order information—the curvature of the loss landscape—offers potential for faster and more stable training, its computational cost is often prohibitive. The full Hessian matrix is too large to store or invert for networks with millions of parameters. Existing approximations like K-FAC or iterative methods like Hessian-free optimization have limitations in terms of structural assumptions or speed. ViViT introduces a method to efficiently access exact properties of the Generalized Gauss-Newton (GGN) matrix by exploiting its low-rank structure.

Methods: Exploiting Low-Rank Structure

The GGN matrix $G$ is a popular positive semi-definite approximation of the Hessian. For a mini-batch of size $N$ and $C$ classes, $G$ (a $D \times D$ matrix, where $D$ is the number of parameters) can be factored as $G = VV^\top$, where $V$ is a $D \times NC$ matrix. Since $D \gg NC$, ViViT shifts the computation to a much smaller $NC \times NC$ Gram matrix $\tilde{G} = V^\top V$.

Spectral density of the GGN and geometric interpretation of directional derivatives.

As illustrated in the spectral density and geometric diagrams above, the non-zero eigenvalues of $G$ are identical to those of $\tilde{G}$, and its eigenvectors can be reconstructed via a simple transformation. This approach allows for:

  • Exact Eigen-decomposition: Efficiently finding the principal directions of curvature.
  • Per-sample Information: Computing directional derivatives for each individual sample in a batch along these principal directions.
  • Scalability: Using Monte Carlo (MC) sampling and curvature sub-sampling to handle large class counts or batch sizes.

Key Insights

Experiments show that the top eigenspace of the GGN overlaps significantly with that of the full Hessian, justifying its use as a proxy. Furthermore, curvature is highly concentrated in a small subspace. By analyzing per-sample derivatives, the authors observed that curvature "noise" increases as training progresses, which may explain the challenges faced by second-order optimizers in later stages of training.

Key Results: Efficiency and Scaling

ViViT's primary advantage is its computational efficiency. Unlike iterative power methods that scale linearly with the number of requested eigenpairs $k$, ViViT's runtime remains nearly constant because it computes the entire Gram matrix at once.

Computational efficiency of ViViT compared to power iteration.

As shown in the figure above, ViViT variants (exact, sub-sampled, and MC) significantly outperform power iteration when multiple top eigenpairs are needed. The method also demonstrates structural stability; even with sub-sampling or MC approximations, it captures the dominant directions of the loss landscape's curvature. This efficiency makes it feasible to monitor curvature properties in real-time during training on standard benchmarks like CIFAR-10 and CIFAR-100.

Conclusion

ViViT provides a practical middle ground for accessing rich second-order information without the overhead of full Hessian computations. By leveraging the low-rank structure of the GGN and the efficiency of Gram space operations, it enables more detailed monitoring of network curvature and paves the way for more robust second-order optimization techniques that can adapt to per-sample noise.

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