Manuscript Offprint

arXiv:2611.00473

Stochastic learning flow: moment equations for stochastic gradient descent at finite step size

Christian Schmid, James M Murray

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Christian Schmid1,2^{1,2}, James M Murray1∗^{1*}

1^{1}Institute of Neuroscience, University of Oregon

2^{2}Center for Neural Science, New York University

November 3, 2026

Analytical theories of learning in deep networks often assume gradient flow, discarding the finite step size and batch noise of stochastic gradient descent (SGD). Starting from the discrete update, we derive continuous-time equations for the mean and covariance of the parameter distribution under a Gaussian closure for a general stochastic learning, to first order in the learning rate η\eta. Applying these stochastic learning flow (SLF) equations to SGD, we show that the mean descends an effective loss regularized by the covariance and loss curvature, while the covariance, unlike in stochastic differential equation approximations, becomes unstable at curvature 2/η2/\eta. In SGD ensembles of linear and nonlinear networks, SLF predicts learning curves and mean trajectories more accurately than gradient flow and captures the covariance dynamics, failing where the parameter distribution becomes strongly non-Gaussian. In the full-batch limit, the edge of stability corresponds to a stationary point of the coupled sharpness-covariance dynamics, recovering self-stabilization and central flow, and batch-to-batch curvature fluctuations lower this threshold under SGD.

1 Introduction

Many of the most successful analytical theories of learning in deep networks, including exact solutions for deep linear networks [1, 2] and the neural tangent kernel [3], are formulated in the continuous-time limit of gradient flow. This limit makes the tools of dynamical systems theory available, but at the cost of discarding the finite step size and the sampling noise of stochastic, iterative algorithms such as stochastic gradient descent (SGD). These are not small corrections in practice. The learning rate and batch size change which solutions training finds and how well they generalize [4, 5, 6, 7], large learning rates produce qualitatively new dynamics [8, 9], and networks trained with gradient descent typically operate at the edge of stability, where the product of the learning rate and the largest Hessian eigenvalue is close to 2, far from the regime in which gradient flow applies [10].

A widely used approach approximates SGD by a stochastic differential equation (SDE), in which gradient flow is augmented by a diffusion term matched to the covariance of the minibatch gradient noise [11, 5, 12, 13]. Higher-order versions add deterministic finite-step corrections to the drift [13, 14, 15, 16], but as expansions in the product of the learning rate and the curvature, which break down where that product is of order one. In particular, these descriptions contain no instability at curvature 2/η2/\eta, and SDE surrogates of SGD do not stabilize where SGD does [17].

Conversely, the edge of stability has been analyzed with largely deterministic theories [18, 19], which recent work extends to SGD through local stability analyses [20, 21] or additive noise [22]. In high-dimensional

*Contact: jmurray9@uoregon.edu linear [23, 24, 25] and generalized-linear [26] models, exact deterministic equations for the risk under SGD at finite step size and batch size are available, but they rely on the quadratic structure of the loss. Ensembles of stochastic learners have also been described directly at the level of the parameter distribution. Kramers–Moyal expansions of the master equation for on-line learning at constant learning rate have long been used to describe the parameter distribution of stochastic learners, focusing on Fokker–Planck dynamics and their equilibria [27] or on moment equations with random update times [28]. Working instead from the discrete update, Yaida [29] derived exact fluctuation–dissipation relations at stationarity, and Liu et al. [30] obtained the exact stationary covariance of SGD near a quadratic minimum. What is missing is a continuous-time description of the parameter distribution that retains the deterministic effects of finite step size and the stochastic effects of minibatch sampling together, without expanding in the product of learning rate and curvature.

To derive such a description, we start from the discrete update rule and obtain, for general architectures and update rules, evolution equations for the mean and covariance of the parameter distribution p(θ,t)p(\theta, t) that retain all terms at first order in the learning rate. In these stochastic learning flow (SLF) equations, the parameter covariance is a dynamical variable on the same footing as the mean. Its noise-driven part coincides with the diffusion of SDE models, but additional finite-step terms qualitatively change its dynamics. For SGD, the mean descends an effective loss that includes an implicit regularization term set by the covariance and the loss curvature, which provides a mechanism for escape from saddle points and sharp minima.

We test the theory against ensembles of networks trained with SGD. In a deep linear network, SLF predicts the learning curves and parameter updates far more accurately than gradient flow at large learning rates and small batch sizes. In a nonlinear network trained on binary MNIST, the covariance correction improves the prediction of the mean by an amount that grows with the batch noise, and the integrated covariance matches the measured one. In both cases the description fails where the parameter distribution becomes strongly non-Gaussian. Finally, the SLF equations contain the edge-of-stability threshold and central flow as limiting cases, and show how fluctuations of the curvature across batches lower the threshold under SGD.

References (51)