A PDE-based Explanation of Extreme Numerical Sensitivities and Edge of Stability in Training Neural Networks
Yuxin Sun, Dong Lao, Ganesh Sundaramoorthi, Anthony Yezzi
TL;DR
This work presents a PDE-based framework to explain restrained numerical instabilities observed during SGD training of CNNs. By deriving a gradient-flow PDE and its discretization, the authors establish CFL-type stability bounds linking learning rate and weight decay, and show that instabilities can remain localized and oscillatory (restrained) rather than causing global divergence. They connect these restrained instabilities to the Edge of Stability (EoS), offering mechanistic insight into why practical training often operates beyond classical stability limits and how regularization and network depth influence these dynamics. The findings suggest adaptive, space-time localized learning-rate strategies to maintain stability while preserving training efficiency, with broad implications for understanding and mitigating numerical conditioning issues in deep learning practice.
Abstract
We discover restrained numerical instabilities in current training practices of deep networks with stochastic gradient descent (SGD), and its variants. We show numerical error (on the order of the smallest floating point bit and thus the most extreme or limiting numerical perturbations induced from floating point arithmetic in training deep nets can be amplified significantly and result in significant test accuracy variance (sensitivities), comparable to the test accuracy variance due to stochasticity in SGD. We show how this is likely traced to instabilities of the optimization dynamics that are restrained, i.e., localized over iterations and regions of the weight tensor space. We do this by presenting a theoretical framework using numerical analysis of partial differential equations (PDE), and analyzing the gradient descent PDE of convolutional neural networks (CNNs). We show that it is stable only under certain conditions on the learning rate and weight decay. We show that rather than blowing up when the conditions are violated, the instability can be restrained. We show this is a consequence of the non-linear PDE associated with the gradient descent of the CNN, whose local linearization changes when over-driving the step size of the discretization, resulting in a stabilizing effect. We link restrained instabilities to the recently discovered Edge of Stability (EoS) phenomena, in which the stable step size predicted by classical theory is exceeded while continuing to optimize the loss and still converging. Because restrained instabilities occur at the EoS, our theory provides new insights and predictions about the EoS, in particular, the role of regularization and the dependence on the network complexity.
