Abstract
Curvature in the form of the Hessian or its generalized Gauss-Newton (GGN) approximation is valuable for algorithms that rely on a local model for the loss to train, compress, or explain deep networks. However, for deep models, these matrices are too large to be stored or inverted. ViViT is a new curvature model that makes second-order information—specifically the eigenvalues and eigenvectors of the GGN matrix—accessible for deep networks without the massive computational overhead usually associated with the Hessian. By exploiting the GGN's inherent low-rank structure, it enables efficient computation of per-sample directional derivatives and offers a flexible, fine-grained trade-off between accuracy and speed.
Introduction
Most modern deep learning optimization relies almost exclusively on first-order information: the average gradient across a mini-batch. While second-order methods theoretically offer faster convergence and better local models of the loss landscape, they are notoriously difficult to scale. A Hessian for a model with $D$ parameters is a $D \times D$ matrix; for a million-parameter model, that’s a trillion entries—far too large to store or invert. Existing workarounds like K-FAC (Kronecker-factored approximate curvature) make this manageable by assuming a specific block-diagonal structure, but they often ignore the distribution of curvature across the mini-batch. ViViT addresses these challenges by leveraging the low-rank structure of the GGN approximation.
Methodology
The core innovation of ViViT is the exploitation of the GGN's low-rank structure. The GGN matrix $G$ can be written as a product $VV^\top$, where $V$ is a matrix of size $D \times NC$ ($D$ parameters, $N$ samples, $C$ outputs/classes). In deep learning, $D$ is usually much larger than $NC$. Instead of finding the eigenvalues of the massive $D \times D$ matrix $G$, ViViT computes the eigenvalues of the much smaller $NC \times NC$ Gram matrix $\tilde{G} = V^\top V$. The non-zero eigenvalues are identical, and the eigenvectors of $G$ can be easily reconstructed from the eigenvectors of $\tilde{G}$.
ViViT is built on top of the BackPACK library for PyTorch, extracting the necessary components in a single backward pass. To handle large-scale problems, the authors introduce several approximations: Monte Carlo (MC) sampling to reduce the $C$ dimension, curvature sub-sampling of the mini-batch, and block-diagonal approximations applied layer-wise.
Insights into Curvature
The paper empirically confirms that the top eigenspace of the GGN overlaps significantly (often >85%) with that of the full Hessian, justifying its use as a reliable proxy for curvature. By computing the Signal-to-Noise Ratio (SNR) of curvature along different directions, the authors found that the "signal" drops by orders of magnitude during training. This suggests that curvature becomes increasingly "noisy" as the model converges, a vital insight for designing second-order optimizers.
Performance and Scalability
ViViT demonstrates significant efficiency gains over traditional methods. For computing multiple eigenpairs (e.g., the top 10), computing the full Gram spectrum is faster and more stable than "matrix-free" power iterations. Furthermore, ViViT is highly memory-efficient; on CIFAR-10, the "critical batch size" for computing eigenvalues is often 10x larger than the standard training batch size.
Conclusion
ViViT provides a scalable and flexible framework for accessing curvature information in deep networks. By moving beyond simple first-order gradients and providing efficient access to the GGN's spectrum, it opens the door for more robust optimizers and diagnostic tools that can adapt to the local geometry of the loss landscape. Future work will focus on utilizing this per-sample curvature noise to create optimizers that automatically adjust step sizes based on local quadratic model reliability.
Summary updated