A VIEW OF MINI - BATCH SGD VIA GENERATING FUNCTIONS : CONDITIONS OF CONVERGENCE , PHASE TRANSITIONS , BENEFIT FROM NEGATIVE MOMENTA
Anonymous authors
Paper under double-blind review
A BSTRACT
Mini-batch SGD with momentum is a fundamental algorithm for learning large predictive models.
In this paper we develop a new analytic framework to analyze noise-averaged properties of mini-batch SGD for linear models at constant learning rates, momenta and sizes of batches.
Our key idea is to consider the dynamics of the second moments of model parameters for a special family of ”Spectrally
Expressible” approximations.
This allows to obtain an explicit expression for the generating function of the sequence of loss values.
By analyzing this generating function, we find, in particular, that 1) the SGD dynamics exhibits several convergent and divergent regimes depending on the spectral distributions of the problem; 2) the convergent regimes admit explicit stability conditions, and explicit loss asymptotics in the case of power-law spectral distributions; 3) the optimal convergence rate can be achieved at negative momenta.
We verify our theoretical predictions by extensive experiments with MNIST, CIFAR10 and synthetic problems, and find a good quantitative agreement.
I NTRODUCTION
We consider a classical mini-batch Stochastic Gradient Descent (SGD) algorithm (Robbins &
Monro, 1951; Bottou & Bousquet, 2007) with momentum (Polyak, 1964):
[Equation] [Equation]
Here, L B ( w ) = 1 b (cid:80) bi =1 l ( f ( x i , w ) , y i ) is the sampled loss of a model (cid:98) y
= f ( x , w ) , computed using a pointwise loss l ( (cid:98) y, y ) on a mini-batch B = { ( x i , y i ) } bs =1 of b data points representing the target function y =
f ∗ ( x ) .
The momentum term v n represents information about gradients from previous iterations and is well-known to significantly improve convergence both generally (Polyak, 1987) and for neural networks (Sutskever et al., 2013).
Re-sampling of the mini-batch B t at each
SGD iteration t creates a specific gradient noise, structured according to both the local geometry of the model f
( x , w ) and the quality of current approximation (cid:98) y .
In the context of modern deep learning, f ( x , w ) is usually very complex, and the quantitative prediction of the SGD behavior becomes a challenging task that is far from being complete at the moment.
Our goal is to obtain explicit expressions characterizing the average case convergence of mini-batch
SGD for the classical least-squares problem of minimizing quadratic objective L ( w ) .
This setup is directly related to modern neural networks trained with a quadratic loss function, since networks can often be well described – e.g., in the large-width limit (Jacot et al., 2018;
Lee et al., 2019)
or during the late stage of training (Fort et al., 2020) – by their linearization w.r.t.
parameters w .
A fundamental way to characterize least squares problems is through their spectral distributions : the eigenvalues λ k of the Hessian and the coefficients c k of the expansion of the optimal solution w ∗ over the Hessian eigenvectors.
Then, one can estimate certain metrics of the problem through spectral expressions , i.e. explicit formulas that operate with spectral distributions λ k , c k
but not with other details of the solution w ∗ or the Hessian.
A simple example is the standard stability condition for full-batch gradient descent (GD): α < 2 /λ max .
Various exact or approximate spectral expressions are available for full-batch GD-based algorithms (Fischer, 1996) and ridge regression (Canatar et al., 2021; Wei et al., 2022).
Here, we aim at obtaining spectral expressions and associated results (stability conditions, phase structure, loss asymptotics, average train loss
An important feature of spectral distributions in deep learning problems is that they often obey macroscopic laws – quite commonly a power law with a long tail of eigenvalues converging to 0 (see
Cui et al.
; Bahri et al.
; Kopitkov & Indelman (2020); Velikanov & Yarotsky (2021);
Atanasov et al.
(2021); Basri et al.
(2020) and Figs.
The typically simple form of macroscopic laws allows to theoretically analyze spectral expressions and obtain fine-grained results.
As an illustration, consider the full-batch GD for least squares regression on a MNIST dataset.
Standard optimization results (Polyak, 1987) do not take into account fine spectral details and give either non-strongly convex bound L GD ( w t )
=
O ( t − 1 ) or strongly-convex bound L GD ( w t ) ≤
L ( w 0 )
( λ max − λ min λ max + λ min ) 2 t .
Both these bounds are rather crude and poorly agree with the experimentally observed (Bordelon & Pehlevan, 2021; Velikanov & Yarotsky, 2022) loss trajectory which can be approximately described as L ( w t ) ∼ Ct − ξ , ξ ≈ 0 .
25 (cf.
our Fig. 1).
In contrast, fitting power-laws to both eigenvalues λ k and coefficients c k and using the spectral expression
L GD ( w t ) = (cid:80) k (1 − αλ k ) 2 t λ k c 2 k allows to accurately predict both exponent ξ and constant C .
Accordingly, one of the purposes of the present paper is to investigate whether similar predictions can be made for mini-batch SGD under power-law spectral distributions.
Outline and main contributions.
We develop a new, spectrum based analytic approach to the study of mini-batch SGD.
The results obtained within this approach and its key steps are naturally divided into three parts:
We show that in contrast to the full-batch GD, loss trajectories of the mini-batch SGD cannot be determined merely from the spectral properties of the problem.
To overcome this difficulty, we propose a natural family of Spectrally Expressible (SE) approximations for SGD dynamics that admit an analytic solution.
We provide multiple justifications for these approximations, including theoretical scenarios where they are exact and empirical evidence of their accuracy for describing optimization of models on MNIST and CIFAR10.
To characterize SGD dynamics under SE approximation, we derive explicit spectral expressions for the generating function of the sequence of loss values, (cid:101) L ( z ) ≡ (cid:80) t
L ( w t ) z t , and show that it decomposes into the “signal” (cid:101) V ( z ) and “noise” (cid:101) U
( z ) generating functions.
Analyzing (cid:101) U
( z ) , we derive a novel stability condition of mini-batch SGD in terms of only the problem spectrum λ k .
In the practically relevant case of large momentum parameter β ≈ 1 , stability condition simplifies to the restriction of effective learning rate α eff ≡ α 1 − β < 2 b λ crit with some critical value λ crit determined by the spectrum.
Finally, we find the characteristic divergence time when stability condition is violated.
By assuming power-law distributions for both eigenvalues λ k
∝
k − ν and coefficient partial sums
S k = (cid:80) l ≤ k λ l c 2 l ∝ k − κ , we show that SGD exhibits distinct “signal-dominated” and “noise-dominated” convergence regimes (previously known for SGD without momenta (Varre et al., 2021)) depending on the sign of κ + 1 − 2 ν .
For both regimes we obtain power-law loss convergence rates and find the explicit constant in the leading term.
Using these rates, we demonstrate a dynamical phase transition between the phases and find its characteristic transition time.
Finally, we analyze optimal hyper parameters in both phases.
In particular, we show that negative momenta can be beneficial in the “noisedominated” phase but not in the “signal-dominated” phase.
We discuss related work in Appendix A and experimental details 1 in Appendix F.
T HE SETTING AND SGD DYNAMICS
We consider a linear model f ( x , w ) = ⟨ w , ψ ( x ) ⟩ with non-linear features ψ ( x ) trained to approximate a target function y ∗ ( x ) by minimizing quadratic loss L ( w )
= 12 N (cid:80) Ni =1 ( ⟨ w , ψ ( x i ) ⟩ − y ∗ ( x i ))
2 over training dataset D
= { x i } Ni =1 .
The model’s
Jacobian is given by Ψ
= (cid:0) ψ ( x i ) (cid:1) N i =1 , the Hessian H = 1 N (cid:80)
Ni =1 ψ ( x i ) ⊗ ψ ( x i )
= 1 N ΨΨ T and the tangent kernel K ( x , x ′ )
=
[Figure]
⟨ ψ ( x ) , ψ ( x ′ ) ⟩ .
Assuming that the target function is representable as y ∗ ( x ) = ⟨ w ∗ , ψ ( x ) ⟩ , the loss takes the form L ( w ) = 12 ⟨ w − w ∗ , H ( w − w ∗ ) ⟩ .
We allow model parameters to be either finite dimensional vectors or belong to a Hilbert space H .
Similarly, dataset D can be either finite ( N < ∞ ) or infinite, and in the latter case we only require a finite norm of the target function y ∗ ( x ) but not of the solution w ∗ .
Note that this setting is quite rich and can accommodate kernel methods, linearization of real neural networks, and infinitely wide neural networks in the NTK regime.
See Appendix B for details.
In the experimental results, we refer to this setting as linearized (to be distinguished from nonlinear NN’s and the SE approximation introduced in the sequel).
Denoting deviation from the optimum as ∆ w ≡ w − w ∗ , we can write a single SGD step at iteration t with a randomly chosen batch B t of size b as
[Equation]
An important feature of the multiplicative noise introduced by the random choice of B t is that the n ’th moments of parameter and momentum vectors ∆ w t +1 , v t +1 in dynamics (2) are fully determined from the same moments at the previous step t .
As our loss function is quadratic, we focus on the second moments
[Equation]
Then the average loss is E [ L ( w )]
= 12 Tr( HC ) and for combined second moment matrix we have
Proposition 1.
Consider SGD (1) with learning rates α t , momentum β t , batch size b and random uniform choice of the batch B t .
Then the update of second moments (3) is (cid:18) C t +
J
[Equation]
Here γ Σ ( C t ) is the covariance of gradient noise due to mini-batch sampling, with γ = N − b ( N − 1) b and
[Equation]
S PECTRALLY E XPRESSIBLE APPROXIMATION
An important property of non-stochastic GD is that it can be “solved” by diagonalizing the Hessian
H .
Namely, typical quantities of interest in the context of optimization have the form
Tr[ ϕ ( H ) C ] with some function ϕ : e.g., ϕ ( x ) =
x 2 for the loss, ϕ ( x ) = 1 for the parameter displacement, ϕ ( x ) = x 2 for the squared gradient norm.
Given a Hessian H , by Riesz–Markov theorem we can associate to a positive semi-definite C the respective spectral measure ρ C ( dλ ) :
[Equation]
We will assume that H has an eigenbasis u k with eigenvalues λ k ; in this case ρ C = (cid:80) k
C kk δ λ k , where C kk = ⟨ u k , Cu k ⟩ .
For vanilla GD, the spectral measure of the second moment matrix C t at iteration t is given by ρ C t ( dλ ) =
p 2 t ( λ ) ρ C 0 ( dλ ) , where p t ( x ) is a polynomial fully determined by the learning algorithm (Fischer, 1996).
Thus, the information encoded in the initial spectral measure ρ C 0 is, in principle, sufficient to compute main characteristics of the optimization trajectories.
This conclusion, however, does not hold for SGD, since the first component of the noise term (5) uses finer, non-spectral details of the problem.
For a problem with fixed spectrum λ k and measure ρ C , we show (Sec. D.1) that the spectral components Σ kk = ⟨ u k , Σu k ⟩ of the noise term (5) can take any value in the wide interval (cid:2)
λ k
(Tr[ HC ] − λ k C kk ) , ( N − 1) λ 2 k C kk (cid:3) , so that non-spectral details can make a strong impact on the optimization trajectory.
Yet, in many theoretical and practical cases (see below), we find that non-spectral details are not significant, and components Σ kk can be reduced to a spectral expression.
Specifically, for a certain choice of parameters τ 1 , τ 2 ∈ R , τ 1 ≥ τ 2 , the noise measure ρ Σ is determined by ρ C via ρ Σ
[Equation]
We refer to this as the Spectrally Expressible (SE) approximation.
Under this approximation we again can, in principle, fully reconstruct the trajectory of observables
Tr[ ϕ ( H ) C t ] from the initial
C 0 .
There are multiple reasons justifying this approximation.
1) There are scenarios where Eq.
(7) holds exactly.
First, we prove this for translation-invariant models, with τ 1 = 1 , τ 2 = 1 (see Sec.
D.5):
Proposition 2.
Consider a problem with regular grid dataset D = { x i =
( 2 πi 1 N 1 , . .
, 2 πi d N d ) } , i ∈ ( Z /N 1 Z ) × · · · × ( Z /N d Z ) on the d -dimensional torus T d = ( R / 2 π Z ) d and with translation invariant kernel K ( x , x ′ )
=
K ( x − x ′ ) .
Then (7) holds exactly with τ 1 = 1 , τ 2 = 1 .
2) Also, SE approximation with τ 1 = τ 2 = 1 generally results if pointwise losses L ( x ) are statistically independent of feature eigencomponents ψ 2 k ( x ) = ⟨ u k , ψ ( x ) ⟩ 2 w.r.t.
x ∼ D (Sec. D.2).
On the other hand, Bordelon & Pehlevan (2021) show that when the features ψ ( x ) are Gaussian w.r.t.
x ∼ D , the SE approximation is exact with τ 1 = 1 , τ 2 = − 1 .
4) Eq.
(7) can be derived by considering a generalization of the map (5) and requiring it to be “spectrally expressible”.
Namely, replace summation over i in (5) by a general linear combination with coefficients (cid:98) R
=
( R i 1 i 2 i 3 i 4 ) only assuming the symmetries
[Equation]
Assuming the coefficients (cid:98) R to be fixed and independent of Ψ , H , C , we prove
Theorem 1.
For an SGD dynamics (4) with noise term (8) , the following statements are equivalent: (1) Spectral measures ρ C t occurring during SGD are uniquely determined by the initial spectral measure ρ C 0 and by the eigenvalues
λ k of Hessian H ; (2) R
i 1 i 2 i 3 i 4 = τ 1 δ i 1 i 2 δ i 3 i 4 − τ 2 −2 ( δ i 1 i 3 δ i 2 i
+ δ
i
i 4 δ i 2 i 3 ) for some τ 1 , τ 2 , and Eq.
(7) holds; (3) The trajectory { C t } ∞ t =0 is invariant under transformations (cid:101)
Ψ
=
ΨU T of the feature matrix Ψ by any orthogonal matrix U .
5) Finally, we observe empirically that SE approximation works well on realistic problems such as
MNIST and CIFAR10 for predicting loss evolution (Figs. 1, 9, 10 and Sec.
F.4), determination of convergence conditions (Fig. 2) and approximation of original noise term (5) in terms of trace norm (Sec. F.4).
In the remainder we focus on analytical treatment of SGD dynamics under SE approximation (7).
Note that parameters γ, τ 1 , τ 2 enter evolution equations in combinations γτ 1 , γτ 2 .
This allows to lighten the notation in the sequel by setting τ 1 = 1 and τ 2 = τ without restricting generality.
R EDUCTION TO GENERATING FUNCTIONS
Gas of rank-1 operators.
Iterations (4) are linear and can be compactly written as M t +1 =
F t M t with a linear operator F t .
Under SE approximation (7), for all four blocks of M t we only need to consider the diagonal components in the eigenbasis of H , e.g. C kk,t ≡ ⟨ u k , C t u k ⟩ .
Then
[Equation] [Equation]
Here ( λλλ
[Equation] [Equation]
=
[Equation] [Equation]
) , ( C
[Equation]
(cid:1)
∈ R N ⊗ R 2 × 2 are (2 × 2) - matrix-valued sequences indexed by the eigenvalues λ k , and ⟨· , ·⟩ is the natural scalar product in l 2 ⊗ R 2 × 2 .
The evolution operator F t can be represented as the sum F t =
Q t + A t of a rank-one operator Q t (noise term) and an operator A t (main term) that acts independently at each eigenvalue
λ k as a 4 × 4 matrix:
[Equation]
[Equation] [Equation]
where λλλ = ( λ 1 , λ 2 , . . . )
T .
Let us expand the loss by the binomial formula, with m terms Q t chosen at positions t 1 , . . .
, t m and T − m terms A t at the remaining positions:
[Equation]
where
[Equation]
Expansion (12) has a suggestive interpretation as a partition function of a gas of rank-1 operators interacting with nearest neighbors (via U t,s ) and the origin (via V t ).
Interactions via U t.s contain the factor γ so that their strength depends on the sampling noise.
We expect the model to be in different phases depending on the amount of noise: in the “signal-dominated” regime L ( T ) is primarily determined by V t at large T , while in the “noise-dominated” regime L ( T ) is primarily determined by U t,s .
We show later that such a phase transition indeed occurs for non-strongly convex problems.
Generating functions.
Expansion (12) allows to compute L ( T ) iteratively:
[Equation]
For constant learning rates and momenta α t ≡ α, β t ≡ β we have F t ≡ F , the value U t,s becomes translation invariant, U t,s =
U t − s .
Then, as we show in Sec.
E.1, the loss can be conveniently described by generating functions (or equivalently, Laplace transform):
[Equation]
where (cid:101) U and (cid:101) V are the “noise” and “signal” generating functions:
[Equation]
In the remainder we derive various properties of the loss evolution by analyzing these formulas.
S TABILITY ANALYSIS
Starting from this section we assume a non-strongly-convex scenario with an infinite-dimensional and compact H , i.e., λ k
→ 0 .
Also, we assume that 0 < τ ≤ 1 in SE approximations: this simplifies some statements and fits the experiment for practical problems (see Figure 1 and Appendix F).
Conditions of loss convergence (stability).
First note that as λ k → 0 the “main” components
A λ k of the evolution operator F appearing in Eq.
(11) have their action in trial matrix M converge to ( 1 β 0 β ) M ( 1 β 0 β ) T , and from (13) we get U t = const (cid:80) ∞
k
=1 λ 2 k
(1 + o (1)) , for each t .
This means that if (cid:80) k λ 2 k = ∞ then each U t = ∞ and loss diverges already at first step ( L ( t = 1) = ∞ ) – we call this effect immediate divergence .
On the other hand, assuming (cid:80) k λ 2 k < ∞ , loss stability can be related to the first positive singularity of the loss generating function (cid:101) L ( z ) given by (16).
Indeed, let r L be the convergence radius of power series (16).
Since L ( t ) ≥ 0 , (cid:101) L ( z ) must be monotone increasing on [0 , r L ) and have a singularity at z = r L .
If r L < 1 , then L ( t ) ̸→ 0 as t → ∞ , while if r L > 1 , then L ( t ) → 0 exponentially fast.
Thus, large- t loss stability can be characterized by the condition r L ≥ 1 , which can be further related to the generating function (cid:101) U
( z ) .
Proposition 3.
Let β ∈ ( − 1 , 1) , 0 < α < 2( β +1) /λ max and γ ∈ [0 , 1] .
Then r L < 1 iff (cid:101) U (1) > 1 .
This result is proved by showing that (cid:101) U ( z ) , (cid:101) V ( z ) have no singularities for z ∈ (0 , 1) and that z (cid:101) U ( z ) is monotone increasing on (0 , 1) .
The only source of singularity in (cid:101) L ( z ) is then the denominator in (16).
Note that conditions β ∈ ( − 1 , 1) , 0 < α < 2( β + 1) /λ max exactly specify the convergence region for the non-stochastic problem with γ =
(see (Roy & Shynk, 1990; Tugay & Tanik, 1989) and Appendix H).
This is also a necessary condition in the presence of sampling noise since the second term in (4) is a positive semi-definite matrix.
To get a better understanding of convergence condition (cid:101) U (1) < 1 we use Eq.
(18) at z = 1 and find
[Equation]
This shows that (cid:80) k λ k
= ∞ iff (cid:101) U (1) = ∞ > 1 (regardless of values of α, β, γ ), in which case r L < 1 and L ( t ) diverges exponentially as t → ∞ .
We refer to this scenario as eventual divergence .
Next, consider effective learning rate α eff ≡ α 1 − β
=
α + αβ + αβ
+ . . .
which reflects the accumulated effect of previous gradient descent iterations (Tugay & Tanik, 1989; Yuan et al., 2016).
We show that condition (cid:101) U (1) < 1 is closely related to a simple bound on α eff in terms of critical regularization λ crit , which is defined only through problem’s spectrum λ k and SE parameter τ .
Proposition 4.
Retain assumptions of Prop. 3 and define λ crit as the unique positive solution to (cid:80)
[Equation]
= 1 .
Then, convergence condition (cid:101) U (1) < 1 requires for α eff to obey
[Equation]
[Equation]
Moreover, for fixed β, γ the convergence condition (cid:101) U (1) < 1 is equivalent to the condition α eff <
α ( c ) eff ( β, γ ) , where the critical values α ( c ) eff ( β, γ ) are upper bounded by
[Equation]
(by Eq.
(22) ) and
[Equation]
The bound (22) is much simpler to use than the exact condition (cid:101) U (1) <
1 , while (23) shows that (22) is tight for practically common case of β close to 1.
Both conditions (cid:101) U (1) < 1 and (22) agree very well with experiments on MNIST and synthetic data (Fig. 2).
Importantly, Eq.
(22) implies that, in contrast to the non-stochastic ( γ = 0 ) GD, effective learning rate in SGD must be bounded to prevent divergence.
In non-strongly convex problems, accelerated convergence of non-stochastic
GD is achieved by gradually adjusting β to 1 at a fixed α during optimization (Nemirovskiy &
Polyak, 1984).
We see that this mechanism is not applicable to mini-batch SGD.
Exponential divergence.
Our stability analysis above shows that loss diverges at large t when (cid:101) U (1) > 1 .
This divergence is primarily characterized by the convergence radius r L determined from the equation r L (cid:101) U ( r L )
= 1 according to (16).
Indeed, assuming an asymptotically exponential ansatz L ( t ) ∼ Ce t/t div , we immediately get the divergence time scale t div = − 1 / log r L .
A closer inspection of (cid:101) L ( z ) near r L also allows to determine the constant C (see appendix E.4):
L
[Equation]
t
[Equation]
Note that r L can be very close to 1 , which is naturally observed in eventual divergent phase by taking sufficiently small α and/or γ .
In this case the characteristic divergence time t div is large and we expect divergent behavior to occur only for t ≳
t blowup , while for t ≪ t blowup the loss converges roughly with the rate of noiseless model (cid:101)
U ( z ) ≡ 0 .
As t blowup should have a meaning of a time moment where loss starts to significantly deviate from noiseless trajectory we define it by equating divergent (24) and noiseless losses.
We confirm these effects experimentally in Fig, 3 (right).
S OLUTIONS FOR POWER - LAW SPECTRAL DISTRIBUTIONS
To get a more detailed picture of the loss evolution let us assume now that the eigenvalues λ k and the second moments C kk, 0 of initial ( t = 0 ) approximation error are subject to large- k power laws
[Equation]
[Equation]
with some exponents ν, κ > 0 (also denote ζ = κ /ν ) and coefficients Λ , K .
Such (or similar) power laws are empirically observed in many high-dimensional problems, can be derived theoretically, and are often assumed for theoretical optimization guarantees (see many references in App.
A).
If ν ≤ 12 , then (cid:80) k
λ 2 k = ∞
and we are in the “immediate divergence” regime mentioned earlier, and
if 12 < ν ≤ 1 , then (cid:80) k λ k = ∞ and we are in “eventual divergence” regime.
Away from these two divergent regimes, we precisely characterize the late time loss asymptotics:
Theorem 2.
Assume spectral conditions (25) with ν > 1 and that parameters α, β, γ are as in
Proposition 3 and such that convergence condition (cid:101) U (1) < 1 is satisfied.
Then
[Equation]
The idea of the proof is to observe that the generating function for the sequence tL ( t ) is (cid:80) ∞
[Equation]
L
[Equation]
z ) , where
[Equation] [Equation]
We argue that r L = 1 and apply the Tauberian theorem, relating the asymptotics of the cumulative sums (cid:80)
Tt =1 tL ( t ) to the singularity of the generating function at z = r L = 1 .
One can then show using (18), (19) that (cid:101) U ′ ( z ) diverges as (cid:101) U ′ (1 − ε )
∝ ε − 1 ν and (cid:101) V ′
( z ) diverges as (cid:101) V ′ (1 − ε )
∝ ε ζ −for ζ < 2 .
Depending on which of the two terms in Eq.
(27) has a stronger singularity, we observe two qualitatively different phases (previously known in SGD without momenta (Varre et al., 2021)): the “signal-dominated” phase at ζ − 2 < − 1 /ν and the “noise-dominated” phase at ζ − 2 > − 1 /ν .
See Figure 3 (left) for the resulting full phase diagram.
In the sequel we assume that not only cumulative sums (cid:80) T 1 tL ( t ) , but also individual terms tL ( t ) obey power-law asymptotics.
Then L ( t ) ≈
L approx ( t ) =
Ct − ξ , where, by Eq.
[Equation]
Note that the asymptotics (28) depend on SGD hyperparameters ( α, β, γ ) only through the constants
C signal ( α, β, γ ) and C noise ( α, β, γ ) , which makes them essential for describing finer details of the loss trajectories in both phases.
In the following sections we give a few examples of such analysis.
[Figure] [Figure]
Figs
Transition between phases.
Asymptotic (28) allows us to go further in understanding the “noisedominated” phase ζ > 2 − 1 /ν .
Using representation (27) and linearity of Laplace transform, we write loss asymptotic as L ( t )
≈ C signal t − ζ + C noise t − 2+ 1 ν with two terms given by (28a),(28b).
As
C noise vanishes in the noiseless limit γ → 0 , we expect that for sufficiently small γ the signal term here dominates the noise term up to time scale t trans given by
[Equation]
This conclusion is fully confirmed by our experiments with simulated data, see Fig. 3(center).
Note that the time scale t trans can vary widely depending on α, β, γ ; in particular, t trans might not be reached at all in realistic optimization time if the noise γ and effective learning rate α 1 − β are small.
A similar reasoning can be used to estimate the time t blowup of transition from early convergence to subsequent divergence (see Fig.
3 (right)).
In Sec.
E.4 we consider the scenario with β = 0 , γ = τ = 1 and power laws (25) in which 12 < ν < 1 (eventual divergence) and ζ < 1 .
We show that at small α we have t blowup ≈ a ∗ t div ≈ a ∗ (cid:0) 14 ν Γ(2 − 1 /ν )Γ(
/ν − 1) (cid:1) ν/ ( ν − 1) (2 α Λ) 1 / ( ν − 1) , where a ∗ = a ∗ ( ν, ζ ) is the solution of the equation 1 /ν − 1 Γ(1 − ζ ) a − ζ ∗ =
e a ∗ .
Hyperparameter optimization.
Observe that the optimal learning ratse α and momenta β in
Fig.
2 differ significantly between signal-dominated ((a), (b)) and noise-dominated ((c), (d)) phases.
To explain this observation, we analyze late time loss asymptotic (28) at a fixed batch size b , and show that two phases indeed have distinct patterns of optimal α, β .
“Signal-dominated” phase .
First, note that near the divergence boundary (cid:101) U (1) = 1 the loss is high due to denominator 1 − (cid:101) U (1) in (28a).
This suggests that at optimal α, β the difference (cid:101) U (1) − 1 is of order 1, which allows us to neglect dependence of loss on (cid:101) U (1) as long as convergence condition
The blue/red the values Ξ given by (30) and characterizing theoretical
∂
L approx ( t ) β
= α =
α opt τ = the noisy diamonds experimentally find optimal when Ξ < 0 ( > 0 ).
separates the signaldominated
[Figure]
(cid:101) U (1) < 1 holds.
Then, loss becomes L ( t ) ∼ ( α eff t ) − ζ
and it is beneficial to increase α eff .
However, α eff has an upper bound (23) which becomes tight for sufficiently small 1 − β (see (23)).
Thus, in agreement with Fig. 2 (left), the optimal α, β correspond to small 1 − β and α eff ≈ 2 γλ crit .
“Noise-dominated” phase .
Similarly to signal-dominated phase, we see from (28b) that (cid:101) U (1) can be neglected away from convergence boundary.
Then, the loss is L ( t ) ∼ (cid:101) V (1) α 1 /ν eff
t
1 /ν − 2 .
In contrast to signal-dominated phase, α eff = α/ (1 − β ) appears with the positive power suggesting that high momenta β ≈ 1 are non-optimal.
At the same time, it can be shown that (cid:101) V (1) ∼ α − 1 at small α , so it is neither favorable to use small α .
Thus, in accordance with Fig.
2 (right), the optimal α, β should be located in a general position inside the convergence region (cid:101) U (1) < 1 .
Additionally, for the problem of optimizing batch-size b at a fixed computational budget bt , in Sec.
E.5 we derive the previously observed linear scalability of SGD w.r.t.
batch size (Ma et al., 2018).
Positive vs negative momenta.
It is known that in some noisy settings SGD does not benefit from using momentum (Polyak, 1987; Kidambi et al., 2018; Paquette & Paquette, 2021).
Empirically, we find that in the signal-dominated regime momentum helps significantly, while in the noise-dominated regime its effect is weaker, and it can even be preferable to set β <
(see Fig. 2).
Our asymptotic formula (28) with explicit constants allows us to confirm this theoretically and, moreover, in the case τ = γ = 1 give a simple explicit condition under which β < 0 are preferable.
Specifically, we show that if we fix α at the optimal value α opt at β = 0 , then we can further decrease the loss by increasing or decreasing β , depending on the regime and a spectral characteristic Ξ defined below:
Proposition 5 (short version) .
Assume asymptotic power laws (25) with some exponents ν, κ > 0 , ζ = κ /ν and coefficients Λ , K. Let α opt = arg min α L approx ( t )
| β =0 .
Then: I. (signal-dominated case) Let ζ < 2 − 1 /ν
and 0 < τ ≤ 1 , 0 ≤ γ ≤ 1 , then ∂ β L approx ( t )
| β =0 ,α = α opt < 0 .
II.
(noisedominated case) Let ζ > 2 − 1 /ν
and τ = γ = 1 , then the sign of ∂ β L approx ( t )
| β =0 ,α = α opt equals the sign of the expression
[Equation]
In Fig.
4 we experimentally validate the Ξ criterion for several pairs ( ν, κ ) .
See details in Sec.
E.6.
D ISCUSSION
We can summarize our approach to the theoretical analysis of mini-batch SGD as consisting of 3 key stages: 1) Perform SE approximation; 2) Use it to solve the SGD dynamics and obtain initial spectral expressions (in our case Eqs.
(18),(20) combined with (16));
3) Apply these spectral expressions to study optimization stability, phase transitions, optimal parameters, etc.
We have demonstrated this approach to produce various new and nontrivial theoretical results, which are also in good quantitative agreement with experiment on realistic problems such as MNIST and CIFAR10 learned by MLP/ResNet/MobileNet.
In particular, we have shown that, in contrast to full-batch GD, SGD has an effective learning rate limit determined by the spectral properties of the problem and batch size.
Also, we have shown that in the “signal-dominated” phase (including, e.g., the MNIST and CIFAR10 tasks) momentum β >is always beneficial, but in the “noise-dominated” phase a momentum β < 0 can be preferable.
One natural future research direction is to investigate which properties of data and features ψ ( x ) are responsible for the accuracy of SE approximation, and how to systematically choose SE parameters τ 1 , τ 2 .
Second, we were able to solve SE approximation only for the constant learning rate and momentum, and a more general solution might open up a way to a better understanding of accelerated
SGD.
Third, one can ask how the picture changes for spectral distributions other than power-law.
C ONTENTS 1 Introduction
2 The setting and SGD dynamics 3 Spectrally Expressible approximation 4 Reduction to generating functions 5 Stability analysis 6 Solutions for power-law spectral distributions 7 Discussion 8 Bibliography
A Related work
B Details of the setting
B.1 Basics . .
B.2 Eigendecompositions and other details . . . . . . . . . . . . . . . . . . . . . . . .
B.3 Output and parameter spaces .
C Dynamics of
second
moments
D SE approximation
D.1 Presence of non-spectral details in the general case. . . . . . . . . . . . . . . . . .
D.2 SE approximation for uncorrelated losses and features . . . . . . . . . . . . . . . .
D.3 Dynamics of spectral measures . . . . . . . . . . . . . . . . . . . . . . . . . . . .
D.4 Theorem 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
D.
Translation invariant models . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E Generating functions and their applications
E.1 Reduction to generating functions . . . . . . . . . . . . . . . . . . . . . . . . . .
E.2 Convergence conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E.3 Loss asymptotic
[Table]
laws . .
[Table]
Exponential
[Table] [Table]
[Table] [Table]
F Experiments
F.
Training regimes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
F.
Datasets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
F.
Experimental details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
F.
Validity of spectrally expressible approximation . . . . . . . . . . . . . . . . . . .
F.
Additional experiments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
G Mini-batch SGD vs. SGD with additive noise
H Noiseless convergence condition
A R ELATED WORK
SGD.
Stochastic Gradient Descent (SGD) was introduced in Robbins & Monro (1951), and its various versions have been extensively studied since then, see e.g. Kiefer & Wolfowitz (1952);
Rumelhart et al.
; Bottou & Bousquet (2007); Shamir & Zhang (2013); Jain et al.
Harvey et al.
; Moulines & Bach (2011).
The version (1) considered in the present paper is motivated by applications to training neural networks and is widely used (LeCun et al., 2015;
Goodfellow et al., 2016;
Sutskever et al., 2013).
Its key feature is the presence of momentum, which is both theoretically known to improve convergence and widespread in practice (Polyak, 1964; 1987;
Nesterov, 1983; Sutskever et al., 2013; Shallue et al., 2018).
Mini-batch SGD and spectrally expressible representation.
In the present paper we consider the mini-batch SGD, meaning that the stochasticity in SGD is specifically associated with the random choice of different batches used to approximate the full loss function at each iteration (not to be confused with SGD modeled as gradient descent with additive noise as e.g. in the gradient Langevin dynamics; see e.g. Wu et al.
Zhu et al.
(2018) for some discussion and comparison, as well as our Section G for an illustration in our case of quadratic problems).
We study this SGD in terms of how the second moments of the errors evolve with time.
Our Proposition 1 generalizes existing evolution equations (Varre et al., 2021) to SGD with momentum.
A serious difficulty in the study of this evolution is the presence of higher order mixing terms coupling different spectral components (the first term on the r.h.s.
in our Eq.
In Varre et al.
(2021), it was shown that the effects of these terms can be controlled by suitable inequalities, allowing to establish upper bounds on error rates.
In contrast, our SE approximation allows us to go beyond upper bounds and, for example, obtain explicit coefficients in the asymptotics of large- t loss evolution without a
Gaussian assumption (see Theorem 2).
Our approach is different and is close to the approach of recent paper Bordelon & Pehlevan (2021) where the authors considered a dynamic equation equivalent to our SE approximation with parameter τ = − 1 but without momentum.
Apart from considering a wider family of dynamic equations, our major advancement compared to Bordelon & Pehlevan (2021) is that we manage to ”solve” these dynamic equations using generating functions, and consequently use this solution to obtain a various results concerning stability conditions (Sec. 5) and various SGD characteristics under power-law spectral distributions (Sec. 6).
Related assumptions of Gaussian features have also been used in a recent series of works Goldt et al.
(2020a);
Loureiro et al.
; Goldt et al. (2020b) to analytically predict performance of linear models trained with full- or mini-batch SGD.
Spectral power laws.
In Section 6 we adopt very convenient power law spectral assumptions (25) on the asymptotic behavior of eigenvalues and target expansion coefficients.
Such power laws are empirically observed in many high-dimensional problems (Cui et al., 2021;
Bahri et al., 2021;
Lee et al., 2020; Canatar et al., 2021; Kopitkov & Indelman, 2020; Dou & Liang, 2020; Atanasov et al., 2021; Bordelon & Pehlevan, 2021;
Basri et al., 2020; Bietti, 2021), can be derived theoretically (Basri et al., 2020; Velikanov & Yarotsky, 2021), and closely related conditions are often assumed for theoretical optimization guarantees (Nemirovskiy & Polyak, 1984; Brakhage, 1987;
Hanke, 1991; 1996; Gilyazov & Gol’dman, 2013; Varre et al., 2021; Caponnetto & De Vito, 2007;
Steinwart et al., 2009; Berthier et al., 2020; Zou et al., 2021; Jin et al., 2021; Bowman & Montufar,
An important aspect of our work is that, in contrast to most other works, we allow the exponent ζ characterizing initial second moments C kk, 0 to have values in the interval (0 , 1) .
In this case, (cid:80) k λ k C kk < ∞ while (cid:80) k C kk, 0 = ∞ .
This effectively means that the target function y ∗ ( x ) has a finite euclidean norm, while the norm of the respective optimal weight vector w ∗ is infinite (i.e., the loss does not attain a minimum value).
This broader assumption allows us, in particular, to correctly describe the loss evolution on MNIST for which ζ ≈ 0 .
25 (see Figures 1 and 3): without assuming ∥ w ∗ ∥ = ∞ , the SGD is proved to have error rate O ( t − ξ ) with ξ ≥ 1 (Varre et al., 2021), which clearly contradicts the experiment (see Figure 1(left)).
Phase diagram.
It is known that performance of SGD can be decomposed into “bias” and “variance” terms, with the dominant term determining what we call “signal-dominated” or “noisedominated” regime (Moulines & Bach, 2011; Varre et al., 2021; Varre & Flammarion, 2022).
In particular, see Varre et al.
(2021) for respective upper bounds for SGD without momentum.
The main novelty of our paper compared to these previous results is the analytic framework allowing to obtain large- t loss asymptotics with explicit constants for SGD with momentum (see Theorem 2) and use them to derive various quantitative conclusions related to model stability, phase transitions, and parameter optimization (see Section 6).
Noisy GD with momentum.
GD with momentum (Heavy Ball) (Polyak, 1964) was extensively studied, but mostly in a noiseless setting or for generic (non-sampling) kinds of noise; see e.g. the monograph Polyak (1987).
See Proakis (1974); Roy & Shynk (1990); Tugay & Tanik (1989) for a discussion of stability on quadratic problems.
Polyak (1987) analyses various methods with noisy gradients for different kinds of noise and concludes that the fast convergence advantage of Heavy
Ball and Conjugate Gradients (compared to GD) are not preserved under noise unless it decreases to 0 as the optimization trajectory approaches the solution.
See also Kidambi et al.
; Paquette &
Paquette (2021) for further comparisons of noisy GD with or without momentum.
Our work refines this picture in the case of sampling noise.
Our results in Section 6 suggest that including positive momentum in SGD always improves convergence in the signal-dominated phase, but generally not in the noise-dominated phase (where it may even be beneficial to use a negative momentum).
B D ETAILS OF THE SETTING B. B ASICS
In our problem setting we always consider regression tasks of fitting target function y ⋆ ( x ) using linear models f ( x , w ) of the form
[Equation]
(31) where ⟨· , ·⟩ stands for a scalar product and ψ ( x ) are some (presumably non-linear) features of inputs x .
The space X containing inputs x is not important in our context.
Next, the model will be always trained to minimize a quadratic loss function over training dataset D :
[Equation]
Denote by B t a set of b = | B t | training samples x drawn independently and uniformly without replacement from D .
Then a single step of SGD with learning rate α t and momentum parameter β t takes the form
[Equation] [Equation]
[Equation]
Note that expression (33) of SGD step is equivalent to more compact expression (2) when there exist optimal parameters w ⋆ such that ⟨ w ⋆ , ψ ( x ) ⟩ = y ⋆ ( x ) .
As we have already noted, existence of optimal parameters with ∥ w ⋆ ∥ < ∞ may not be the case for models relevant to practical problems (e.g. MNIST).
Thus we will consider (33) to be the basic form of SGD step in our work.
However, the formal usage of (2) instead of (33) always leads to the same conclusions and therefore we focus on the case ∥ w ⋆ ∥ < ∞ in the main paper.
In subsection B.3 we consider formulation of SGD in the output space, which allows to treat cases ∥ w ⋆ ∥ = ∞ and ∥ w ⋆ ∥ < ∞ withing the same framework.
It is convenient to distinguish several cases of our problem setting differing by finite/infinite dimensionality d of parameters w , and finite/infinite size |D| =
N of the dataset used for training.
In our work we take into account all these cases, as each of them is used in either experimental or theoretical part of the paper.
B. E IGENDECOMPOSITIONS AND OTHER DETAILS
Case 1: d, N < ∞ .
This is the simplest case and we will often repeat the respective paragraph of section 2.
First, recall that matrix elements d × N Jacobian matrix Ψ are
[Equation]
We will assume without loss of generality that Ψ has a full rank r = min( d, N ) (the general case reduces to this after a suitable projection).
Then by (32) the Hessian of the model is
[Equation]
[Equation]
Another important matrix is the kernel K ( x , x ′ )
=
ψ ( x ) T ψ ( x ′ ) calculated on the training dataset
D
[Equation]
Next, consider the SVD decomposition of Jacobian Ψ = √ N UΛV with U =
( u k ) dk
=1 being the matrix of left
, V = ( ϕ Tk )
Nk
=1 being the matrix right
, and rectangular d × N diagonal matrix with singular values Λ
= √ on the diagonal.
The and kernel matrices are symmetric and have with shared spectrum
Now let us proceed to the target function y ⋆ ( x ) .
As in this paper we focus on the training error (32), we may also restrict ourselves to the target vector y ⋆ of target function values at training points:
y ⋆i = 1 √ N y ⋆
( x i ) , x i ∈ D .
The normalization by √ N is done here to allow for direct correspondence with the N = ∞ case.
If d ≤ N , we recall our assumption of Ψ having full rank and therefore the target function is reachable since the equation 1 √ N w T Ψ =
y ⋆ always has a solution.
However, if d < N , there are many possible solutions of 1 √ N w T Ψ = y ⋆ , and we choose w ∗ to be the one with the same projection on ker H as the initial model parameters w 0 .
Later, this choice will guarantee that during SGD dynamic (33) parameter deviation always lies in the image of the Hessian: ∆ w t ≡ w t − w ⋆ ∈
Im H .
Finally, if N > d , the target may by unreachable: y ⋆ / ∈
Im Ψ T .
In this case we consider the decomposition of the output space R N =
Im K ⊕ ker K and the respective decomposition of target vector
y ⋆ =
y ⋆ ∥
+ y ⋆ ⊥ .
Then y ⋆ ∥ is always reachable y ⋆ ∥ ∈
Im Ψ T and in the rest we simply consider reachable part of the target y ⋆ ∥ instead of the original target y ⋆ .
Apart from general finite regression problems, the case d, N < ∞ described above applies to linearization of practical neural networks (and other parametric models).
Specifically, consider a model f ( w , x ) initialized at w 0 with initial predictions f 0 ( x ) ≡ f ( w 0 , x ) .
The training of linearized model f ( w , x ) = f 0 ( x )+ ⟨ w − w 0 , ∇ w f ( w 0 , x ) ⟩ can be mapped to out basic problem setting (31) with replacements ψ ( x ) ←− (cid:91) ∇ w f ( w 0 , x ) , w ←− (cid:91)
w − w 0 , y ⋆ ( x ) ←− (cid:91)
y ⋆ ( x ) − f 0 ( x ) .
Case 2: d = ∞ , N < ∞ .
In this case we assume that model parameters w and features ψ ( x ) belong to a Hilbert space H , and ⟨· , ·⟩ denotes the scalar product in H .
For the Hessian we have
[Equation] [Equation]
We assume that the features ψ ( x j ) , x j ∈ D are linearly independent (as is usually the case in practice), then dim Im H = N < ∞ .
As SGD updates occur in Im H , we again use space decomposition H
= Im H ⊕ ker H and respective decomposition of parameters w = w ∥ + w ⊥ and features ψ ( x ) =
ψ ( x ) ∥ + ψ ( x ) ⊥ .
As ψ ( x j ) ⊥ = 0 , x j ∈ D and w ⊥ do not affect the loss (32) we can restrict ourselves to Im H which bring us to finite dimensional case d = N < ∞ fully described above.
The case d = ∞ , N < ∞ is primarily used for kernel regression problems defined by a kernel function K ( x , x ′ ) which can to be, for example, one of the ”classical” kernels (e.g. Gaussian) or
Neural Tangent Kernel (NTK) of some infinitely wide neural network.
In this case H is a reproducing kernel Hilbert space (RKHS) of the kernel K ( x , x ′ ) , and features ψ ( x ) are the respective mappings ψ : X → H with the property K ( x , x ′ )
=
⟨ ψ ( x ) , ψ ( x ′ ) ⟩ .
Case 3: d, N = ∞ .
We are particularly interested in the case d = N = ∞ because in practice
N is quite large and, as previously discussed, the eigenvalues λ k and target expansion coefficients often are distributed according to asymptotic power laws, which all suggests working in an infinitedimensional setting.
A standard approach to rigorously accommodate N = ∞ , which we sketch now, is based on Mercer’s theorem.
We describe the infinite ( N = ∞ ) training dataset by a probability measure µ ( x ) so that the loss takes the form
[Equation]
assuming that ∥ y ⋆ ( x ) ∥ 2 F < ∞ for the loss to be well defined.
Here in addition to the Hilbert space of parameters H ∋ w we introduced the Hilbert space F of square integrable functions f ( x ) :
∥ f ∥ 2 F ≡ (cid:82) f
( x ) 2 dµ ( x ) < ∞ .
The Hessian H , and the counterparts of the kernel and feature matrices K (38) and Ψ (36) are now operators
[Equation]
[Equation]
Again, due to our interest in convergence of the loss (32) during SGD (33), we project parameters w to H ⊖ ker H and target function y ⋆ ( x ) to F ⊖ ker K .
After this projection the target is reachable in the sense that y ⋆ ( x ) ∈ F ⊖ ker K
= Im Ψ † .
In particular, this means that an optimum such that ∥⟨ w ⋆ , ψ ( x ) ⟩ − y ⋆ ( x ) ∥ = 0 may not exist, but there is always a sequence w n such that
[Equation]
Now we proceed to eigendecompositions of H and K .
According to the Mercer’s theorem, the restriction of the operator K given by (42) to F ⊖ ker K admits an eigendecomposition of the form
[Equation]
(44) with λ k > 0 , (cid:82) ϕ
k ( x ) ϕ l ( x ) dµ ( x ) = δ kl , and { ϕ k ( x ) } being a complete basis in F ⊖ ker K .
The latter allows to decompose features as
[Equation]
with ∥ u k ∥ 2 = 1 .
Substituting (45) into (42) gives ⟨ u k , u l ⟩ = δ kl and ρ 2 k = λ k .
Substituting then (45) into (41) gives
[Equation]
which also makes { u k } an orthonormal basis in H ⊖ ker H .
Under mild regularity assumptions, one can show (K¨onig, 2013) that the eigenvalues λ k converge to 0, and we will assume this in the sequel.
Note that if λ k → 0 , then the range of the operator Ψ † is not closed so that, exactly as pointed out above, for some y ∗ ( x ) ∈ F ⊖ ker K there are no exact finite-norm minimizers w ∗ ∈ H satisfying ⟨ w ⋆ , ψ ( x ) ⟩
= y ⋆ ( x ) for µ -almost all x .
B. O UTPUT AND PARAMETER SPACES
Recall that we only assume (cid:82) y ⋆ ( x ) 2 dµ ( x ) < ∞ but do not guarantee existence of the optimum w ⋆ in the case N = d = ∞ .
This means that considering SGD dynamics directly in the space of model outputs f ( x ) = ⟨ w , ψ ( x ) ⟩ may be advantageous when w ⋆ is not available.
Moreover, it will allow to completely bypass construction of parameter space when original problem is formulated in terms of kernel K ( x , x ′ )
(e.g. for an infinitely wide neural network in the NTK regime).
First, let us rewrite SGD recursion in the output space by taking the scalar product of (33) with ψ ( x ) :
[Equation]
[Equation]
Here v t ( x ) = ⟨ v t , ψ ( x ) ⟩ = f t ( x ) − f t +1 ( x ) .
Considering the approximation error ∆ f ( x ) ≡ f ( x ) − y ⋆ ( x ) we get
[Equation]
As (47) is equivalent to (33), we also get that (49) is equivalent to (2) when w ⋆ is available.
Thus (49) can be considered as the most general and convenient form of writing an SGD iteration.
Similarly to second moments (3) defined for parameter space, we define second moments in the output space:
[Equation]
where the superscript out indicates the output space (to avoid confusion with the respective moment counterparts defined in the parameter space).
The same moments can be written in the eigenbasis { ϕ ( x ) } of the operator K according to the rule
[Equation]
(51) where G stands for either C , F or V .
When w ⋆ is available, the moments C out kl in the output space are related to the moments C kl in the parameter space simply by
[Equation]
In particular,
[Equation]
53) and (cid:88)
[Equation]
Even when w ⋆ is not available we can still define C kl by Eq.
(52), but in this case (cid:80) k C kk = ∞ .
C D YNAMICS OF SECOND MOMENTS
The purpose of this section is to prove proposition 1.
However, as discussed in section B.3, the description in terms of moments in output space (50) is more widely applicable than description in terms of parameter moments (3).
Thus we first prove an analogue of proposition 1 for output space moments.
For convinience, let us denote the moments (50) as C out , J out , V out ∈ F ⊗ F .
Proposition 6.
Consider SGD (49) with learning rates α t , momentum β t , batch size b and random uniform choice of the batch B t .
Then the update of second moments (50) is
[Equation]
The second term represents covariance of function gradients induced mini-batch sampling noise and is given by
1) for finite dataset D = { x i } Ni =1 :
[Equation]
and the amplitude γ = N − b ( N − 1) b ; 2) for infinite dataset D with density dµ ( x ) :
[Equation]
and the amplitude γ = 1 b .
Proof.
First
[Equation]
we take expression of single SGD (49) and use it to express M out t +1 through M out t .
[Equation]
( x ) v t +1 ( x ′ ) v t +1 ( x )∆ f t +1 ( x ′ ) v t +1 ( x ) v t +1 ( x ′ ) (cid:19)(cid:21) =
E (cid:34)(cid:18)
I − α t K ( B t ) β t
I − α t K ( B t ) β t
I (cid:19) (cid:18) ∆ f t ( x ) v t ( x ) (cid:19) (cid:16) ∆ f t ( x ′ ) v t ( x ′ ) (cid:17) (cid:18)
I − α t K ( B t ) β t
I − α t K ( B t ) β t
I (cid:19) T (cid:35) (1) =
E (cid:34)(cid:18)
I − α t K ( B t ) β t
I − α t K ( B t ) β t
I (cid:19) (cid:18) C out t
J out t ( J out t ) †
V out t (cid:19) (cid:18)
I − α t K ( B t ) β t
I − α t K ( B t ) β t
I (cid:19) T (cid:35) (2) =
(cid:18)
I − α t K β t I − α t K β t
I (cid:19) (cid:18) C out t
J out t ( J out t ) †
V out t (cid:19) (cid:18)
I − α t K β t I − α t K β t
I (cid:19) T +  
E (cid:104) δ K ( B t ) C out δ K
( B t )
(cid:105) E (cid:104)
δ K ( B t ) C out δ K ( B t ) (cid:105)
E (cid:104) δ K ( B t ) C out δ K
( B t )
(cid:105) E (cid:104)
δ K ( B t ) C out δ K ( B t ) (cid:105) 

[Equation]
Here in (1) we used that ∆ f t , v t are independent from B t and therefore the average factorizes into product of averages.
In (2) we introduced notation δ K ( B t ) =
K ( B t ) − K and used
that E [ δ K ( B t )] = 0 .
Now we proceed to the calculation of the average from the last line in (58):
[Equation] [Equation]
1) Finite D = { x i } N i =1 .
Denoting for convenience function values calculated at x i , x j with subscripts ij , and omitting time index t , we get
[Equation]
Here unspecified sums run over dataset D .
In (1) we used that the fraction of batches B which contain two indices i ′ ̸
=
j ′ is (cid:0) N − 2 | B |− 2 (cid:1) / (cid:0) N | B | (cid:1) =
| B | ( | B − 1 | ) N ( N − 1) and the fraction of batches containing index j ′ is (cid:0) N − 1 |
B |− 1 (cid:1) / (cid:0) N | B | (cid:1)
=
| B | N .
Taking γ = N − b ( N − 1)
b we get (56) 2) Infinite D with density dµ ( x ) .
Proceeding similarly to (60) we get
[Equation]
(61) which gives (57) after setting γ = 1 b .
Let us write second moments dynamics for both parameter space (4) and output space (55) in eigenbasises { u k } and { ϕ k ( x ) } using decompositions (45) and (44).
For parameter space we get
[Equation]
And for output space
[Equation]
Now we are ready to prove proposition
Proposition 1.
Consider SGD (1) with learning rates α t , momentum β t , batch size b and random uniform choice of the batch B t .
Then the update of second moments (3) is
[Equation]
Here γ Σ ( C t ) is the covariance of gradient noise due to mini-batch sampling, with γ = N − b ( N − 1) b and
[Equation]
Proof.
Note that in the eigenbasis { ϕ k ( x ) } of K and eigenbasis { u k } of H output and parameter second moments are connected as
[Equation]
Using this connection rule we see that parameter dynamics (62) in eigenbasis of H is equivalent to output space second moments dynamics (63) in the eigenbasis of K .
Finally, (63) is equivalent to (55) proved in 6.
For completeness, let us also write a formula of SE approximation in output space:
[Equation]
t (cid:19) (cid:18) C out kk,t
J out kk,t
J out kk,t
V out kk,t (cid:19) (cid:18) 1 − α t λ k β t − α t λ k β t (cid:19) T + γ ( α t λ k )(cid:18) τ 1 (cid:88) l
C out ll,t − τ 2 C kk,t (cid:19) (cid:18) 11(cid:19) .
D SE APPROXIMATION D. P RESENCE OF NON - SPECTRAL DETAILS IN THE GENERAL CASE .
In this section we show that for a mini-batch SGD noise term Σ given by (5) one cannot exactly describe respective noise spectral components Σ kk = ⟨ u k , Σu k ⟩ in terms of only spectral distributions:eigenvalues λ k and second moments components C kk .
In turn, for a SGD dynamics (4) this would imply that spectral distributions are not sufficient to reconstruct ρ C t +1 from ρ C t .
The following proposition characterizes non-spectral variability of Σ kk in a stronger sense: when not only λ k , C kk are fixed, but the full Hessian H and second moments C .
Proposition 7.
Consider a problem with fixed Hessian H and second moments C , and a finite dataset size N < ∞ .
Then, all noise spectral component Σ kk are bounded as
[Equation]
Next, any chosen component Σ kk can take any value in the interval [ A, B ] (or [ B, A ] if B < A ) where endpoints A, B are given by
[Equation]
Let us first discuss this result.
Intuitively, the value A corresponds to the case where the angle between different ψ ( x i ) and ψ ( x j ) is small, and therefore different rank-one terms in H =
[Table]
i =1 ψ ( x i ) ⊗ ψ ( x i ) greatly overlap with each other.
The value B corresponds to the opposite case where all ψ ( x i ) are orthogonal.
Now we characterize the magnitude of non-spectral variations.
For this, from SE approximation (7) we can take λ k
Tr[ HC ] as a natural scale of Σ kk .
Then, bound (66) shows that relative to this natural scale, the magnitude of non-spectral variations of Σ kk is bounded by N .
The values A, B in (67) actually show that this magnitude is approximately achieved for a typical scenario with large dataset size N and the most contributing term to the trace
Tr[ HC ] having the same order as the full trace: λ k ∗ C k ∗ k ∗ ∼
Tr[ HC ] .
Indeed, in this case B ∼ Nλ 2 k C kk ∼ Nλ k Tr[ HC ] , A ≲ λ k Tr[ HC ] and the ratio B/A ≳ N .
Proof of Proposition 7.
Recall SVD decomposition (see section B) of the Jacobian Ψ = √ N UΛV with U =
( u k ) dk
=1 being the matrix of left eigenvectors, V =
( ϕ Tk ) Nk
=1 .
Also, in the proof k is always fixed and denote an index for each we want to analyze Σ kk .
Then, spectral component Σ kk can be written as
[Equation] [Equation]
From representation (68) we observe that Tr[ H − 1 Σ ] =
( N − 1)
Tr[ HC ] by using orthogonality of both columns and rows of V =
( ϕ Tk ) Nk
=1 .
Then, since Σ is positive semi-definite, we have λ − 1 k Σ kk <
Tr[ H − 1 Σ ] and bound (66) follows.
The key idea of the proof for the second part of the proposition is that after fixing H and C , we fixed
U and Λ but V can be an arbitrary orthogonal matrix.
Now we construct two specific examples of
V so that Σ kk attains values A and B given by (67).
To get the A value, for all i take ϕ k,i = 1 √ N .
Substituting this into (68) and using orthogonality (cid:80) i ϕ k 1 ,i ϕ k 2 ,i =
δ k 1 k 2 gives
[Equation]
To get the B value, we set V to the identity matrix.
Then we have
[Equation]
Finally, we demonstrate that Σ kk can take any value between A and B by showing that two examples can be continuously deformed from one to another.
Indeed, in the first example we specified only single row of V , and the rest of the matrix can be chosen so that det V = 1 .
As the special orthogonal group SO ( N ) is path connected, the required continuous deformation is guaranteed to exist.
D. SE APPROXIMATION FOR UNCORRELATED LOSSES AND FEATURES
Recall expression (68) for the noise-spectral component Σ kk .
From SVD decomposition of Jacobian Ψ = √ N UΛV we get ψ 2 k ( x i ) ≡ ⟨ u k , ψ ( x i ) ⟩ 2 =
Nλ k ϕ 2 k,i .
Using again SVD of the Jacobian and definition C k 1 k 2 = ⟨ u k 1 , Cu k 2 ⟩ , we get (cid:88)
[Equation]
Now we can rewrite (68) as
[Equation]
If L ( x ) and ψ 2 k ( x ) are statistically independent w.r.t.
x ∼ D , the expectation factorizes into the product of expectations E x ∼D (cid:2)
[Equation]
[Equation]
which is exactly SE approximation with τ 1 = τ 2 = 1 .
D. D YNAMICS OF SPECTRAL MEASURES
In Sec.
3 we mention that SE approximation allows to reconstruct the trajectories of observables
Tr[ ϕ ( H ) C t ] from initial state C 0 .
The way to do it is, of course, through considering dynamics of spectral measures, which we explicitly write below.
Denote, for simplicity, ρ J t ≡ ρ 12( J t + J † t ) .
Proposition 8.
Assume SE approximation (7) holds for all C t during SGD dynamics (4) .
Then spectral measures of all second moment matrices ρ C t , ρ J t , ρ V t can be written as
[Equation]
where G t ( λ ) is λ dependent 3 × 3 matrix
[Equation]
and s t ( λ ) is λ dependent 3 -dimensional vector.
During SGD iterations G t ( λ ) and s t ( λ ) are transformed as
[Equation] [Equation]
Proof.
Let us rewrite dynamics of second moments (4) as linear transformation of on ( C t , J t , V t ) and then take traces
Tr[ ϕ ( H )#] of both sides with arbitrary test function ϕ ( λ ) .
Since arbitrariness of ϕ ( λ ) in the obtained relation implies the same relation but for spectral measures instead of traces
[Equation]
Now we use SE approximation (7) to express ρ Σ t through ρ C t and ρ H .
The result is
[Equation]
Now we use obtained form of recursion of spectral measures prove representation (74) and transition formulas (75),(76).
We proceed by induction.
At t = 0 representation (74) indeed holds with
G 0 ( λ ) =
I and s 0 ( λ ) = 0 .
Now assume that (74) holds for iteration t and substitute it into (78).
The result is
[Equation]
Now we simply observe that right-hand side of (79) has exactly the form (74) with G t +1 ( λ ) , s t +1 ( λ ) expressed through G t ( λ ) , s t ( λ ) according to (75),(76).
Note that updates of matrix G t ( λ ) and vector s t ( λ ) in representation (74) depend only on learning algorithm parameters α t , β t , combinations γτ 1 , γτ 2 , and non-zero eigenvalues of Hessian H .
Also, we stress that although in this proposition we considered all possible initial conditions with J 0 ̸ = 0 , V ̸ = 0 , in all other parts of the paper we focus on the case J
= V = 0 .
D. T HEOREM
In this section we provide full version of theorem 1 and its proof, and also elaborate on how spectral measures ρ C t change during training.
We keep the notations from previous sections, in particular the model Jacobian is Ψ , the Hessian H = 1 N ΨΨ T , the kernel matrix K = 1 N Ψ T Ψ , and output space second moments C out =
Ψ T CΨ .
However, for simplicity, in this section we consider only finite training datasets N < ∞ and features dimension d ≥ N (including d = ∞ ).
The extension of the results to all values of d, N seems to be rather technical and we expect it to lead to effectively the same conclusions.
We start with an analogue of theorem 1 but for the isolated noise term (8) containing the tensor (cid:98) R .
It turns out that the SE approximation is closely related to what we call the SE family of tensors (cid:98) R :
[Equation]
It is easy to check that the respective Σ ( (cid:98) R ) satisfies not only (7), but also a stronger version
[Equation]
[Equation]
Let’s focus only on the (cid:98) R -dependent term in (8), and for convenience rewrite it in terms Ψ as
[Equation]
where Ψ i =
ψ ( x i ) denotes the i’th column of Ψ .
Then we have
Proposition 9. Consider a fixed tensor (cid:98) R , and let operators Σ ′ , C be related to each over as Σ ′ =
Σ ′ (cid:98) R ( C ) .
Then, the following 3 statements are equivalent:
For any Jacobian Ψ and initial state C , spectral measure ρ Σ ′ depends on C only through its spectral measure ρ C , and on Ψ only through non-zero eigenvalues λ k of Hessian H .
Tensor ˆ R belongs to SE family (80) .
For any Jacobian Ψ and initial state C , the operator Σ ′ does not change by the replacement of Ψ with (cid:101) Ψ =
ΨU T in (82) for any orthogonal matrix U .
Proof.
From (2) to (3).
Substituting SE form (80) of tensor (cid:98) R into (82) we get
[Equation]
Then statement (3) follows from invariance of Hessian under orthogonal transformations of the
Jacobian
[Equation]
From (3) to (2).
Denote (cid:101) Σ ′ the result of (82) but rotated Jacobian (cid:101) Ψ = ΨU T in the right-hand side.
It is convenient to represent (cid:101) Σ ′ as
[Equation]
) where (cid:98)(cid:101) R is the rotated tensor (cid:98) R with coordinates (cid:101)
R i
i
[Equation] [Equation]
4 =
[Equation]
1 i 1 U
[Equation]
[Equation] [Equation]
U
[Equation] [Equation]
4 R
[Equation]
As statement (3) implies (cid:101) Σ ′ =
Σ ′ , we get
[Equation]
where the tensor δ (cid:98) R = (cid:98)(cid:101) R − (cid:98) R is the difference between original and ”rotated” tensor (cid:98) R .
Note that (cid:98) R , (cid:98)(cid:101) R and therefore δ (cid:98) R = (cid:98)(cid:101) R − (cid:98) R are symmetric w.r.t.
permutation of the first two and the last two indices.
Taking Jacobian with the full rank rank( Ψ ) =
N and exploiting permutation symmetry i 1 ↔ i 2 of δ (cid:98) R we notice that (86) implies
[Equation]
Next, we observe that for full rank Ψ we can choose C such that C out is an arbitrary positive-definite matrix.
Then, permutation symmetry i 3 ↔ i 4 and arbitrariness of C out implies δ (cid:98) R = 0 .
As U was arbitrary, we see that
[Equation]
where O( N ) is the group of orthogonal matrices of size N .
According to Weyl Weyl (1939) (see
Jeffreys (1973) for compact reference), the equality above implies that (cid:98) R is isotropic - expressed as a sum of products of dirac deltas δ ii ′ and possibly one anti-symmetric symbol ϵ j 1 j 2 ...j N .
In our case we can not have ϵ tensor: for N > 4 it has higher rank N > rank( ˆ R ) ; for N = 4 it does not satisfy symmetries of (cid:98) R ; for N = 3 it cannot be present because 3 is odd; for N = 2 all three possible combinations δ i 1 i 2 ϵ i 3 i 4 , δ i 3 i 4 ϵ i 1 i 2 , δ i
i 4 ϵ i 2 i 3 again do not satisfy permutation symmetries i 1 ↔ i
and i 3 ↔ i 4 .
Then we left with 3 possible combinations of Dirac deltas
[Equation]
Again, from symmetry considerations we get c 2 = c 3 , and finally recover (80) by setting c 1 = τand c 2 =
c
= 12 τ 2 .
From (2) to (1) .
We take arbitrary test function ϕ ( λ ) and calculate its average with spectral measure ρ Σ
[Equation]
As ϕ ( λ ) is arbitrary, we obtain
[Equation]
As the right-hand side depends only on the initial spectral measure ρ C ( dλ ) and the Hessian spectral measure
ρ H ( dλ ) , statement (1) follows from the fact that ρ H ( dλ ) depends only on non-zero eigenvalues of H .
From (1) to (2).
We take arbitrary U ∈
O( N ) and follow the notation of the From (3) to (2) proof.
As we already noted, original and rotated Jacobians have the same hessian (cid:101) H
= H , and therefore eigenvalues λ k .
Then, as we do not change C with the rotation of Jacobian, statement (3) implies that spectral measure of Σ ′ and (cid:101) Σ ′ are the same: ρ Σ ′ =
ρ (cid:102) Σ ′ .
For an arbitrary test function ϕ ( λ ) we have
[Equation]
Let us now fix some arbitrary output space matrix C out ∗ .
As Ψ and C were arbitrary, we can choose them so that we get arbitrary K but C out =
C out ∗ .
It means that in the last line in (92) we can consider
C out to be fixed, but K , ϕ to be arbitrary.
Then (92) implies that δ (cid:98) R C out =
and we can repeat respective steps of From (3) to (2) proof to get the statement (2) .
With proposition 9 as a basis, we are ready to state and prove the full version of theorem 1.
Theorem 3.
Consider SGD dynamics (4) with noise term (8) , initial condition v 0 = 0 and γ, α 0 > 0 .
If tensor (cid:98) R is fixed, the following statements are equivalent:
For any Jacobian Ψ and initial state C 0 , spectral measures ρ C t occurring during SGD are uniquely determined by the initial spectral measure ρ C 0 , the eigenvalues λ k of Hessian H , and SGD parameters { α t , β t } ∞ t =0 .
Tensor (cid:98) R is given by R i 1 i 2 i 3 i 4 =
τ 1 δ i 1 i 2 δ
i 3 i 4 − τ 2 − 1 2 ( δ i 1 i 3 δ i 2 i
+ δ
i
i 4 δ i 2 i 3 ) for some τ 1 , τ 2 , and Eq.
(7) holds.
For any Jacobian Ψ and initial state C 0 , the trajectory { C t } ∞ t =0 is invariant under transformations (cid:101)
Ψ
=
ΨU T of the feature matrix Ψ by any U ∈ O( N ) .
Proof.
From (1) to (2).
Let us consider the first iteration of SGD.
The initial condition v 0 =implies J
=
V
= 0 .
Also, denote for simplicity Σ t = Σ (cid:101) R ( C t ) .
Then, according to (4) we have
[Equation]
Respective spectral measure is
[Equation]
Then, according to statement (1) , we get that ρ Σ ′ 0 is uniquely determined by ρ C 0 and eigenvalues of
H , and therefore (cid:98) R is given by (80) according to equivalence of statements (1) and (2) of proposition 9.
From (3) to (2).
Considering first iteration of SGD as in the previous step, we get that Σ ′ 0 is invariant under orthogonal transformations of Jacobian Ψ .
Then, statement (2) follows from equivalence of statements (3) and (2) of proposition 9.
From (2) to (3).
We proceed by induction.
First, notice that C 0 , J 0 , V 0 are (trivially) invariant under orthogonal transformations of Jacobian (cid:101)
Ψ =
Ψ .
To make an induction step, assume that C t , J t , V t are invariant under orthogonal transformations of
Jacobian.
Then, according to equivalence of statements (3) and (2) of proposition 9 and invariance of Hessian H under orthogonal transformations of Jacobian Ψ we get that Σ t is also invariant.
As first term in (4) depend on Ψ only through H we get that the whole right-hand side of (4) is invariant under orthogonal transformations of Jacobian, and so are C t +1 , J t +1 , V t +1 .
From (2) to (1) As noted in the statement (2) , SE approximation (7) is satisfied.
It means that we can apply proposition 8 with initial conditions ρ J
=
ρ V 0 = 0 .
Then, according to representation (74) and update rules (75),(76), spectral measures ρ C t are uniquely determined by the initial spectral measure ρ C 0 , the eigenvalues λ k of Hessian H , SGD parameters { α t , β t } ∞ t =0 , and parameters γ, τ 1 , τ 2 .
Recalling that γ, τ 1 , τ 2 are considered to be fixed in statement (1) finishes the proof.
D. T RANSLATION INVARIANT MODELS
The purpose of this section is to prove Proposition 2.
Proposition 2.
Consider a problem with regular grid dataset D = { x i =
( 2 πi 1 N 1 , . .
, 2 πi d N d ) } , i ∈ ( Z /N 1 Z ) × · · · × ( Z /N d Z ) on the d -dimensional torus T d = ( R / 2 π Z ) d and with translation invariant kernel K ( x , x ′ )
=
K ( x − x ′ ) .
Then (7) holds exactly with τ 1 = 1 , τ 2 = 1 .
Proof.
Statement (7) with τ 1 = 1 , τ 2 = 1 is equivalent to
[Equation]
We will be proving this latter statement.
Denote the grid-indexing set ( Z /N 1 Z ) ×· · ·× ( Z /N d Z ) by Z / N Z .
Thanks to translation invariance of the data set and kernel, the eigenvectors u k of H have an explicit representation in the x -domain in terms of Fourier modes.
Specifically, let K be the N × N kernel matrix with matrix elements
[Equation]
Consider the functions ϕ
k : D → C given by
[Equation]
These functions form an orthonormal basis in C D and diagonalize the matrix K :
[Equation]
with
[Equation]
Operator H is unitarily equivalent to K up to its nullspace.
Assuming that the Hilbert space of H is complexified, the respective normalized eigenvectors u k of H can be written as
[Equation]
Assume for the moment that the problem is nondegenerate in the sense that all λ k > 0 so that all the vectors u k
are
well-defined.
It follows in particular that the indices k of the eigenvalues λ k can be identified with k ∈ Z / N Z .
By inverting relation (100),
[Equation]
We can then find the diagonal elements of Σ using Eq.
(5) and Eqs.
[Equation]
It follows that
[Equation]
which is the desired Eq.
Now we comment on the degenerate case, when λ k = 0 for some k .
This occurs if there is linear dependence between some ψ ( x i ) , i.e. dim Ran( H ) <
N. The vectors u k given by (100) with λ k ̸ = 0 form a basis in Ran( H ) .
Inverse relation (101) remains valid with arbitrary vectors u k for k such that λ k =
(this can be seen, for example, by lifting the degeneracy of the problem with a regularization ε and then letting ε → 0 ).
As a result, Eq.
(105) remains valid for k such that λ k > 0 .
On the other hand, if u k is an eigenvector corresponding to the eigenvalue λ k = 0 , i.e. u k ∈ ker H , then u k is orthogonal to ψ ( x i ) for all i , and then Σ kk = 0 for such k .
Thus, formula (105) remains valid in this case too, and so Eq.
(108) holds true.
E G ENERATING FUNCTIONS AND THEIR APPLICATIONS E. R EDUCTION TO GENERATING FUNCTIONS
We clarify some details of derivations in Section 4.
Gas of rank-1 operators.
Let us first discuss SE condition (7).
Recall that we assumed H to be diagonalized by the eigenbasis u k with eigenvalues λ k .
If the eigenvalues of H are non-degenerate,
SE condition (7) can be equivalently written as a relation between the diagonal matrix elements Σ kk , C kk of the matrices Σ , C :
[Equation]
(where we have incorporated the convention τ 1 = 1 , τ 2 = τ ).
More generally, if several λ k may be equal to some λ and so the choice of eigenvectors u k is not unique, conditions (109) should be replaced by weaker conditions (invariant w.r.t.
this choice):
[Equation]
Note, however, that representation (109) can be used without any restriction of generality if we are interested in the observables
Tr[ ϕ ( H ) C t ] (in particular, L ( t ) ) along the optimization trajectory (5): by Proposition 8 such quantities are uniquely determined by initial conditions and the learning rates of SGD once the SE approximation is assumed.
Representations (9) – (11) now follow directly from the evolution law (5), by inspecting the evolution of diagonal elements in submatrices C t , J t , V t using Eq.
Genarting functions.
Eq.
(16) follows from a relation between generating functions obtained using Eq.
[Equation]
where we have used the substitution T − t m = t, t m −
= s .
The resolvent formulas in Eqs.
(17), (19) follow from the definitions of U t , V s (Eqs.
We explain now the expansions (18), (20) of the noise and signal generating functions (cid:101) U ( z ) , (cid:101) V ( z ) as series of scalar rational functions.
Consider first expansion (18) for (cid:101) U ( z ) .
The terms of this expansion correspond to the eigenvalues λ k of H .
For each eigenvalue, the respective term is, by
Eq.
[Equation]
where A λ is the linear operator acting on the space of 2 × 2 matrices and given by Eq.
The scalar product in (115) can be computed as the component x 11 of the solution of the 4 × 4 linear system
[Equation]
Since all the components of the 4 × 4 matrix of the operator 1 − zA λ are polynomial in the parameters α, β, γ, τ, λ, z, the resulting x 11 is a rational function of these parameters.
The explicit form of xis tedious to derive by hand, but it can be easily obtained with the help of a computer algebra system such as Sympy (Meurer et al., 2017).
We provide the respective Jupyter notebook in the supplementary material.
The terms of (cid:101) V are obtained similarly, but by solving the equation
[Equation]
instead of Eq.
E. C ONVERGENCE CONDITIONS
Proof of Proposition 3.
Note first that Proposition 3 is implied by the following lemma:
Lemma 1.
Assume (as in Proposition (3) ) that β ∈ ( − 1 , 1) , 0 < α < 2( β +1) /λ max and γ ∈ [0 , 1] .
Then
S ( α, β, γ, λ, z ) > 0 for all z ∈ (0 , 1) ; 2. (cid:101) U
( z ) , (cid:101) V ( z ) are analytic in an open neighborhood of the interval (0 , 1) and have no singularities there; 3.
z (cid:101) U
( z ) is monotone increasing for all z ∈ (0 , 1) .
Indeed, by statement 2) and representation (16), a singularity of (cid:101) L ( z ) =
(cid:101) V ( z ) /
(2(1 − z (cid:101) U ( z ))) on the interval (0 , 1) can only be a pole resulting from a zero of the denominator 1 − z (cid:101) U ( z ) .
By statement 3), such a zero is present if and only if (cid:101) U ( z ) > 1 , as claimed.
It remains to prove the lemma.
usp
=sharing
Proof of Lemma 1.
Our proof of statement 1 is computer-assisted.
Note first that this statement can be written as the condition W = ∅ for a semi-algebraic set W ⊂ R 4 defined by several polynomial inequalities with integer coefficients:
[Equation]
where we have introduced the variable a = αλ.
By Tarski-Seidenberg theorem, the emptyness of a semi-algebraic set in R n is an algorithmically decidable problem (solvable by sequential elimination of existential quantifiers, via repeated standard operations such as differentiation, evaluation of polynomials, division of polynomials with remainder, etc., see e.g. (Basu, 2014)).
This procedure is implemented in some computer algebra systems, e.g. in REDUCE/Redlog (Dolzmann & Sturm, 1997).
We used this system to verify that W = ∅ :
[Equation] [Equation]
rlqe W;
false 2) Statement 2 follows from statement 1 and the fact that S ( α, β, γ, λ, z ) → (1 − z )(1 − βz )(1 − β 2 z ) as λ → 0 .
Indeed, since the series (cid:80) k λ 2 k and (cid:80)
k λ k C kk, 0 converge, singularities in (cid:101) U, (cid:101) V outside the points z
= 1 , β − 1 , β − 2 can only be poles of some of the terms of expansions (18), (20) associated with zeros of S , which are excluded by statement 1.
Our proof of statement 3 is also computer-assisted and similar to the proof of statement 1.
First we compute
[Equation]
where
R
[Equation]
By statement 1, it is sufficient to check that R ≥ 0 on the domain of interest.
This is done by verifying the emptyness of the set
[Equation]
in REDUCE/Redlog:
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
false
We provide experimental verifications of statements 1 and 2 in the accompanying Jupyter notebook.
Proof of Proposition 4.
Recall representation (21)
[Equation]
and rewrite it as (cid:101) U (1)
=
f ( 2(1 − β ) αγ , Y ) , Y = 1 − β
[Equation]
1+ β ) where f ( x, y ) is defined as
[Equation]
Note that due to assumptions αλ max < 2( β + 1) and τ > 0 , the denominator in (124) is always positive.
Then, from (124) we see that (cid:101) U (1) is monotonically increasing function of α , and therefore at fixed β, γ the convergence condition (cid:101) U (1) < 1 can be written as α < α c , or equivalently γα eff / 2 < 1 /x c , where x c is the largest positive solution of f ( x, Y )
= 1 .
Also, original definition of λ crit in 4 can be formulated in terms of f is a unique positive solution of f ( λ crit , 0)
= 1 .
Now observe that f ( x, Y ) >
f ( x, 0) for x > x c , and f ( x, 0) is monotonically decreasing functions of x for x > 0 .
These observations immediately imply that x c > λ crit and thus the statement (22).
Now we obtain the estimate (23) by abusing the fact f ( λ crit , 0) =
f ( x c , Y )
= 1 we explicitly calculate the difference f ( λ crit , 0) − f ( x c , Y ) and use it to bound x c − λ crit 0 = f
( λ crit , 0) − f ( x c , Y ) =
(cid:88)
[Equation]
Next we bound l.h.s.
from below with x c − λ crit τλ m ax + λ crit (by bounding denominator with λ crit and equating the rest of the series to f ( x c , Y ) ).
To bound the sum in r.h.s.
we note that it can be expressed as (cid:80) k a k b k were (cid:80) k a k = f
( x c , Y ) and (cid:80) k b k = f
( λ crit , 0) .
Then, the upper bound (cid:80) k a k b k < b 0 = λ max τλ max + λ crit is constructed by noting that redistribution of the mass a k → δ kyields the maximum r.h.s.
for fixed b k and under constraint a k ≥ 0 , (cid:80) k a k ≤ 1 .
Thus we arrive at
[Equation] [Equation]
Noting that α c eff ( β, γ )
=
2 γx c we get (23) as | α c eff ( β, γ ) − γλ crit | /α
c eff ( β, γ ) =
[Equation]
c − λ crit λ crit ≤ λ max λ crit 1 − β γ (1 + β ) (131)
E.
L OSS ASYMPTOTIC UNDER POWER - LAWS
The main purpose of this section is to prove theorem 2.
First, note that if λ k → 0 and C kk, 0 >for infinitely many k (non-strongly-convex problems, including power-laws (25)), then r L ≤ 1 , thus excluding the possibility of exponential loss convergence.
Indeed, S ( α, β, γ, λ, z ) λ → 0 −→ (1 − z )(1 − βz )(1 − β 2 z ) .
It follows that for small λ k the respective terms in expansion (18) have three poles
z k, 0 , z k, 1 , z k, 2 converging to 1 , β − 1 , β − 2 , respectively.
By Eq.
(cid:101) L ( z ) has a removable singularity at z k, 0 , moreover
(cid:101) L ( z k, 0 )
<
if C kk, 0 > 0 and k is large enough, meaning that r L < z k, 0 .
We then get r L ≤ 1 by taking the limit in k.
As r L ≥ 1 for convergent trajectories and r L ≤ 1 for non-strongly-convex problems, we conclude that r L = 1 .
Then, we formulate a lemma allowing to calculate the ε → +0 , ε = 1 − z asymptotics of the generating functions (18) and (20).
Lemma 2.
Suppose that S k and C k are two sequences
such that S k = k − ν
(1 + o (1))
and F k =
[Equation]
∞ l = k C l = k − κ (1 + o (1)) as k → ∞ , with some constants ν, κ > 0 .
Also denote ζ = κ ν .
Then 1.
[Equation]
Assume ζ < n for some n > 0 , then
[Equation]
Proof.
Part 1.
Fix k and consider a discrete measure µ k with atoms located at points x l,k = ( l/k ) − ν :
[Equation]
By assumption on F k as k → ∞ , the cumulative distribution function of µ k converges to cumulative distribution function of measure µ ( dx ) =
1 [0 , 1] dx ζ , i.e. the measure µ k weakly converges to µ .
Next, consider the function f k ( x ) defined at points x l,k by f k ( x l,k )
=
k ν S l , with f k (0) = 0 , linearly interpolated between the points x l,k , and with f ( x > 1) =
f ( x k,k ) .
Then f k ( x ) converges uniformly on [0 , 1] to f ( x ) =
x as k → ∞ .
The above two observations on µ k and f k give
[Equation]
Part 2.
For any a > 0 let k a,ε =
⌊ ( εa ) − 1 /ν ⌋ .
Rescale the sum of interest and divide it into two parts separated by index k a,ε :
[Equation] [Equation]
We will show that
[Equation]
These two fact will imply the statement of the lemma since ζ − n < 0 and
[Equation]
To prove Eq.
(137), use summation by parts and the hypotheses on S k , F k :
[Equation]
To prove Eq.
(138), it is convenient to represent the sum I 2 ( a, ε ) as an integral over discrete measure µ a,ε with atoms x k,ε
[Equation]
Again, by assumption on F k , as ε → 0+ , the cumulative distribution functions of µ a,ε converge to the cumulative distribution function of the measure µ a ( dx ) =
1 [0 ,a ] dx ζ , i.e., the measures µ a,ε weakly converge to µ a .
At the same time, the functions f ε ( x ) converge to (1 + x ) − n uniformly on [0 , a ] .
This implies desired convergence (138).
Now we are ready to proceed with the proof of theorem 2.
Theorem 2.
Assume spectral conditions (25) with ν > 1 and that parameters α, β, γ are as in
Proposition 3 and such that convergence condition (cid:101) U (1) < 1 is satisfied.
Then
[Equation]
Proof.
As asymptotic of partial sums (cid:80) Tt =1 tL ( t ) are associated with asymptotic of (cid:101) L ′ (1 − ε ) at ε → +0 we recall its expression (27)
[Equation]
Full expressions for generating functions (18) and (20) can be significantly simplified in the limit ε → +0 and λ k →
[Equation]
Differentiating we get
[Equation]
Let’s make a couple of observations.
From asymptotic expressions above one can show that
[Equation]
Here the sign ∼ means an asymptotic ( ε → 0 ) equality up to a multiplicative constant.
Using these asymptotic relations we see that for (cid:101)
L ′ (1 − ε ) leading asymptotic terms are given by either (cid:101) U ′ (1 −
ε ) when ζ > 2 − 1 ν , or by (cid:101) V ′ (1 − ε ) when ζ < 2 − 1 ν .
Now we set for simplicity Λ = K = 1 and apply lemma 2 to (153) and (154) to get more refined asymptotic expressions.
For V ′ (1 − ε ) we assume ζ < 2 because V ′ (1 − ε )
=
O (1) for ζ > 2 and refined asymptotic is not needed.
[Equation]
Here in (1) we first used first part of lemma 2 to get (cid:80) l ≥ k C ll λ 2 l = ζζ
+1 k − κ − ν
(1 + o (1)) .
Then for 1 < ζ < 2 the second sum is finite (see (158)) and for ζ < 1 second part of lemma 2 allows to bound the sum as O ( ε ζ − 1 ) .
In (2) we applied second part of lemma 2 to the first sum in (1).
For U ′ (1 − ε ) we have
[Equation]
In (1) the second sum can be bounded as O (1) after recalling that ν > 1 .
In (2) we again applied second part of lemma 2 with C k = λ
2 k and n = 2 since (cid:80) l ≥ k λ 2 k = 1 2 ν − 1 k − 2 ν
+1 (1 + o (1)) .
To get the coefficient in (2) we used Γ(3 − 1 /ν ) 2 ν −= Γ
[Equation]
Substituting (160) and (159) into (150) we get
[Equation]
where C V ′ and C U ′ are constants in the asymptotics (159) and (160).
Picking the leading term depending on the sign of ζ − (2 − 1 ν ) we obtain final expressions
[Equation]
The last step is to apply Tauberian theorem (Feller (1971), p. 445) which states that if generating function (cid:101) F ( z ) of a sequence F ( t ) has asymptotic (cid:101) F (1 − ε ) =
Cε − ρ (1+ o (1)) , then the partial sums have the asymptotic (cid:80)
Tt =1 F ( t ) =
C Γ( ρ +1) T ρ (1+ o (1)) .
Applying this theorem to F ( t ) =
tL ( t ) and its generating function given by (162) we get precisely (26) with Λ = K = 1 .
To restore the values of constants Λ , K recall that the part of the loss coming from signal ( (cid:101) V ( z ) ) is simply proportional to K , and Λ always goes in combination α Λ .
Finally, let us show how (26) can be used to obtain asymptotics (28a),(28b) for the loss values L ( t ) themselves.
Assuming that L ( t ) =
Ct − ξ , ξ < 2 , we get
T
[Equation]
Comparing this with (26), we find the constants C appearing in (28a),(28b).
E. E XPONENTIAL DIVERGENCE OF THE LOSS AND CONVERGENCE - DIVERGENCE TRANSITION
Convergence radius r L and exponential divergence rate.
By Proposition 3, the convergence radius r L < 1 if and only if (cid:101) U (1) > 1 , and in the case (cid:101) U (1) > 1 it is determined by the condition
[Equation]
r l (cid:101)
[Equation]
( r L
[Equation]
If r L < 1 , loss exponentially diverges as t → ∞ :
Proposition 10.
Under assumption of Proposition 3, suppose that r L < 1 .
Then
T (cid:88)
[Equation]
Proof.
Consider the modified generating function (cid:101)
L 1 ( z ) =
(cid:101) L ( r L z ) , which is the generating function for the sequence L ( t ) r tL :
[Equation]
The convergence radius for (cid:101)
L 1 is 1.
We can also write
[Equation]
The statement of the proposition then follows by the Tauberian theorem.
If we assume that
[Equation]
with some constant C , then this constant is fixed by Eq.
[Equation]
“Eventual divergence” phase with small α .
Recall that we characterized the “eventual divergence” phase by the condition (cid:101) U (1) = ∞ .
In this phase we necessarily have r L < 1 .
However, r L can be very close to 1 (and thus “divergence delayed”) – for example if the learning rate α is very small.
In this scenario we can derive an asymptotic expression for the difference ϵ ∗ = 1 − r L .
In the sequel, we assume for simplicity that β
= 0 and τ = γ = 1 , and that the eigenvalues and initial covariance coefficients C kk, 0 satisfy power law relations (25) with 12 < ν < 1 (corresponding to the “eventual divergence” phase).
Proposition 11.
As α → 0 ,
[Equation]
Proof.
With β = 0 and τ = γ = 1 , we have by Eq.
[Equation]
For any α , we can now apply Lemma 2(2) with κ = 2 ν − 1 , ζ = 2 − 1 /ν and n = 1 and get
[Equation]
It is easy to see that o (1) here is uniform for small α .
The desired ϵ ∗ =
ϵ ∗ ( α ) is determined from the equation 1 = (1 − ϵ ∗ ) (cid:101) U (1 − ϵ ∗ ) .
As α → 0 , we clearly have ϵ ∗ =
ϵ ∗ ( α ) → 0 .
It follows that
[Equation]
This implies desired expression (171).
We can similarly use Lemma 2 to also estimate the derivative (cid:101) U ′ (1 − ϵ ) :
[Equation]
(this result can also formally be obtained by differentiating Eq.
(174) in ϵ ).
In particular, for ϵ =
ϵ ∗ we get
[Equation]
“Early convergent” regime.
If r L < 1 , then, as discussed above, loss eventually diverges exponentially.
However, in general, we expect this divergence to occur only after some interval of convergence (see Figure 3(right)).
We will give the loss asymptotic for this “early convergent” phase and give a rough estimate of the time scale at which the transition between the two regimes occurs.
We retain the assumptions β = 0 and γ = τ = 1 from the previous paragraph, and assume power laws (25) with 12 < ν < 1 and ζ < 1 .
We start with finding the loss asymptotic in the early convergent phase.
First we argue that this phase can be approximately described by the loss generating function
[Equation]
i.e. generating function (16) in which we approximate the denominator by 1:
[Equation]
This approximation can be justified for z < r L by noting that, by Eq.
[Equation]
185) with 1 − 1 /ν < 0 .
We remark that approximations (184) and (183) essentially mean that we ignore terms containing factors U t,s associated with noise in expansion (12).
If relation (183) held for all z ∈ (0 , 1) , then we would have an asymptotic convergence of the loss for all t .
Indeed, under our assumptions,
[Equation]
and (cid:101) V (1 − ϵ )
→ ∞ as ϵ → 0 (since ζ < 1 ).
Applying again Lemma 2, we find
[Equation]
[Equation]
The Tauberian theorem then implies that
[Equation]
Assuming a power-law form
[Equation]
we then find
[Equation]
This expression agrees with “signal-dominated” loss asymptotic (28a) up to the factor (1 − (cid:101) U (1))
−(missing because of our approximation (184)).
Transition from convergence to divergence.
Of course, the obtained asymptotic (193) does not hold for very large t , since representation (183) breaks down at z ≳ r L , and the loss trajectory switches to exponential divergence.
We can roughly estimate the switching time t blowup by equating the asymptotic expressions for L ( t ) in the convergent and divergent phases:
[Equation]
This is a transcendental equation not explicitly solvable in t blowup .
We simplify it using a number of approximations.
Using approximation (189) for (cid:101) V ( r L ) and the fact that ϵ ∗ is small, we can simplify this equation to
[Equation]
Next, using Eq.
(182), we can approximate the l.h.s.
by
[Equation]
It follows that Eq.
(195) can be approximated as
[Equation]
Thus, we can write
[Equation]
where a ∗ is the solution of the equation
[Equation]
If t div = − 1 / log r L denotes the characteristic time scale of exponential divergence, then at small α we have t div ≈ 1 /ϵ ∗ , so the characteristic transition time t blowup is related to t div by the simple relation
[Equation]
E. B UDGET OPTIMIZATION
It is known that for SGD with not too large batches, there is approximately linear scalability of learning w.r.t.
batch size, in the sense that to reach a given loss value with an increased batch size the number of iterations should be decreased proportionally (Ma et al., 2018; Shallue et al., 2018).
This law is naturally no longer valid at very large batch sizes, since in the limit of infinitely large batch size SGD just converges to the non-stochastic GD, so that further increasing batch size when
[Figure]
it it already large brings little benefit (the effect of “diminishing returns”).
Figure 5 shows that this effect is also reproduced in our setting.
Let us now show that this effect should be observed in the signal-dominated phase if for each batch size b , learning rate and momentum are chosen optimally.
In the respective part of Sec.
6 we showed that loss can be approximately written as L ( t ) ∼ ( α eff t ) − ζ ; the optimal learning rate and momenta are located near the convergence boundary and the momenta is close to 1 .
Since the effective learning rate is bounded α eff < 2 γλ crit (see eq.
and the bound is tight for the beta close to 1 (see Eq.
(23)), we in the optimal loss value we can approximate α eff with 2 γλ crit .
This leads us to the optimal loss L ( t ) ≈ C ′ ( t/γ ) − ξ .
Replacing γ with 1 b (which is very accurate for large dataset sizes N , see prop. 1), we get L ( t )
≈ C ′ ( bt ) − ξ which is exactly linear scalability of SGD with batch size.
E. P OSITIVE VS . NEGATIVE MOMENTA
Recall that our analysis of the effect of momentum is based on the approximations (28a), (28b) for
L ( t ) at large t :
[Equation]
201b)
We now formulate and prove the full version of Proposition 5 describing how L approx ( t ) is affected by changing the momentum from β = 0 at the optimal α .
Note that t enters expression L approx ( t ) only through the factor t − ζ or t 1 /ν − 2 .
As a result, the statements below hold in the same form for all t > 0 .
Proposition 12 (full version of Proposition 5) .
Suppose that the eigenvalues λ k and initial moments
C kk, 0 are subject to large- k power law asymptotics (25) with some exponents ν, κ > 0 , ζ = κ /ν and coefficients Λ ,
K. Denote α opt = arg min α L approx ( t )
| β =0 .
I. ( signal-dominated phase ) Let ζ < 2 − 1 /ν and 0 < τ ≤ 1 , 0 ≤ γ ≤ 1 .
Then 1.
At β = 0 and as a function of α , the function L approx ( t ) has a unique minimum in the interval (0 , α max ) , where α max is the critical stability value defined by the condition (cid:101) U (
z = 1 , α = α max , β = 0)
= 1 .
Accordingly, α opt = arg min α L approx ( t )
| β =0 is well-defined and unique.
∂ β L approx ( t )
| β =0 ,α = α opt < 0 .
II.
( noise-dominated phase ) Let ζ > 2 − 1 /ν
and Let τ = γ = 1 .
Then 1.
α opt = 2( ν − 1) 3 ν − 1 (
Tr[ H ]) − 1 ;
The sign of ∂ β L approx ( t ) | β
[Equation]
[Equation]
α = α opt equals the sign of the expression
[Equation]
Before giving the proof we make a few remarks.
The “noise-diminated” part of our result is proved under much more restrictive assumptions ( τ = γ = 1 ) than the “signal-dominated” part ( 0 < τ ≤ 1 , 0 ≤ γ ≤ 1 ).
The reason is that the effect of β is much more subtle in the noise-dominated case, and is described by relatively cumbersome formulas.
Setting τ = γ = 1 allows us to substantially simplify these formulas.
In contrast, improvement from positive β in the signal-dominated case appears to be a general and robust phenomenon.
It can be observed from the proof in the noise-dominated case that the second, negative term in Eq.
(202) results from the “signal” generating function (cid:101) U (1) in Eq.
(201b), while the first, positive term results from the “noise” generating function (cid:101) V (1) .
A similar observation can be made in the signal-dominated case, but Eq.
(201a) only includes the “signal” generating function (cid:101) U (1) , so the counterpart of expression Ξ in this case is always negative.
If τ = γ = 1 , then in the signal-dominated case α opt has the simple form α opt = 2 ζ ζ +
Tr[ H ]) − 1 . 4.
If τ = γ = 1 , then the critical stability value α max at which (cid:101) U
( z = 1 , α, β = 0)
= 1 has the simple form α max = 2(Tr
[ H ]) − 1 .
In particular, we see from the explicit formulas for α opt that in both signal-dominated and noise-dominated regime α opt < α max , as expected.
Proof of Proposition 12.
Let (cid:101) U 1 , (cid:101) V 1 denote the values (cid:101) U
( z = 1) ,
[Equation]
V ( z = 1) .
Recall from Eqs.
(18), (20) that
[Equation]
As a preliminary step, note that at β = 0 we have:
[Equation]
By our assumptions, τγ − 1 ≤ 0 .
As a result, the function (cid:101) U 1 ( α, 0) is monotone increasing in α , and there is a unique critical stability value α max at which (cid:101) U 1 ( α max , 0)
= 1 and L approx ( t ) becomes infinite by Eq.
I. ( signal-dominated phase )
It is convenient to consider the logarithmic derivative of L approx ( t )
| β =0 .
By Eq.
(201a),
[Equation]
Note that the last expression in square brackets is monotone increasing in α , because τγ ≤ 1 .
If α = 0 , this expression is negative.
On the other hand, at α = α max such that (cid:101) U 1 ( α max , 0)
=
this expression is positive.
It follows that there is a unique point α opt ∈ (0 , α max ) where
[Equation]
and L approx ( t ) | β =0 attains its minimum.
Now observe that
[Equation]
At α = α max the first term in Eq.
(222) vanishes, and the remaining term is negative, proving that
[Equation]
II.
( noise-dominated phase )
At τ = γ = 1 , formulas (205)-(210) admit a simpler form:
[Equation]
Snce Eq.
(201b) for the noise-dominated phase involves (cid:101) V 1 , we will also need similar formulas for this expression.
At β = 0 we have
[Equation] [Equation]
The expression in brackets is monotone increasing in α and vanishes at
[Equation]
proving statement 1.
We have
[Equation]
ν
[Equation]
At α = α opt we can simplify this expression by recalling that at this α Eq.
(234) vanishes, and using Eq.
[Equation]
proving statement 2.
In Figure 6 we illustrate this result for a range of models with exact (not asymptotic) power laws (25) at different ν and κ .
In this case, in the noise-dominated regime, characteristic Ξ is positive for sufficiently large κ but negative for smaller κ .
In agreement with Proposition 12, we observe the experimentally found optimal β to be negative or positive, respectively.
F E XPERIMENTS F. T RAINING REGIMES
We have considered four regimes of training with the increasing level of approximation for real network dynamics:
Real neural network ( NN ) .
We used fully-connected neural network with one hidden layer in the NTK parametrization:
[Equation]
Here w (1 , 2) l are the weight matrices, b l are the biases for neuron l , and d is the number of units in the hidden layer.
We have used D = 1000 in our experiments.
For the sake of simplicity, the network outputs a single value for each input, i.e the classification task is treated as regression to the label with the MSE loss.
The model is trained via SGD in the standard way: at each step a subset of size b is sampled without repetition from the training dataset and the weights are updated according to the equation (1).
0.5 α − − − − − −
L ( α ) f
o r β =( ν , ϰ )=(1.5,2.5) ( ν , ϰ )=(1.5,3.5)
( ν , ϰ )=(2.0,3.5)
( ν , ϰ )=(2.0,5.0) −0.3 −0.2 −0.
0.3 β 0.
l o g L ( β ) m i n β L ( β ) f
o r α = α o p t ( ν , ϰ )=(1.5,2.5) ( ν , ϰ )=(1.5,3.5)
( ν , ϰ )=(2.0,3.5)
( ν , ϰ )=(2.0,5.0) 1.00 1.25 1.50 1.75 2.00 2.25 2.
2.75 3.00 ν      ϰ 2 ν − -1.
Linearized regime with sampled batches ( linearized or sampled ) .
Model outputs f
( x ) evolve on the dataset of interest according to the equation (47).
At each step a batch of size b is sampled without replacement from the whole dataset of size N and SGD step is performed.
All second matrix moments dynamics ( all sm ) .
We simulate the dynamics of the whole second moment matrix that is obtained after taking expectation over all possible noise configurations, defined by (58) with the noise term given in the last line of (60).
spectrally expressible regime ( SE ) .
In the spectrally expressible regime, the diagonal of the second moment matrix is invariant
under
SGD dynamics,
i.e
diagonal elements evolve independently from off diagonal terms
Therefore, one needs to keep track only of the diagonal terms.
The dynamics in the output space follows Eq.
F. D ATASETS
In the experiments we have used synthetic data with the NTK spectrum and second moment matrix obeying a power-law decay rule λ k = k − ν and λ k C kk, 0 = k − κ − 1 with specific ν and κ and the subset of size N of the MNIST dataset.
The whole train dataset of size 60000 requires much memory for the computation of NTK and is too costly from computational side for running large series of experiments, therefore we have used only part of the data of size 1000 – 10000 depending on the experiment.
The digits are distributed uniformly in the dataset, i.e there are N 10 samples of each class.
We have observed that this subset of data is sufficient to approximate the powerlaw asymptotic for NTK and partial sums since the exponents do not change significantly with the increase of the amount of data.
F. E XPERIMENTAL DETAILS
For Fig.
1 one we have taken a subset of N = 3000 digits from MNIST and ran 10 4 SGD updates for the real neural network with one hidden layer, linearized dynamics, and in the spectrally expressible appoximation with τ = ± 1 .
One can see that τ
= 1 provides more accurate approximation for smaller batch size b = 10 , whereas for b = 100 both τ = ± 1 are rather accurate.
For Fig.
2 we ran 10000 gradient descent updates for every point on the grid of learning rates α and β , where we have taken 100 values of α uniformly selected on [0 , 4] and 50 values for β uniformly on [0 , 1] .
The grey regions on the 2d plots correspond to the values of α and β for which the optimization procedure has diverged.
The size of the dataset is 1000 both in the synthetic and
MNIST case.
For Figs 5, 6 (left, center and right)
we have taken the dataset of size N = 10000 both for synthetic and MNIST case and performed 10000 steps of gradient descent.
In Fig.
6 (center) we have taken 100 points uniformly on the interval α ∈ [0 , 0 . 5] , and 100 points uniformly on the interval β ∈ [ − 0 .
3 , 0 . 3] for Fig.
6 (right).
Concerning the correspondence of optimal learning rates 6 with the analytical formula (30) we observe that is quite accurate for large ratio κ/ν since the ratio C noise C signal ≃ 100 for ( ν, κ ) =
(1 . 5 , 3 . 5) , (2 . 0 , 5 . 0) , whereas for C noise C signal ≃ 1 for ( ν, κ ) =
(1 . 5 , 2 . 5) , (2 . 0 , 3 . 5) , therefore both the signal and noise asymptotic are of same order for quite a long time, since the difference between the ’signal’ exponent ξ and ’noisy’ 2 − 1 ν is relatively small.
F. V ALIDITY OF SPECTRALLY EXPRESSIBLE APPROXIMATION
[Figure]
In section 3 we introduced several scenarios where SE approximation is exact.
However, more interesting and at the same time much more difficult question is how well SE approximation well suited to describe the practical problems, where we are given a particular Jacobian Ψ , initial state
C 0 and then generate the sequence of states C t according to (4) with true noise term (5).
We can approach this question in a different ways.
First approach is to consider individually the true dynamics with (5) and approximated dynamics with noise term (7).
Then we can look at certain quantities of practical interest and check whether they are close to each other.
In figure 2 we compared stability regions in ( α, β ) plane for MNIST and found a good agreement between actual dynamics and SE approximation with τ 1 = 1 , τ 2 = 1 .
In figure 1 we did it for the loss values on MNIST, but instead of noise-averaged loss values we compared with loss on a single stochastic trajectory.
To make the comparison for loss values more thorough, in figure F.4 we add average of several stochastic trajectories ( sampled ), true second moments dynamics (all sm), and several SE approximations with τ 1 = 1 but different τ 2 .
For MNIST we find excellent agreement with τ 2 = 1 , for Bike Sharing dataset agreement is good with τ 2 = 0 , and for GPU performance dataset the agreement is worse with optimal τ 2 changing during optimization from 0 to − 1 .
The second approach is to run true dynamics of second moments, and on each step compare how true noise covariance Σ t given by (5) with SE noise covariance Σ SEt ( τ 1 , τ 2 ) , which we take to be given by
[Equation]
[Figure]
absolute moving optimum
We measure closeness of true and approximated noise covariances with relative quadratic trace distance
[Equation]
Note that linearity of Σ SEt ( τ 1 , τ 2 ) implies that E 2 ( τ 1 , τ 2 ) is quadratic in τ 1 , τ 2 .
We analyze quadratic form E 2 ( τ 1 , τ 2 ) in Figure F.4.
From the bottom left part we see that the ellipses corresponding to level sets of E 2 ( τ 1 , τ 2 ) are extremely stretched, meaning that there exist a direction along which approximation error changes very weekly.
To check that conclusion for during the whole SGD optimization, we plot in center top part the ratio of smaller to bigger principal axes of level sets ellipses and see that during optimization the stretching only increases.
One particular consequence is that there is a ambiguity in choosing the optimal τ 1 , τ 2 , which means that we can safely put τ 1 = 1 and vary only τ 2 .
This conclusion is illustrated on right top part where both global and on τ 1 = 1 optimal aprroximation error are very small ≲ 10 − 3 during the whole optimization.
Finally, we observe left bottom part of F.4 that optimal τ 2 is extremely close to 1 , which well agrees with the conclusion of the first approach based on predicting the evolution of loss values and stability regions.
F. A DDITIONAL EXPERIMENTS
To study the validity of the theoretical framework developed in this work in more practically interesting setting we computed empirical NTKs 3 of the pretrained models from torchvision and conducted experiments with model training in the linearized regime and spectrally expressible approximation with τ = ± 1 on the CIFAR10 dataset Krizhevsky et al.
One can observe from Fig.9 that spectrally expressible approximation can accurately describe the averaged dynamic of the linearized model.
The NTK eigendecomposition and target expansion in the NTK eigenvectors follow again power-law decay rule.
In the experiments below we used popular ResNet-18 and MobileNet-V models pretrained on the ImageNet dataset Russakovsky et al.
[Figure]
In addition to the image and synthetic data we ran experiments with one hidden layer fully-connected neural network and with the approximate dynamics for two tabular datasets from UCI Machine
Learning Repository: Bike Sharing dataset 4 and SGEMM GPU kernel performance dataset 5 .
The former is a regression problem, namely, prediction of the count of rental bikes per hour or per day, and we’ve selected the per hour dataset.
There are 17389 instances in the dataset and 16 features per input sample.
The latter is a regression problem as well, there are 14 features, describing the different properties of the computation hardware and software and the outputs are the execution times of 4 runs of matrix-matrix product for two matrices of size 2048 × 2048 .
We predict the average of four runs.
There are 241600 instances in the dataset.
See results in Fig.
In order to investigate the problem of the loss convergence and determination of the critical learning rate we performed experiments with different batch sizes b = 1 , 10 , 1000 , 1000 on MNIST and synthetic data with ν = 1 . 5 , κ = 0 .
75 (the ’signal’ regime) and with h ν = 1 . 5 , κ = 3 .
(the ’noisy’ regime).
For each value of momentum β we plot the critical value of learning rate α crit such that the dynamics starts to diverge.
See results in Figures 12, 13 and 14.
Moreover, we carried out
[Figure]
for Sgemm
GPU kernel performance dataset.
the same experiment with empirical NTK computed on CIFAR10 for pretrained ResNet18 and batch sizes b = 10 , 100 (see Figure 11)
[Figure]
l o g ( L o ss ) a t 10 3 t h i t e r a t i o n
[Figure]
Legend and notations follow Fig. 2.
G M INI - BATCH SGD VS . SGD WITH ADDITIVE NOISE
In the paper we considered SGD with the natural noise structure induced by random sampling of batches.
However, it is instructive to consider SGD with an additive noise model and observe how this surrogate noise model qualitatively changes optimization.
Specifically, we will assume that on each iteration, a Gaussian vector with covariance G is added to the true loss gradient: ∇ ( t ) w L ( w ) = ∇ w L ( w ) + g t , g t ∼ N (0 , G ) .
For quadratic problems the SGD iteration becomes
[Equation]
[Figure] [Figure]
[Figure]
n t u
[Figure]
Then, due to E [ g t ] =
[Figure]
the dynamics of first moments is identical to that of noiseless GD, like in the case of sampling noise.
However, dynamics of second moments is different:
[Equation]
Considering again constant learning rates α t
= α, β t = β , we see that by making a linear shift of second moments we get the noiseless dynamics:
[Equation]
where M ∞ is the “residual uncertainty” determined from the linear equation
[Equation]
[Equation]
For simplicity, let’s restrict ourselves to SGD without momentum ( β = 0 ).
Then in the eigenbasis of H we have
[Equation]
Thus, optimization converges with the speed of noiseless GD, but the limiting loss is nonzero:
[Equation]
The key difference of SGD with sampling noise (4), (5) is the multiplicative character of the noise, in the sense that it vanishes as the optimization converges to the true solution and M t becomes close to 0.
To summarize, the two largest differences between SGD with additive and multiplicative noises are
Loss converges to a value L ∞ > 0 for additive noise and to 0 for multiplicative noise.
Convergence rate is independent of noise strength for additive noise, but significantly depends on it for multiplicative noise.
H N OISELESS CONVERGENCE CONDITION
The convergence condition α < 2(1+ β ) λ max for noiseless GD is known (see e.g. (Tugay & Tanik, 1989)).
For completeness, below we present its derivation in our setting.
First observe that, in the noiseless GD, different eigenspaces of H evolve independently from each other.
Thus we need to separately require convergence in each eigenspace of H .
Denoting the eigenvalue of the chosen subspace by λ , we write the GD iteration as
[Equation]
The characteristic equation for eigenvalues s of matrix S is
[Equation]
yielding solutions
[Equation]
The GD dynamics converges iff | s 1 | < 1 and | s 2 | < 1 .
First note that | s 1 || s 2 | = | β | and therefore for | β | ≥ 1 at least one of | s 1 , 2 | will be ≥ 1 and GD will not converge.
Therefore we only need to consider β ∈ ( − 1 , 1) .
When β ∈ (cid:0) (1 − √ αλ ) 2 , (1 + √ αλ ) 2 (cid:1) , the eigenvalues s 1 , 2 are complex and | s 1 | = | s 2 |
=
(cid:112) | β | .
The convergence condition in this region is | β | < 1 which is automatically satisfied.
Now consider the region where s 1 , 2 are real.
As s 1 > s 2 , the convergence conditions in this region are s 1 < 1 and s 2 > − 1 .
Note that for β ≤ 0 the eigenvalues s 1 , 2 are always real, while for β >they are real for λ ∈ [
, ∞ ) \ ( λ 1 , λ 2 ) with λ 1 = (1 − √ β ) 2 /α and λ 2 =
(1 + √ β ) 2 /α .
Let us first check the condition s 1 < 1 .
The equation s 1 ( λ )
= 1 gives λ = 0 .
For β > 0 we have s 1 ( λ = 0) = 1 , s 1 ( λ = λ 1 ) = √ β < 1 and s 1 ( λ = λ 2 ) =
−√ β < 1 and therefore s 1 ( λ ) < 1 on (0 , ∞ ) \ ( λ 1 , λ 2 ) due to continuity of s 1 ( λ ) .
For β < 0 the condition s 1 ( λ ) < 1 is always satisfied because s 1 ( λ ) is decreasing with λ .
Proceeding to condition s 2 > − 1 we find that equation s 2 ( λ ⋆ ) = − 1 gives αλ ⋆ = 2( β + 1) .
Note that λ ⋆ > λ 2 .
For β > 0 we have s 2 ( λ = 0) =
β > − 1 , s 2 ( λ = λ 1 ) = √ β > − 1 , s 2 ( λ = λ 2 )
=
−√ β > − 1 and s 2 ( λ → ∞ ) →
−∞ .
Therefore, due to continuity of s 2 ( λ ) , we have s 2 ( λ ) > − 1 on (0 , λ ⋆ ) /
( λ 1 , λ 2 ) and s 2 ( λ ) < − 1 on ( λ ⋆ , ∞ ) .
Similarly, for β < 0 we again have s 2 ( λ ) > − 1 on (0 , λ ⋆ ) and s 2 ( λ ) < − 1 on ( λ ⋆ , ∞ )
Combining all the observations above, we get a single convergence condition for non-stochastic GD:
[Equation]
where λ max is the largest eigenvalues of H .