An Effective Gram Matrix Characterizes Generalization in Deep Networks
Rubing Yang, Pratik Chaudhari
TL;DR
The paper tackles the problem of explaining generalization in deep networks trained by gradient methods by formulating a dynamical systems framework for the averaged generalization gap. It develops a differential equation for the gap, governed by a time-varying contraction factor $\bar{c}_n(t)$ and a perturbation factor $\bar{\epsilon}_n(t)$, and introduces an effective Gram matrix $K_n$ that expresses the asymptotic gap as $\vec{r}_n(0)^\top K_n \vec{r}_n(0)$, with $\vec{r}_n(0)$ the initial residual. The results show how the residual dynamics couple to the gradient covariance to drive generalization and demonstrate, across multiple datasets and architectures, that this quadratic form accurately predicts test loss while revealing a benign training regime in which the residual concentrates in the low-eigenvalue subspace of $K_n$. The framework links data- and architecture-dependent complexity to generalization, connects to kernel-method intuitions, and suggests extensions to other optimizers and interpolation settings with practical implications for understanding and predicting neural-network generalization.
Abstract
We derive a differential equation that governs the evolution of the generalization gap when a deep network is trained by gradient descent. This differential equation is controlled by two quantities, a contraction factor that brings together trajectories corresponding to slightly different datasets, and a perturbation factor that accounts for them training on different datasets. We analyze this differential equation to compute an ``effective Gram matrix'' that characterizes the generalization gap in terms of the alignment between this Gram matrix and a certain initial ``residual''. Empirical evaluations on image classification datasets indicate that this analysis can predict the test loss accurately. Further, during training, the residual predominantly lies in the subspace of the effective Gram matrix with the smallest eigenvalues. This indicates that the generalization gap accumulates slowly along the direction of training, charactering a benign training process. We provide novel perspectives for explaining the generalization ability of neural network training with different datasets and architectures through the alignment pattern of the ``residual" and the ``effective Gram matrix".
