An Exponential Learning Rate Schedule for Deep Learning

Zhiyuan Li, Sanjeev Arora

Introduction

Batch Normalization (BN) offers significant benefits in optimization and generalization across architectures, and has become ubiquitous. Usually best performance is attained by adding weight decay and momentum in addition to BN.

Usually weight decay is thought to improve generalization by controlling the norm of the parameters. However, it is fallacious to try to separately think of optimization and generalization because we are dealing with a nonconvex objective with multiple optima. Even slight changes to the training surely lead to a different trajectory in the loss landscape, potentially ending up at a different solution! One needs trajectory analysis to have a hope of reasoning about the effects of such changes.

In the presence of BN and other normalization schemes, including GroupNorm, LayerNorm, and InstanceNorm, the optimization objective is scale invariant to the parameters, which means rescaling parameters would not change the prediction, except the parameters that compute the output which do not have BN. However, Hoffer et al. (2018b) shows that fixing the output layer randomly doesn’t harm the performance of the network. So the trainable parameters satisfy scale invariance.(See more in Appendix C) The current paper introduces new modes of analysis for such settings. This rigorous analysis yields the surprising conclusion that the original learning rate (LR) schedule and weight decay(WD) can be folded into a new exponential schedule for learning rate: in each iteration multiplying it by (1+α)(1+\alpha) for some α>0\alpha>0 that depends upon the momentum and weight decay rate.

The above theorem requires that the product of learning rate and weight decay factor, λη\lambda\eta, is small than (1−γ)2(1-\sqrt{\gamma})^{2}, which is almost always satisfied in practice. The rigorous and most general version of above theorem is Theorem 2.12, which deals with multi-phase LR schedule, momentum and weight decay.

There are other recently discovered exotic LR schedules, e.g. Triangular LR schedule(Smith, 2017) and Cosine LR schedule(Loshchilov & Hutter, 2016), and our exponential LR schedule is an extreme example of LR schedules that become possible in presence of BN. Such an exponential increase in learning rate seems absurd at first sight and to the best of our knowledge, no deep learning success has been reported using such an idea before. It does highlight the above-mentioned viewpoint that in deep learning, optimization and regularization are not easily separated. Of course, the exponent trumps the effect of initial lr very fast (See Figure 3), which explains why training with BN and WD is not sensitive to the scale of initialization, since with BN, tuning the scale of initialization is equivalent to tuning the initial LR η\eta while fixing the product of LR and WD, ηλ\eta\lambda (See Lemma 2.7).

Note that it is customary in BN to switch to a lower LR upon reaching a plateau in the validation loss. According to the analysis in the above theorem, this corresponds to an exponential growth with a smaller exponent, except for a transient effect when a correction term is needed for the two processes to be equivalent (see discussion around Theorem 2.12).

Thus the final training algorithm is roughly as follows: Start from a convenient LR like 0.10.1, and grow it at an exponential rate with a suitable exponent. When validation loss plateaus, switch to an exponential growth of LR with a lower exponent. Repeat the procedure until the training loss saturates.

In Section 3, we demonstrate on a toy example how weight decay and normalization are inseparably involved in the optimization process. With either weight decay or normalization alone, SGD will achieve zero training error. But with both turned on, SGD fails to converge to global minimum.

In Section 5, we experimentally verify our theoretical findings on CNNs and ResNets. We also construct better exponential LR schedules by incorporating the Cosine LR schedule on CIFAR10, which opens the possibility of even more general theory of rate schedule tuning towards better performance.

There have been other theoretical analyses of training models with scale-invariance. (Cho & Lee, 2017) proposed to run Riemanian gradient descent on Grassmann manifold G(1,n)\mathcal{G}(1,n) since the weight matrix is scaling invariant to the loss function. observed that the effective stepsize is proportional to ηw∥wt∥2\frac{\eta_{w}}{\|{\bm{w}}_{t}\|^{2}}. (Arora et al., 2019) show the gradient is always perpendicular to the current parameter vector which has the effect that norm of each scale invariant parameter group increases monotonically, which has an auto-tuning effect. (Wu et al., 2018) proposes a new adaptive learning rate schedule motivated by scale-invariance property of Weight Normalization.

Previous work for understanding Batch Normalization. (Santurkar et al., 2018) suggested that the success of BNhas does not derive from reduction in Internal Covariate Shift, but by making landscape smoother. (Kohler et al., 2018) essentially shows linear model with BN could achieve exponential convergence rate assuming gaussian inputs, but their analysis is for a variant of GD with an inner optimization loop rather than GD itself. (Bjorck et al., 2018) observe that the higher learning rates enabled by BN empirically improves generalization. (Arora et al., 2019) prove that with certain mild assumption, (S)GD with BN finds approximate first order stationary point with any fixed learning rate. None of the above analyses incorporated weight decay, but (Zhang et al., 2019; Hoffer et al., 2018a; van Laarhoven, 2017; Page, ; Wu, ) argued qualitatively that weight decay makes parameters have smaller norms, and thus the effective learning rate, ηw∥wt∥2\frac{\eta_{w}}{\|{\bm{w}}_{t}\|^{2}} is larger. They described experiments showing this effect but didn’t have a closed form theoretical analysis like ours. None of the above analyses deals with momentum rigorously.

2 Preliminaries and Notations

For batch B={xi}i=1B{\mathcal{B}}=\{x_{i}\}_{i=1}^{B}, network parameter θ{\bm{\theta}}, we denote the network by fθf_{\bm{\theta}} and the loss function at iteration tt by Lt(fθ)=L(fθ,Bt)L_{t}(f_{\bm{\theta}})=L(f_{{\bm{\theta}}},{\mathcal{B}}_{t}) . When there’s no ambiguity, we also use Lt(θ)L_{t}({\bm{\theta}}) for convenience.

Implementations of SGD with Momentum/Nesterov comes with subtle variations in literature. We adopt the variant from Sutskever et al. (2013), also the default in PyTorch (Paszke et al., 2017). L2L2 regularization (a.k.a. Weight Decay) is another common trick used in deep learning. Combining them together, we get the one of the mostly used optimization algorithms below.

[SGD with Momentum and Weight Decay] At iteration tt, with randomly sampled batch Bt{\mathcal{B}}_{t}, update the parameters θt{\bm{\theta}}_{t} and momentum vt{\bm{v}}_{t} as following:

where ηt\eta_{t} is the learning rate at epoch tt, γ\gamma is the momentum coefficient, and λ\lambda is the factor of weight decay. Usually, v0{\bm{v}}_{0} is initialized to be 0\bm{0}.

For ease of analysis, we will use the following equivalent of Definition 1.2.

where η−1\eta_{-1} and θ−1{\bm{\theta}}_{-1} must be chosen in a way such that v0=θ0−θ−1η−1{\bm{v}}_{0}=\frac{{\bm{\theta}}_{0}-{\bm{\theta}}_{-1}}{\eta_{-1}} is satisfied, e.g. when v0=0{\bm{v}}_{0}=\bm{0}, θ−1=θ0{\bm{\theta}}_{-1}={\bm{\theta}}_{0} and η−1\eta_{-1} could be arbitrary.

A key source of intuition is the following simple lemma about scale-invariant networks Arora et al. (2019). The first property ensures GD (with momentum) always increases the norm of the weight.(See Lemma B.1 in Appendix B) and the second property says that the gradients are smaller for parameteres with larger norm, thus stabilizing the trajectory from diverging to infinity.

Deriving Exponential Learning Rate Schedule

As a warm-up in Section 2.1 we show that if momentum is turned off then Fixed LR + Fixed WD can be translated to an equivalent Exponential LR. In Section 2.2 we give a more general analysis on the equivalence between Fixed LR + Fixed WD + Fixed Momentum Factor and Exponential LR + Fixed Momentum Factor. While interesting, this still does completely apply to real-life deep learning where reaching full accuracy usually requires multiple phases in training where LR is fixed within a phase and reduced by some factor from one phase to the next. Section 2.3 shows how to interpret such a multi-phase LR schedule + WD + Momentum as a certain multi-phase exponential LR schedule with Momentum.

We use notation of Section 1.2 and assume LR is fixed over iterations, i.e. ηt=η0\eta_{t}=\eta_{0}, and γ\gamma (momentum factor) is set as . We also use λ\lambda to denote WD factor and θ0{\bm{\theta}}_{0} to denote the initial parameters.

The intuition should be clear from Lemma 1.3, which says that shrinking parameter weights by factor ρ\rho (where ρ<1\rho<1) amounts to making the gradient ρ−1\rho^{-1} times larger without changing its direction. Thus in order to restore the ratio between original parameter and its update (LR×\timesGradient), the easiest way would be scaling LR by ρ2\rho^{2}. This suggests that scaling the parameter θ{\bm{\theta}} by ρ\rho at each step is equivalent to scaling the LR η\eta by ρ−2\rho^{-2}.

To prove this formally we use the following formalism. We’ll refer to the vector (θ,η)({\bm{\theta}},\eta) the state of a training algorithm and study how this evolves under various combinations of parameter changes. We will think of each step in training as a mapping from one state to another. Since mappings can be composed, any finite number of steps also correspond to a mapping. The following are some basic mappings used in the proof.

Run GD with WD for a step: GDtρ(θ,η)=(ρθ−η∇Lt(θ),η)\textrm{GD}^{\rho}_{t}({\bm{\theta}},\eta)=(\rho{\bm{\theta}}-\eta\nabla L_{t}({\bm{\theta}}),\eta);

Scale the parameter θ{\bm{\theta}}: Π1c(θ,η)=(cθ,η)\Pi_{1}^{c}({\bm{\theta}},\eta)=(c{\bm{\theta}},\eta);

Scale the LR η\eta: Π2c(θ,η)=(θ,cη)\Pi_{2}^{c}({\bm{\theta}},\eta)=({\bm{\theta}},c\eta).

For example, when ρ=1\rho=1, GDt1\textrm{GD}^{1}_{t} is vanilla GD update without WD, also abbreviated as GDt\textrm{GD}_{t}. When ρ=1−λη0\rho=1-\lambda\eta_{0}, GDt1−λη0\textrm{GD}^{1-\lambda\eta_{0}}_{t} is GD update with WD λ\lambda and LR η0\eta_{0}. Here LtL_{t} is the loss function at iteration tt, which is decided by the batch of the training samples Bt{\mathcal{B}}_{t} in ttth iteration. Below is the main result of this subsection, showing our claim that GD + WD ⇔\Leftrightarrow GD+ Exp LR (when Momentum is zero). It will be proved after a series of lemmas.

For every ρ<1\rho<1 and positive integer tt following holds:

With WD being λ\lambda, ρ\rho is set as 1−λη01-\lambda\eta_{0} and thus the scaling factor of LR per iteration is ρ−2=(1−λη0)−2\rho^{-2}=(1-\lambda\eta_{0})^{-2}, except for the first iteration it’s ρ−1=(1−λη0)−1\rho^{-1}=(1-\lambda\eta_{0})^{-1}.

We first show how to write GD update with WD as a composition of above defined basic maps.

GDtρ=Π2ρ∘Π1ρ∘GDt∘Π2ρ−1\textrm{GD}^{\rho}_{t}=\Pi_{2}^{\rho}\circ\Pi_{1}^{\rho}\circ\textrm{GD}_{t}\circ\Pi_{2}^{\rho^{-1}}.

Below we will define the proper notion of equivalence such that (1). Π1ρ∼Π2ρ−2\Pi_{1}^{\rho}\sim\Pi_{2}^{\rho^{-2}}, which implies GDtρ∼Π2ρ−1∘GDt∘Π2ρ−1\textrm{GD}^{\rho}_{t}\sim\Pi_{2}^{\rho^{-1}}\circ\textrm{GD}_{t}\circ\Pi_{2}^{\rho^{-1}}; (2) the equivalence is preserved under future GD updates.

We first extend the equivalence between weights (same direction) to that between states, with additional requirement that the ratio between the size of GD update and that of parameter are the same among all equivalent states, which yields the notion of Equivalent Scaling.

(θ,η)({\bm{\theta}},\eta) is equivalent to (θ′,η′)({\bm{\theta}}^{\prime},\eta^{\prime}) iff ∃c>0\exists c>0, (θ~,η~)=[Π1c∘Π2c2](θ,η)=(cθ,c2η)(\widetilde{{\bm{\theta}}},\widetilde{\eta})=[\Pi_{1}^{c}\circ\Pi_{2}^{c^{2}}]({\bm{\theta}},\eta)=(c{\bm{\theta}},c^{2}\eta), which is also denoted by (\widetilde{{\bm{\theta}}},\widetilde{\eta})\mathrel{\overset{c}{\scalebox{1.5}[1.0]{\sim}}}({\bm{\theta}},\eta). Π1c∘Π2c2\Pi_{1}^{c}\circ\Pi_{2}^{c^{2}} is called Equivalent Scaling for all c>0c>0.

The following lemma shows that equivalent scaling commutes with GD update with WD, implying that equivalence is preserved under GD update (Lemma 2.4). This anchors the notion of equivalence — we could insert equivalent scaling anywhere in a sequence of basic maps(GD update, LR/parameter scaling), without changing the final network.

For any constant c,ρ>0c,\rho>0 and t≥0t\geq 0, GDtρ∘[Π1c∘Π2c2]=[Π1c∘Π2c2]∘GDtρ\textrm{GD}^{\rho}_{t}\circ[\Pi_{1}^{c}\circ\Pi_{2}^{c^{2}}]=[\Pi_{1}^{c}\circ\Pi_{2}^{c^{2}}]\circ\textrm{GD}^{\rho}_{t}. In other words, ({\bm{\theta}},\eta)\mathrel{\overset{c}{\scalebox{1.5}[1.0]{\sim}}}({\bm{\theta}}^{\prime},\eta^{\prime})\Longrightarrow\textrm{GD}^{\rho}_{t}({\bm{\theta}},\eta)\mathrel{\overset{c}{\scalebox{1.5}[1.0]{\sim}}}\textrm{GD}^{\rho}_{t}({\bm{\theta}}^{\prime},\eta^{\prime}).

Now we formally define equivalence relationship between maps using equivalent scalings.

Two maps F,GF,G are equivalent iff ∃c>0\exists c>0, F=Π1c∘Π2c2∘GF=\Pi_{1}^{c}\circ\Pi_{2}^{c^{2}}\circ G, which is also denoted by F\mathrel{\overset{c}{\scalebox{1.5}[1.0]{\sim}}}G.

By Lemma 2.2,, \textrm{GD}^{\rho}_{t}\mathrel{\overset{\rho}{\scalebox{1.5}[1.0]{\sim}}}\Pi_{2}^{\rho^{-1}}\circ\textrm{GD}_{t}\circ\Pi_{2}^{\rho^{-1}}. By Lemma 2.4, GD update preserves map equivalence, i.e. F\mathrel{\overset{c}{\scalebox{1.5}[1.0]{\sim}}}G\Rightarrow\textrm{GD}_{t}^{\rho}\circ F\mathrel{\overset{c}{\scalebox{1.5}[1.0]{\sim}}}\textrm{GD}_{t}^{\rho}\circ G,\forall c,\rho>0. Thus,

2 Replacing WD by Exponential LR: Case of constant LR with momentum

In this subsection the setting is the same to that in Subsection 2.1 except that the momentum factor is γ\gamma instead of 0. Suppose the initial momentum is v0{\bm{v}}_{0}, we set θ−1=θ0−v0η{\bm{\theta}}_{-1}={\bm{\theta}}_{0}-{\bm{v}}_{0}\eta. Presence of momentum requires representing the state of the algorithm with four coordinates, (θ,η,θ′,η′)({\bm{\theta}},\eta,{\bm{\theta}}^{\prime},\eta^{\prime}), which stand respectively for the current parameters/LR and the buffered parameters/LR (from last iteration) respectively. Similarly, we define the following basic maps and equivalence relationships.

Run GD with WD for a step: GDtρ(θ,η,θ′,η′)=(ρθ+η(γθ−θ′η′−∇Lt(θ)),η,θ,η)\textrm{GD}^{\rho}_{t}({\bm{\theta}},\eta,{\bm{\theta}}^{\prime},\eta^{\prime})=\left(\rho{\bm{\theta}}+\eta\left(\gamma\frac{{\bm{\theta}}-{\bm{\theta}}^{\prime}}{\eta^{\prime}}-\nabla L_{t}({\bm{\theta}})\right),\eta,{\bm{\theta}},\eta\right);

Scale Current parameter θ{\bm{\theta}} Π1c(θ,η,θ′,η′)=(cθ,η,θ′,η′)\Pi_{1}^{c}({\bm{\theta}},\eta,{\bm{\theta}}^{\prime},\eta^{\prime})=(c{\bm{\theta}},\eta,{\bm{\theta}}^{\prime},\eta^{\prime});

Scale Current LR η\eta: Π2c(θ,η,θ′,η′)=(θ,cη,θ′,η′)\Pi_{2}^{c}({\bm{\theta}},\eta,{\bm{\theta}}^{\prime},\eta^{\prime})=({\bm{\theta}},c\eta,{\bm{\theta}}^{\prime},\eta^{\prime});

Scale Buffered parameter θ′{\bm{\theta}}^{\prime}: Π3c(θ,η,θ′,η′)=(θ,η,cθ′,η′)\Pi_{3}^{c}({\bm{\theta}},\eta,{\bm{\theta}}^{\prime},\eta^{\prime})=({\bm{\theta}},\eta,c{\bm{\theta}}^{\prime},\eta^{\prime});

Scale Buffered parameter η′\eta^{\prime}: Π4c(θ,η,θ′,η′)=(θ,η,θ′,cη′)\Pi_{4}^{c}({\bm{\theta}},\eta,{\bm{\theta}}^{\prime},\eta^{\prime})=({\bm{\theta}},\eta,{\bm{\theta}}^{\prime},c\eta^{\prime}).

(θ,η,θ′,η′)({\bm{\theta}},\eta,{\bm{\theta}}^{\prime},\eta^{\prime}) is equivalent to (θ~,η~,θ~′,η~′)(\widetilde{{\bm{\theta}}},\widetilde{\eta},\widetilde{{\bm{\theta}}}^{\prime},\widetilde{\eta}^{\prime}) iff ∃c>0, (θ,η,θ′,η′)=[Π1c∘Π2c2∘Π3c∘Π4c2](θ~,η~,θ~′,η~′)=(cθ~,c2η~,cθ~′,c2η~′)\exists c>0,\ ({\bm{\theta}},\eta,{\bm{\theta}}^{\prime},\eta^{\prime})=\left[\Pi_{1}^{c}\circ\Pi_{2}^{c^{2}}\circ\Pi_{3}^{c}\circ\Pi_{4}^{c^{2}}\right](\widetilde{{\bm{\theta}}},\widetilde{\eta},\widetilde{{\bm{\theta}}}^{\prime},\widetilde{\eta}^{\prime})=(c\widetilde{{\bm{\theta}}},c^{2}\widetilde{\eta},c\widetilde{{\bm{\theta}}}^{\prime},c^{2}\widetilde{\eta}^{\prime}), which is also denoted by ({\bm{\theta}},\eta,{\bm{\theta}}^{\prime},\eta^{\prime})\mathrel{\overset{c}{\scalebox{1.5}[1.0]{\sim}}}(\widetilde{{\bm{\theta}}},\widetilde{\eta},\widetilde{{\bm{\theta}}}^{\prime},\widetilde{\eta}^{\prime}). We call Π1c∘Π2c2∘Π3c∘Π4c2\Pi_{1}^{c}\circ\Pi_{2}^{c^{2}}\circ\Pi_{3}^{c}\circ\Pi_{4}^{c^{2}} Equivalent Scalings for all c>0c>0.

Again by expanding the definition, we show equivalent scalings commute with GD update.

∀c,ρ>0\forall c,\rho>0 and t≥0t\geq 0, GDtρ∘[Π1c∘Π2c2∘Π3c∘Π4c2]=[Π1c∘Π2c2∘Π3c∘Π4c2]∘GDtρ\textrm{GD}^{\rho}_{t}\circ\left[\Pi_{1}^{c}\circ\Pi_{2}^{c^{2}}\circ\Pi_{3}^{c}\circ\Pi_{4}^{c^{2}}\right]=\left[\Pi_{1}^{c}\circ\Pi_{2}^{c^{2}}\circ\Pi_{3}^{c}\circ\Pi_{4}^{c^{2}}\right]\circ\textrm{GD}^{\rho}_{t}.

Similarly, we can rewrite GDtρ\textrm{GD}^{\rho}_{t} as a composition of vanilla GD update and other scalings by expanding the definition, when the current and buffered LR are the same in the input of GDtρ\textrm{GD}^{\rho}_{t}.

For any input (θ,η,θ′,η)({\bm{\theta}},\eta,{\bm{\theta}}^{\prime},\eta), if α>0\alpha>0 is a root of α+γα−1=ρ+γ\alpha+\gamma\alpha^{-1}=\rho+\gamma, then GDtρ(θ,η,θ′,η)=[Π4α∘Π2α∘Π1α∘GDt∘Π2α−1∘Π3α∘Π4α](θ,η,θ′,η)\textrm{GD}^{\rho}_{t}({\bm{\theta}},\eta,{\bm{\theta}}^{\prime},\eta)=\left[\Pi_{4}^{\alpha}\circ\Pi_{2}^{\alpha}\circ\Pi_{1}^{\alpha}\circ\textrm{GD}_{t}\circ\Pi_{2}^{\alpha^{-1}}\circ\Pi_{3}^{\alpha}\circ\Pi_{4}^{\alpha}\right]({\bm{\theta}},\eta,{\bm{\theta}}^{\prime},\eta). In other words,

Though looking complicated, the RHS of Equation 4 is actually the desired Π2α−1∘GDt∘Π2α−1\Pi_{2}^{\alpha^{-1}}\circ\textrm{GD}_{t}\circ\Pi_{2}^{\alpha^{-1}} conjugated with some scaling on momentum part Π3α∘Π4α\Pi_{3}^{\alpha}\circ\Pi_{4}^{\alpha}, and Π3α−1∘Π4α−1\Pi_{3}^{\alpha^{-1}}\circ\Pi_{4}^{\alpha^{-1}} in the current update cancels with the Π3α∘Π4α\Pi_{3}^{\alpha}\circ\Pi_{4}^{\alpha} in the next update. Now we are ready to show the equivalence between WD and Exp LR schedule when momentum is turned on for both.

θt−θt−1η0=γ(θt−1−θt−2)η0−∇θ(L(θt−1)+λ2∥θt−1∥22)\frac{{\bm{\theta}}_{t}-{\bm{\theta}}_{t-1}}{\eta_{0}}=\frac{\gamma({\bm{\theta}}_{t-1}-{\bm{\theta}}_{t-2})}{\eta_{0}}-\nabla_{\bm{\theta}}(L({\bm{\theta}}_{t-1})+\frac{\lambda}{2}\|{\bm{\theta}}_{t-1}\|_{2}^{2})

θ~t−θ~t−1η~t=γ(θ~t−1−θ~t−2)η~t−1−∇θL(θ~t−1)\frac{\widetilde{{\bm{\theta}}}_{t}-\widetilde{{\bm{\theta}}}_{t-1}}{\widetilde{\eta}_{t}}=\frac{\gamma(\widetilde{{\bm{\theta}}}_{t-1}-\widetilde{{\bm{\theta}}}_{t-2})}{\widetilde{\eta}_{t-1}}-\nabla_{\bm{\theta}}L(\widetilde{{\bm{\theta}}}_{t-1})

where α\alpha is a positive root of equation x2−(1+γ−λη0)x+γ=0x^{2}-(1+\gamma-\lambda\eta_{0})x+\gamma=0, which is always smaller than 1(See Appendix A.1). When γ=0\gamma=0, α=1−λη0\alpha=1-\lambda\eta_{0} is the unique non-zero solution.

Above we implicitly assume that λη0≤(1−γ)2\lambda\eta_{0}\leq(1-\sqrt{\gamma})^{2} such that the roots are real and this is always true in practice. For instance of standard hyper-parameters where γ=0.9,η0=0.1,λ=0.0005\gamma=0.9,\eta_{0}=0.1,\lambda=0.0005, λη0(1−γ)2≈0.019≪1\frac{\lambda\eta_{0}}{(1-\sqrt{\gamma})^{2}}\approx 0.019\ll 1.

Note that (θ~0,η~0,θ~−1,η~−1)=[Π2α−1∘Π3α∘Π4α](θ0,η0,θ0,η0)(\widetilde{{\bm{\theta}}}_{0},\widetilde{\eta}_{0},\widetilde{{\bm{\theta}}}_{-1},\widetilde{\eta}_{-1})=\left[\Pi_{2}^{\alpha^{-1}}\circ\Pi_{3}^{\alpha}\circ\Pi_{4}^{\alpha}\right]({\bm{\theta}}_{0},\eta_{0},{\bm{\theta}}_{0},\eta_{0}), it suffices to show that

which follows immediately from Lemma 2.7 and Lemma 2.8 by induction. ∎

3 Replacing WD by Exponential LR: Case of multiple LR phases

Usual practice in deep learning shows that reaching full training accuracy requires reducing the learning rate a few times.

Step Decay is the (standard) learning rate schedule, where training has KK phases I=0,1,…,K−1I=0,1,\ldots,K-1, where phase II starts at iteration TIT_{I} (T0=0T_{0}=0), and all iterations in phase II use a fixed learning rate of ηI∗\eta^{*}_{I}.

The algorithm state in Section 2.2, consists of 4 components including buffered and current LR. When LR changes, the buffered and current LR are not equal, and thus Lemma 2.8 cannot be applied any more. In this section we show how to fix this issue by adding extra momentum correction. In detail, we show the below defined Exp LR schedule leads the same trajectory of networks in function space, with one-time momentum correction at the start of each phase. We empirically find on CIFAR10 that ignoring the correction term does not change performance much.

There exists a way to correct the momentum only at the first iteration of each phase, such that the following Tapered-Exponential LR schedule (TEXP) {η~t}\{\widetilde{\eta}_{t}\} with momentum factor γ\gamma and no WD, leads the same sequence networks in function space as that of Step Decay LR schedule(Definition 2.11) with momentum factor γ\gamma and WD λ\lambda.

where αI∗=1+γ−ληI∗+(1+γ−ληI∗)2−4γ2\alpha^{*}_{I}=\frac{1+\gamma-\lambda\eta^{*}_{I}+\sqrt{\left(1+\gamma-\lambda\eta^{*}_{I}\right)^{2}-4\gamma}}{2}, η~0=η0⋅(α0∗)−1=η0∗⋅(α0∗)−1\widetilde{\eta}_{0}=\eta_{0}\cdot(\alpha_{0}^{*})^{-1}=\eta^{*}_{0}\cdot(\alpha_{0}^{*})^{-1}.

The analysis in previous subsection give the equivalence within each phase, where the same LR is used throughout the phase. To deal with the difference between buffered LR and current LR when entering new phases, the idea is to pretend ηt−1=ηt\eta_{t-1}=\eta_{t} and θt−1{\bm{\theta}}_{t-1} becomes whatever it needs to maintain θt−θt−1ηt−1\frac{{\bm{\theta}}_{t}-{\bm{\theta}}_{t-1}}{\eta_{t-1}} such that we can again apply Lemma 2.8, which requires the current LR of the input state is equal to its buffered LR. Because scaling α\alpha in RHS of Equation 4 is different in different phases, so unlike what happens within each phase, they don’t cancel with each other at phase transitions, thus remaining as a correction of the momentum. The proofs are delayed to Appendix A, where we proves a more general statement allowing phase-dependent WD, {λI}I=0K−1\{\lambda_{I}\}_{I=0}^{K-1}.

Alternative interpretation of Step Decay to exponential LR schedule:Below we present a new LR schedule, TEXP++, which is exactly equivalent to Step Decay without the need of one-time correction of momentum when entering each phase. We further show in Appendix A.1 that when translating from Step Decay, the TEXP++ we get is very close to the original TEXP(Equation 8), i.e. the ratio between the LR growth per round, η~t+1η~t/η~t+1′η~t′\frac{\widetilde{\eta}_{t+1}}{\widetilde{\eta}_{t}}/\frac{\widetilde{\eta}^{\prime}_{t+1}}{\widetilde{\eta}^{\prime}_{t}} converges to 1 exponentially each phase. For example, with WD 0.0005, max LR 0.1, momentum factor 0.9, the ratio is within 1±0.0015∗0.9t−TI1\pm 0.0015*0.9^{t-T_{I}}, meaning TEXP and TEXP++ are very close for Step Decay with standard hyperparameters.

θt−θt−1ηt−1=γθt−1−θt−2ηt−2−∇θ((L(θt−1)+λt−12∥θt−1∥22)\frac{{\bm{\theta}}_{t}-{\bm{\theta}}_{t-1}}{\eta_{t-1}}=\gamma\frac{{\bm{\theta}}_{t-1}-{\bm{\theta}}_{t-2}}{\eta_{t-2}}-\nabla_{\bm{\theta}}\left((L({\bm{\theta}}_{t-1})+\frac{\lambda_{t-1}}{2}\|{\bm{\theta}}_{t-1}\|_{2}^{2}\right), for t=1,2,…t=1,2,\ldots;

θ~t−θ~t−1η~t−1=γθ~t−1−θ~t−2η~t−2−∇θL(θ~t−1)\frac{\widetilde{{\bm{\theta}}}_{t}-\widetilde{{\bm{\theta}}}_{t-1}}{\widetilde{\eta}_{t-1}}=\gamma\frac{\widetilde{{\bm{\theta}}}_{t-1}-\widetilde{{\bm{\theta}}}_{t-2}}{\widetilde{\eta}_{t-2}}-\nabla_{\bm{\theta}}L(\widetilde{{\bm{\theta}}}_{t-1}), for t=1,2,…t=1,2,\ldots,

where η~t=PtPt+1ηt\widetilde{\eta}_{t}=P_{t}P_{t+1}\eta_{t}, Pt=∏i=−1tαi−1P_{t}=\prod\limits_{i=-1}^{t}\alpha_{i}^{-1}, ∀t≥−1\forall t\geq-1 and αt\alpha_{t} recursively defined as

The LR schedule {η~t}t=0∞\{\widetilde{\eta}_{t}\}_{t=0}^{\infty} is called Tapered Exponential ++, or TEXP++.

Example illustrating interplay of WD and BN

The paper so far has shown that effects of different hyperparameters in training are not easily separated, since their combined effect on the trajectory is complicated. We give a simple example to illustrate this, where convergence is guaranteed if we use either BatchNorm or weight decay in isolation, but convergence fails if both are used. (Momentum is turned off for clarity of presentation)

Case 1: WD alone: Since both the above objective with L2 regularization is strongly convex and smooth in w{\bm{w}}, vanilla GD with suitably small learning rate could get arbitrarily close to the global minimum for this regularized objective. In our case, large batch SGD behaves similarly to GD and can achieve O(ηλB)O(\sqrt{\frac{\eta\lambda}{B}}) test error following the standard analysis of convex optimization.

Case 2: BN alone: Add a BN layer after the linear layer, and fix scalar and bias term to 1 and 0. The objective becomes

Case 3: Both BN and WD: When BN and WD are used together, no matter how small the noise is, which comes from the large batch size, the following theorem shows that SGD will not converge to any solution with error smaller than O(ηλ)O(\sqrt{\eta\lambda}), which is independent of the batch size (noise level).

[Nonconvergence] Starting from iteration any T0T_{0}, with probability 1−δ1-\delta over the randomness of samples, the training error will be larger than επ\frac{\varepsilon}{\pi} at least once for the following consecutive 12(ηλ−2ε2)ln⁡64∥wT0∥2εBηm−2+9ln⁡1δ\frac{1}{2(\eta\lambda-2\varepsilon^{2})}\ln\frac{64\|w_{T_{0}}\|^{2}\varepsilon\sqrt{B}}{\eta\sqrt{m-2}}+9\ln\frac{1}{\delta} iterations.

(See full proof in Appendix A.) The high level idea of this proof is that if the test error is low, the weight is restricted in a small cone around the global minimum, and thus the amount of the gradient update is bounded by the size of the cone. In this case, the growth of the norm of the weight by Pythagorean Theorem is not large enough to cancel the shrinkage brought by weight decay. As a result, the norm of the weight converges to 0 geometrically. Again we need to use the lower bound for size of the gradient, that ∥∇wLt∥=Θ(η∥wt∥mB)\|\nabla_{\bm{w}}L_{t}\|=\Theta(\frac{\eta}{\|{\bm{w}}_{t}\|}\sqrt{\frac{m}{B}}) holds with constant probability. Thus the size of the gradient will grow along with the shrinkage of ∥wt∥\|{\bm{w}}_{t}\| until they’re comparable, forcing the weight to leave the cone in next iteration. ∎

Viewing EXP LR via Canonical Optimization Framework

This section tries to explain why the efficacy of exponential LR in deep learning is mysterious to us, at least as viewed in the canonical framework of optimization theory.

Canonical framework for analysing 1st order methods This focuses on proving that each —or most—steps of GD noticeably reduce the objective, by relying on some assumption about the spectrum norm of the hessian of the loss, and most frequently, the smoothness, denoted by β\beta. Specifically, for GD update θt+1=θt−η∇L(θt){\bm{\theta}}_{t+1}={\bm{\theta}}_{t}-\eta\nabla L({\bm{\theta}}_{t}), we have

When β<2η\beta<\frac{2}{\eta}, the first order term is larger than the second order one, guaranteeing the loss value decreases. Since the analysis framework treats the loss as a black box (apart from the assumed bounds on the derivative norms), and the loss is non-convex, the best one can hope for is to prove speedy convergence to a stationary point (where gradient is close to ). An increasing body of work proves such results.

Now we turn to difficulties in understanding the exponential LR in context of the above framework and with scale-invariance in the network.

Since loss is same for θ{\bm{\theta}} and c⋅θc\cdot{\bm{\theta}} for all c>0c>0 a simple calculation shows that along any straight line through the origin, smoothness is a decreasing function of cc, and is very high close to origin. (Note: it is also possible to one can show the following related fact: In any ball containing the origin, the loss is nonconvex.)

Thus if one were trying to apply the canonical framework to argue convergence to a stationary point, the natural idea would be to try to grow the norm of the parameters until smoothness drops enough that the above-mentioned Canonical Framework starts to apply. Arora et al. (2019) showed this happens in GD with fixed LR (WD turned off), and furthermore the resulting convergence rate to stationary point is asymptotically similar to analyses of nonconvex optimization with learning rate set as in the Canonical framework. Santurkar et al. (2018) observed similar phenomenon in experiments, which they described as a smoothening of the objective due to BN.

The Canonical Framework can be thought of as a discretization of continuous gradient descent (i.e., gradient flow): in principle it is possible to use arbitrarily small learning rate, but one uses finite learning rate merely to keep the number of iterations small. The discrete process approximates the continuous process due to smoothness being small.

In case of gradient flow with weight decay (equivalently, with exponential LR schedule) the discrete process cannot track the continuous process for very long, which suggests that any explanation of the benefits of exponential LR may need to rely on discrete process being somehow better. The reason being that for gradient flow one can decouple the speed of the θt{\bm{\theta}}_{t} into the tangential and the radial components, where the former one has no effect on the norm and the latter one has no effect on the objective but scales the tangential gradient exponentially. Thus the Gradient Flow with WD gives exactly the same trajectory as vanilla Gradient Flow does, excepting a exponential reparametrization with respect to time tt.

It can be shown that if the local smoothness is upperbounded by 2η\frac{2}{\eta} (as stipulated in Canonical Framework) during a sequence θt{\bm{\theta}}_{t} (t=1,2,…t=1,2,\ldots) of GD updates with WD and constant LR then such sequence satisfies θt→0{\bm{\theta}}_{t}\rightarrow\bm{0}. This contrasts with the usual experimental observation that θt{\bm{\theta}}_{t} stays bounded away from 0\bm{0}. One should thus conclude that in practice, with constant LR and WD, smoothness doesn’t always stay small (unlike the above analyses where WD is turned off).

Experiments

The translation to exponential LR schedule is exact except for one-time momentum correction term entering new phases. The experiments explore the effect of this correction term. The Tapered Exponential(TEXP) LR schedule contains two parts when entering a new phase I: an instant LR decay (ηIηI−1\frac{\eta_{I}}{\eta_{I-1}}) and an adjustment of the growth factor (αI−1∗→αI∗\alpha^{*}_{I-1}\to\alpha^{*}_{I}). The first part is relative small compared to the huge exponential growing. Thus a natural question arises: Can we simplify TEXP LR schedule by dropping the part of instant LR decay?

Also, previously we have only verified our equivalence theorem in Step Decay LR schedules. But it’s not sure how would the Exponential LR schedule behave on more rapid time-varying LR schedules such as Cosine LR schedule.

Settings: We train PreResNet32 on CIFAR10. The initial learning rate is 0.1 and the momentum is 0.9 in all settings. We fix all the scalar and bias of BN, because otherwise they together with the following conv layer grow exponentially, sometimes exceeding the range of Float32 when trained with large growth rate for a long time. We fix the parameters in the last fully connected layer for scale invariance of the objective.

We tried the following LR schedule (we call it TEXP–). Interestingly, up to correction of momentum when entering a new phase, this schedule is equivalent to a constant LR schedule, but with the weight decay coefficient reduced correspondingly at the start of each phase. (See Theorem A.2 and Figure 5)

where αI∗=1+γ−ληI∗+(1+γ−ληI∗)2−4γ2\alpha^{*}_{I}=\frac{1+\gamma-\lambda\eta^{*}_{I}+\sqrt{\left(1+\gamma-\lambda\eta^{*}_{I}\right)^{2}-4\gamma}}{2}, η~0=η0⋅(α0∗)−1=η0∗⋅(α0∗)−1\widetilde{\eta}_{0}=\eta_{0}\cdot(\alpha_{0}^{*})^{-1}=\eta^{*}_{0}\cdot(\alpha_{0}^{*})^{-1}.

2 Better Exponential LR Schedule with Cosine LR

We applied the TEXP LR schedule (Theorem 2.12) on the Cosine LR schedule (Loshchilov & Hutter, 2016), where the learning rate changes every epoch, and thus correction terms cannot be ignored. The LR at epoch t≤Tt\leq T is defined as: ηt=η01+cos⁡(tTπ)2\eta_{t}=\eta_{0}\frac{1+\cos(\frac{t}{T}\pi)}{2}. Our experiments show this hybrid schedule with Cosine LR performs better on CIFAR10 than Step Decay, but this finding needs to be verified on other datasets.

Conclusions

The paper shows rigorously how BN allows a host of very exotic learning rate schedules in deep learning, and verifies these effects in experiments. The lr increases exponentially in almost every iteration during training. The exponential increase derives from use of weight decay, but the precise expression involves momentum as well. We suggest that the efficacy of this rule may be hard to explain with canonical frameworks in optimization.

Our analyses of BN is a substantial improvement over earlier theoretical analyses, since it accounts for weight decay and momentum, which are always combined in practice.

Our tantalising experiments with a hybrid of exponential and cosine rates suggest that more surprises may lie out there. Our theoretical analysis of interrelatedness of hyperparameters could also lead to faster hyperparameter search.

References

Appendix A Omitted Proofs

Suppose z1,z2(z1≥z2)z^{1},z^{2}(z^{1}\geq z^{2}) are the two real roots of the the following equation, we have

z1=1+γ−λη+(1−γ)2−2(1+γ)λη+λ2η22, z2=1+γ−λη−(1−γ)2−2(1+γ)λη+λ2η22z^{1}=\frac{1+\gamma-\lambda\eta+\sqrt{(1-\gamma)^{2}-2(1+\gamma)\lambda\eta+\lambda^{2}\eta^{2}}}{2},\ z^{2}=\frac{1+\gamma-\lambda\eta-\sqrt{(1-\gamma)^{2}-2(1+\gamma)\lambda\eta+\lambda^{2}\eta^{2}}}{2}

z1,z2z^{1},z^{2} are real ⟺λη≤(1−γ)2\Longleftrightarrow\lambda\eta\leq(1-\sqrt{\gamma})^{2};

z1z2=γ,z1+z2=(1+γ−λη)z^{1}z^{2}=\gamma,z^{1}+z^{2}=(1+\gamma-\lambda\eta);

Let t=λη1−γt=\frac{\lambda\eta}{1-\gamma}, we have z1≥11+t≥1−t=1−λη1−γz^{1}\geq\frac{1}{1+t}\geq 1-t=1-\frac{\lambda\eta}{1-\gamma}.

if we view z1(λη),z2(λη)z^{1}(\lambda\eta),z^{2}(\lambda\eta) as functions of λη\lambda\eta, then z1(λη)z^{1}(\lambda\eta) is monotone decreasing, z2(η)z^{2}(\eta) is monotone increasing.

Let f(x)=x2−(1+γ−λη)x+γf(x)=x^{2}-(1+\gamma-\lambda\eta)x+\gamma, we have f(1)=f(γ)=λη≥0f(1)=f(\gamma)=\lambda\eta\geq 0. Note the minimum of ff is taken at x=1+γ−λη2∈x=\frac{1+\gamma-\lambda\eta}{2}\in, the both roots of f(x)=0f(x)=0 must lie between and 11, if exists.

Note that (z1−z2)2=(z1+z2)2−4z1z2=(1+γ−λη)2−4γ(z^{1}-z^{2})^{2}=(z^{1}+z^{2})^{2}-4z^{1}z^{2}=(1+\gamma-\lambda\eta)^{2}-4\gamma is monotone decreasing, since z1(λη)+z2(λη)z^{1}(\lambda\eta)+z^{2}(\lambda\eta) is constant, z1(λη)≥z2(λη)z^{1}(\lambda\eta)\geq z^{2}(\lambda\eta), z1(λη)z^{1}(\lambda\eta) must be decreasing and z2(λη)z^{2}(\lambda\eta) must be increasing.

A.2 Omitted proofs in Section 2.1

A.3 Omitted proofs in Section 2.2

For any input (θ,η,θ′,η′)({\bm{\theta}},\eta,{\bm{\theta}}^{\prime},\eta^{\prime}), it’s easy to check both composed maps have the same outputs on the 2,3,4th coordinates, namely (c2η,cθ,c2η′)(c^{2}\eta,c{\bm{\theta}},c^{2}\eta^{\prime}). For the first coordinate, we have

For any input (θ,η,θ′,η′)({\bm{\theta}},\eta,{\bm{\theta}}^{\prime},\eta^{\prime}), it’s easy to check both composed maps have the same outputs on the 2,3,4th coordinates, namely (η,θ,η)(\eta,{\bm{\theta}},\eta). For the first coordinate, we have

A.4 Omitted proofs of Theorem 2.12

In this subsection we will prove a stronger version of Theorem 2.12(restated below), allowing the WD,λI\lambda_{I} changing each phase.

There exists a way to correct the momentum only at the first iteration of each phase, such that the following Tapered-Exponential LR schedule (TEXP) {η~t}\{\widetilde{\eta}_{t}\} with momentum factor γ\gamma and no WD, leads the same sequence networks in function space compared to that of Step Decay LR schedule(Definition 2.11) with momentum factor γ\gamma and phase-dependent WD λI∗\lambda^{*}_{I} in phase II, where phase II lasts from iteration TIT_{I} to iteration TI+1T_{I+1}, T0=0T_{0}=0.

where αI∗=1+γ−λI∗ηI∗+(1+γ−λI∗ηI∗)2−4γ2\alpha^{*}_{I}=\frac{1+\gamma-\lambda^{*}_{I}\eta^{*}_{I}+\sqrt{\left(1+\gamma-\lambda^{*}_{I}\eta^{*}_{I}\right)^{2}-4\gamma}}{2}, η~0=η0(α0∗)−1=η0∗(α0∗)−1\widetilde{\eta}_{0}=\eta_{0}(\alpha_{0}^{*})^{-1}=\eta^{*}_{0}(\alpha_{0}^{*})^{-1}.

Towards proving Theorem 2.12, we need the following lemma which holds by expanding the definition, and we omit its proof.

We define the Canonicalization map as N(θ,η,θ′,η′)=(θ,η,θ−ηη′(θ−θ′),η)N({\bm{\theta}},\eta,{\bm{\theta}}^{\prime},\eta^{\prime})=({\bm{\theta}},\eta,{\bm{\theta}}-\frac{\eta}{\eta^{\prime}}({\bm{\theta}}-{\bm{\theta}}^{\prime}),\eta), and it holds that

GDtρ∘N=GDtρ\textrm{GD}^{\rho}_{t}\circ N=\textrm{GD}^{\rho}_{t}, ∀ρ>0,t≥0\forall\rho>0,t\geq 0.

N∘[Π1c∘Π2c2∘Π3c∘Π4c2]=[Π1c∘Π2c2∘Π3c∘Π4c2]∘NN\circ\left[\Pi_{1}^{c}\circ\Pi_{2}^{c^{2}}\circ\Pi_{3}^{c}\circ\Pi_{4}^{c^{2}}\right]=\left[\Pi_{1}^{c}\circ\Pi_{2}^{c^{2}}\circ\Pi_{3}^{c}\circ\Pi_{4}^{c^{2}}\right]\circ N, ∀c>0\forall c>0.

Similar to the case of momentum-free SGD, we define the notion of equivalent map below

For two maps FF and GG, we say FF is equivalent to GG iff ∃c>0\exists c>0, F=[Π1c∘Π2c2∘Π3c∘Π4c2]∘GF=\left[\Pi_{1}^{c}\circ\Pi_{2}^{c^{2}}\circ\Pi_{3}^{c}\circ\Pi_{4}^{c^{2}}\right]\circ G, which is also denoted by F\mathrel{\overset{c}{\scalebox{1.5}[1.0]{\sim}}}G.

Note that for any (θ,η,θ′,η′)({\bm{\theta}},\eta,{\bm{\theta}}^{\prime},\eta^{\prime}), [N(θ,η,θ′,η′)]2=[N(θ,η,θ′,η′)]4\left[N({\bm{\theta}},\eta,{\bm{\theta}}^{\prime},\eta^{\prime})\right]_{2}=\left[N({\bm{\theta}},\eta,{\bm{\theta}}^{\prime},\eta^{\prime})\right]_{4}. Thus as a direct consequence of Lemma 2.8, the following lemma holds.

∀ρ,α>0\forall\rho,\alpha>0, \textrm{GD}^{\rho}_{t}\circ N\mathrel{\overset{\alpha}{\scalebox{1.5}[1.0]{\sim}}}\Pi_{3}^{\alpha^{-1}}\circ\Pi_{4}^{\alpha^{-1}}\circ\Pi_{2}^{\alpha^{-1}}\circ\textrm{GD}_{t}\circ\Pi_{2}^{\alpha^{-1}}\circ\Pi_{3}^{\alpha}\circ\Pi_{4}^{\alpha}\circ N.

Starting with initial state (θ0,η0,θ−1,η−1)({\bm{\theta}}_{0},\eta_{0},{\bm{\theta}}_{-1},\eta_{-1}) where η−1=η0\eta_{-1}=\eta_{0} and a given LR schedule {ηt}t≥0\{\eta_{t}\}_{t\geq 0}, the parameters generated by GD with WD and momentum satisfies the following relationship:

Define ◯t=abFt=Fb∘Fb−1∘…∘Fa\mathop{\bigcirc}\limits_{t=a}^{b}F_{t}=F_{b}\circ F_{b-1}\circ\ldots\circ F_{a}, for a≤ba\leq b. By Lemma A.3 and Lemma A.5, letting αt\alpha_{t} be the root of x2−(γ+1−ηt−1λt−1)x+γ=0x^{2}-(\gamma+1-\eta_{t-1}\lambda_{t-1})x+\gamma=0, we have

where \mathrel{\overset{\prod\limits_{i=0}^{T-1}\alpha_{i}}{\scalebox{2.5}[1.0]{\sim}}} is because of Lemma A.5, and HtH_{t} is defined as

Since the canonicalization map NN only changes the momentum part of the state, it’s easy to check that HtH_{t} doesn’t touch the current parameter θ{\bm{\theta}} and the current LR η\eta. Thus HtH_{t} only changes the momentum part of the input state. Now we claim that Ht∘GDt−1=GDt−1H_{t}\circ\textrm{GD}_{t-1}=\textrm{GD}_{t-1} whenever ηt=ηt−1\eta_{t}=\eta_{t-1}. This is because when ηt=ηt−1\eta_{t}=\eta_{t-1}, αt=αt+1\alpha_{t}=\alpha_{t+1} , thus Ht∘GDt−1=GDt−1H_{t}\circ\textrm{GD}_{t-1}=\textrm{GD}_{t-1}. In detail,

where =∗\overset{*}{=} is because GD update GDt\textrm{GD}_{t} sets η′\eta^{\prime} the same as η\eta, and thus ensures the input of NN has the same momentum factor in buffer as its current momentum factor, which makes NN an identity map.

Thus we could rewrite Equation 9 with a “sloppy”version of HtH_{t}, H^{\prime}_{t}=\begin{cases}H_{t}&\mbox{\eta_{t}\neq\eta_{t-1};}\\ Id&\mbox{o.w.}\end{cases}:

Now we construct the desired sequence of parameters achieved by using the Tapered Exp LR schedule 8 and the additional one-time momentum correction per phase. Let (θ~0,η~0,θ~−1,η~−1)=(θ0,η0,θ−1,η0)(\widetilde{{\bm{\theta}}}_{0},\widetilde{\eta}_{0},\widetilde{{\bm{\theta}}}_{-1},\widetilde{\eta}_{-1})=({\bm{\theta}}_{0},\eta_{0},{\bm{\theta}}_{-1},\eta_{0}), and

we claim {θ~t}t=0\{\widetilde{{\bm{\theta}}}_{t}\}_{t=0} is the desired sequence of parameters. We’ve already shown that {\bm{\theta}}_{t}\mathrel{\overset{}{\scalebox{1.5}[1.0]{\sim}}}\widetilde{{\bm{\theta}}}_{t},\ \forall t. Clearly {θ~t}t=0\{\widetilde{{\bm{\theta}}}_{t}\}_{t=0} is generated using only vanilla GD, scaling LR and modifying the momentum part of the state. When t≠TIt\neq T_{I} for any II, ηt=ηt−1\eta_{t}=\eta_{t-1} and thus Ht′=IdH^{\prime}_{t}=Id. Thus the modification on the momentum could only happen at TI(I≥0)T_{I}(I\geq 0). Also it’s easy to check that αt=αI∗\alpha_{t}=\alpha^{*}_{I}, if TI+1≤t≤TI+1T_{I}+1\leq t\leq T_{I+1}. ∎

A.5 Omitted proofs of Theorem 2.13

θt−θt−1ηt−1=γθt−1−θt−2ηt−2−∇θ((L(θt−1)+λt−12∥θt−1∥22)\frac{{\bm{\theta}}_{t}-{\bm{\theta}}_{t-1}}{\eta_{t-1}}=\gamma\frac{{\bm{\theta}}_{t-1}-{\bm{\theta}}_{t-2}}{\eta_{t-2}}-\nabla_{\bm{\theta}}\left((L({\bm{\theta}}_{t-1})+\frac{\lambda_{t-1}}{2}\|{\bm{\theta}}_{t-1}\|_{2}^{2}\right), for t=1,2,…t=1,2,\ldots;

θ~t−θ~t−1η~t−1=γθ~t−1−θ~t−2η~t−2−∇θL(θ~t−1)\frac{\widetilde{{\bm{\theta}}}_{t}-\widetilde{{\bm{\theta}}}_{t-1}}{\widetilde{\eta}_{t-1}}=\gamma\frac{\widetilde{{\bm{\theta}}}_{t-1}-\widetilde{{\bm{\theta}}}_{t-2}}{\widetilde{\eta}_{t-2}}-\nabla_{\bm{\theta}}L(\widetilde{{\bm{\theta}}}_{t-1}), for t=1,2,…t=1,2,\ldots,

where η~t=PtPt+1ηt\widetilde{\eta}_{t}=P_{t}P_{t+1}\eta_{t}, Pt=∏i=−1tαi−1P_{t}=\prod\limits_{i=-1}^{t}\alpha_{i}^{-1}, ∀t≥−1\forall t\geq-1 and αt\alpha_{t} recursively defined as

needs to be always positive. Here α0,α−1\alpha_{0},\alpha_{-1} are free parameters. Different choice of α0,α−1\alpha_{0},\alpha_{-1} would lead to different trajectory for {θ~t}\{\widetilde{{\bm{\theta}}}_{t}\}, but the equality that θ~t=Ptθt\widetilde{{\bm{\theta}}}_{t}=P_{t}{\bm{\theta}}_{t} is always satisfied. If the initial condition is given via v0{\bm{v}}_{0}, then it’s also free to choose η−1,θ−1\eta_{-1},{\bm{\theta}}_{-1}, as long as θ0−θ−1η−1=v0\frac{{\bm{\theta}}_{0}-{\bm{\theta}}_{-1}}{\eta_{-1}}={\bm{v}}_{0}.

We will prove by induction. By assumption S(t):Ptθt=θ~tS(t):P_{t}{\bm{\theta}}_{t}=\widetilde{{\bm{\theta}}}_{t} for t=−1,0t=-1,0. Now we will show that S(t)⟹S(t+1),∀t≥0S(t)\Longrightarrow S(t+1),\forall t\geq 0.

To conclude that Ptθt=θ~tP_{t}{\bm{\theta}}_{t}=\widetilde{{\bm{\theta}}}_{t}, it suffices to show that the coefficients before θ~t−1\widetilde{{\bm{\theta}}}_{t-1} is the same to that in (2)(2). In other words, we need to show

which is equivalent to the definition of αt\alpha_{t}, Equation 11.

Let λmax=max⁡tλt,ηmax=max⁡tηt\lambda_{max}=\max_{t}\lambda_{t},\eta_{max}=\max_{t}\eta_{t}. Define zminz_{min} is the larger root of the equation x2−(1+γ−λmaxηmax)x+γ=0x^{2}-(1+\gamma-\lambda_{max}\eta_{max})x+\gamma=0. To guarantee the existence of zmaxz_{max} we also assume ηmaxλmax≤(1−γ)2\eta_{max}\lambda_{max}\leq(1-\sqrt{\gamma})^{2}. Then we have

We will prove the above theorem with a strengthened induction —

First, since 0<αt≤10<\alpha_{t}\leq 1, αt+1=−ηtλt+1+ηtηt−1γ(1−αt−1)≤1.\alpha_{t+1}=-\eta_{t}\lambda_{t}+1+\frac{\eta_{t}}{\eta_{t-1}}\gamma(1-\alpha_{t}^{-1})\leq 1.

which shows αt+1≥zmin\alpha_{t+1}\geq z_{min}. Here the last step is by definition of zminz_{min}.

Because of αt+1≥zmin\alpha_{t+1}\geq z_{min}, we have

Now we are ready to give the formal statement about the closeness of Equation 8 and the reduced LR schedule by Theorem 2.13.

Given a Step Decay LR schedule with {TI}I=0K−1,{ηI∗}I=0K−1,{λI∗}I=0K−1\{T_{I}\}_{I=0}^{K-1},\{\eta^{*}_{I}\}_{I=0}^{K-1},\{\lambda^{*}_{I}\}_{I=0}^{K-1}, the TEXP++ LR schedule in Theorem 2.13 is the following(α0=α−1=1\alpha_{0}=\alpha_{-1}=1, T0=0T_{0}=0):

where zminz_{min} is the larger root of x2−(1+γ−λmaxηmax)x+γ=0x^{2}-(1+\gamma-\lambda_{max}\eta_{max})x+\gamma=0. In Appendix A, we show that zmin−1≤1+ηmaxλmax1−γz_{min}^{-1}\leq 1+\frac{\eta_{max}\lambda_{max}}{1-\gamma}. When λmaxηmax\lambda_{max}\eta_{max} is small compared to 1−γ1-\gamma, which is usually the case in practice, one could approximate zminz_{min} by 1. For example, when γ=0.9\gamma=0.9, λmax=0.0005\lambda_{max}=0.0005, ηmax=0.1\eta_{max}=0.1, the above upper bound becomes

Assuming zI1z_{I}^{1} and zI2z_{I}^{2}(zI1≥zI2z_{I}^{1}\geq z_{I}^{2}) are the roots of Equation 1 with η=ηI\eta=\eta_{I} and λ=λI\lambda=\lambda_{I}, we have γ≤zI′2≤γ≤zmin≤zI1≤1\gamma\leq z_{I^{\prime}}^{2}\leq\sqrt{\gamma}\leq z_{min}\leq z_{I}^{1}\leq 1, ∀I,I′∈[K−1]\forall I,I^{\prime}\in[K-1] by Lemma A.1.

We can rewrite the recursion in Theorem 2.13 as the following:

By Lemma A.7, we have αt≥zmin\alpha_{t}\geq z_{min}, ∀t≥0\forall t\geq 0. Thus ∣αtzI1−1∣=z2Iαt−1∣αt−1zI1−1∣≤γzmin2∣αt−1zI1−1∣=γzmin2∣αt−1zI1−1∣≤γ(1+λη1−γ)2∣αt−1zI1∣|\frac{\alpha_{t}}{z_{I}^{1}}-1|=\frac{z^{I}_{2}}{\alpha_{t-1}}|\frac{\alpha_{t-1}}{z_{I}^{1}}-1|\leq\frac{\gamma}{z^{2}_{min}}|\frac{\alpha_{t-1}}{z_{I}^{1}}-1|=\frac{\gamma}{z^{2}_{min}}|\frac{\alpha_{t-1}}{z_{I}^{1}}-1|\leq\gamma(1+\frac{\lambda\eta}{1-\gamma})^{2}|\frac{\alpha_{t-1}}{z_{I}^{1}}|, which means αt\alpha_{t} geometrically converges to its stable fixed point zI1z^{1}_{I}. and η~t−1η~t=(zI1)2\frac{\widetilde{\eta}_{t-1}}{\widetilde{\eta}_{t}}=(z_{I}^{1})^{2}. Since that zmin≤αt≤1z_{min}\leq\alpha_{t}\leq 1, zmin≤zI1≤1z_{min}\leq z_{I}^{1}\leq 1, we have ∣αTIzI1−1∣≤1−zminzmin=λmaxηmax1−γ≤1|\frac{\alpha_{T_{I}}}{z_{I}^{1}}-1|\leq\frac{1-z_{min}}{z_{min}}=\frac{\lambda_{max}\eta_{max}}{1-\gamma}\leq 1 , and thus ∣αtzI1−1∣≤λmaxηmax1−γ(γzmin2)t−TI−1≤1|\frac{\alpha_{t}}{z_{I}^{1}}-1|\leq\frac{\lambda_{max}\eta_{max}}{1-\gamma}(\frac{\gamma}{z_{min}^{2}})^{t-T_{I}-1}\leq 1, ∀TI+1≤t≤TI+1\forall T_{I}+1\leq t\leq T_{I+1}.

Note that αI∗=zI1\alpha^{*}_{I}=z^{1}_{I}, η^t−1η^t=αtαt+1\frac{\hat{\eta}_{t-1}}{\hat{\eta}_{t}}=\alpha_{t}\alpha_{t+1} By definition of TEXP and TEXP++, we have

When TI+1≤t≤TI+1T_{I}+1\leq t\leq T_{I+1}, we have

Thus we conclude ∀I∈[K−1],TI+1≤t≤TI+1\forall I\in[K-1],T_{I}+1\leq t\leq T_{I+1}, we have

A.6 Omitted Proofs in Section 3

We will use w^\hat{{\bm{w}}} to denote w∥w∥\frac{{\bm{w}}}{\|{\bm{w}}\|} and ∠uw\angle{\bm{u}}{\bm{w}} to arccos⁡(u^⊤w^)\arccos(\hat{{\bm{u}}}^{\top}\hat{{\bm{w}}}). Note that training error ≤επ\leq\frac{\varepsilon}{\pi} is equivalent to ∠e1wt<ε\angle{\bm{e}}_{1}{\bm{w}}_{t}<\varepsilon.

Since the objective is strongly convex, it has unique argmin w∗{\bm{w}}^{*}. By symmetry, w∗=βe1{\bm{w}}^{*}=\beta{\bm{e}}_{1}, for some β>0\beta>0. By KKT condition, we have

which implies ∥w∗∥=O(1λ)\|{\bm{w}}^{*}\|=O(\frac{1}{\lambda}).

Case 3: Both BN and WD

We will need the following lemma when lower bounding the norm of the stochastic gradient.

Suppose X1,…,Xk∼i.i.d.N(0,1)X_{1},\ldots,X_{k}\overset{\textrm{i.i.d.}}{\sim}{\mathcal{N}}(0,1), then

This Chernoff-bound based proof is a special case of Dasgupta & Gupta (2003).

Setting for Theorem A.6:

Suppose WD factor is λ\lambda, LR is η\eta, the width of the last layer is m≥3m\geq 3, Now the SGD updates have the form

where xt,b∼i.i.d.N(0,Im),yt,b=sign([xt,b]1){\bm{x}}_{t,b}\overset{\textrm{i.i.d.}}{\sim}{\mathcal{N}}(0,I_{m}),y_{t,b}=\textrm{sign}\left([x_{t,b}]_{1}\right), and Πwt⊥=I−wtwt⊤∥wt∥2\Pi^{\perp}_{{\bm{w}}_{t}}=I-\frac{{\bm{w}}_{t}{\bm{w}}_{t}^{\top}}{\|{\bm{w}}_{t}\|^{2}}.

Step 1: Let T1=12(ηλ−2ε2)ln⁡64∥wT0∥2εBηm−2T_{1}=\frac{1}{2(\eta\lambda-2\varepsilon^{2})}\ln\frac{64\|w_{T_{0}}\|^{2}\varepsilon\sqrt{B}}{\eta\sqrt{m-2}}, and T2=9ln⁡1δT_{2}=9\ln\frac{1}{\delta}. Thus if we assume the training error is smaller than ε\varepsilon from iteration T0T_{0} to T0+T1+T2T_{0}+T_{1}+T_{2}, then by spherical triangle inequality, ∠wtwt′≤∠e1wt′+∠e1wt=2ε\angle{\bm{w}}_{t}{\bm{w}}_{t^{\prime}}\leq\angle{\bm{e}}_{1}{\bm{w}}_{t^{\prime}}+\angle{\bm{e}}_{1}{\bm{w}}_{t}=2\varepsilon, for T0≤t,t′≤T0+T1+T2T_{0}\leq t,t^{\prime}\leq T_{0}+T_{1}+T_{2}.

Now let’s define wt′=(1−ηλ)wt{\bm{w}}^{\prime}_{t}=(1-\eta\lambda){\bm{w}}_{t} and for any vector w{\bm{w}}, and we have the following two relationships:

∥wt′∥=(1−ηλ)∥w∥\|{\bm{w}}^{\prime}_{t}\|=(1-\eta\lambda)\|{\bm{w}}\|.

∥wt+1∥≤∥wt′∥cos⁡2ε\|{\bm{w}}_{t+1}\|\leq\frac{\|{\bm{w}}^{\prime}_{t}\|}{\cos 2\varepsilon}.

The second property is because by Lemma 1.3, (wt+1−wt′)⊥wt′({\bm{w}}_{t+1}-{\bm{w}}^{\prime}_{t})\perp{\bm{w}}^{\prime}_{t} and by assumption of small error, ∠wt+1wt′≤2ε\angle{\bm{w}}_{t+1}{\bm{w}}^{\prime}_{t}\leq 2\varepsilon.

In other word, ∥wT0+T1∥2≤η64εm−2B\|{\bm{w}}_{T_{0}+T_{1}}\|^{2}\leq\frac{\eta}{64\varepsilon}\sqrt{\frac{m-2}{B}}. Since ∥wT0+t∥\|{\bm{w}}_{T_{0}+t}\| is monotone decreasing, ∥wT0+t∥2≤η64εm−2B\|{\bm{w}}_{T_{0}+t}\|^{2}\leq\frac{\eta}{64\varepsilon}\sqrt{\frac{m-2}{B}} holds for any t=T1,…,T1+T2t=T_{1},\ldots,T_{1}+T_{2}.

Step 2: We show that the norm of the stochastic gradient is lower bounded with constant probability. In other words, we want to show the norm of ξt=∑b=1Byt,b1+exp⁡(xt,b⊤wt∥wt∥yt,b)Πwt⊥xt,b∥wt∥{\bm{\xi}}_{t}=\sum_{b=1}^{B}\frac{y_{t,b}}{1+\exp({{\bm{x}}_{t,b}}^{\top}\frac{{\bm{w}}_{t}}{\|{\bm{w}}_{t}\|}y_{t,b})}\frac{\Pi^{\perp}_{{\bm{w}}_{t}}{\bm{x}}_{t,b}}{\|{\bm{w}}_{t}\|} is lower bounded with high probability.

Let Πwt,e1⊥\Pi^{\perp}_{{\bm{w}}_{t},{\bm{e}}_{1}} be the projection matrix for the orthogonal space spanned by wt{\bm{w}}_{t} and e1{\bm{e}}_{1}. W.L.O.G, we can assume the rank of Πwt,e1⊥\Pi^{\perp}_{{\bm{w}}_{t},{\bm{e}}_{1}} is 2. In case wt=e1{\bm{w}}_{t}={\bm{e}}_{1}, we just exclude a random direction to make Πwt,e1⊥\Pi^{\perp}_{{\bm{w}}_{t},{\bm{e}}_{1}} rank 2. Now we have Πwt,e1⊥xt,b\Pi^{\perp}_{{\bm{w}}_{t},{\bm{e}}_{1}}{\bm{x}}_{t,b} are still i.i.d. multivariate gaussian random variables, for b=1,…,Bb=1,\ldots,B, and moreover, Πwt,e1⊥xt,b\Pi^{\perp}_{{\bm{w}}_{t},{\bm{e}}_{1}}{\bm{x}}_{t,b} is independent to yt,b1+exp⁡(xt,b⊤wt∥wt∥yt,b)\frac{y_{t,b}}{1+\exp({{\bm{x}}_{t,b}}^{\top}\frac{{\bm{w}}_{t}}{\|{\bm{w}}_{t}\|}y_{t,b})}. When m≥3m\geq 3, we can lower bound ∥ξt∥\|{\bm{\xi}}_{t}\| by dealing with ∥Πwt,e1⊥ξt∥\|\Pi^{\perp}_{{\bm{w}}_{t},{\bm{e}}_{1}}{\bm{\xi}}_{t}\|.

It’s not hard to show that conditioned on {xt,b⊤wt∥wt∥,[xt,b]1}b=1B\{{{\bm{x}}_{t,b}}^{\top}\frac{{\bm{w}}_{t}}{\|{\bm{w}}_{t}\|},[{\bm{x}}_{t,b}]_{1}\}_{b=1}^{B},

where x∼N(0,Im){\bm{x}}\sim{\mathcal{N}}(\bm{0},I_{m}). We further note that ∥Πwt,e1⊥x∥2∼χ2(m−2)\|\Pi^{\perp}_{{\bm{w}}_{t},{\bm{e}}_{1}}{\bm{x}}\|^{2}\sim\chi^{2}(m-2). By Lemma A.9,

Now we will give a high probability lower bound for ∑b=1B(yt,b1+exp⁡(xt,b⊤wt∥wt∥yt,b))2\sum_{b=1}^{B}\left(\frac{y_{t,b}}{1+\exp({{\bm{x}}_{t,b}}^{\top}\frac{{\bm{w}}_{t}}{\|{\bm{w}}_{t}\|}y_{t,b})}\right)^{2}. Note that xt⊤wt∥wt∥∼N(0,1){\bm{x}}_{t}^{\top}\frac{{\bm{w}}_{t}}{\|{\bm{w}}_{t}\|}\sim{\mathcal{N}}(0,1), we have

which implies the following, where At,bA_{t,b} is defined as \mathds1[∣xt,b⊤wt∥wt∥∣<1≥12]\mathds{1}\left[|{\bm{x}}_{t,b}^{\top}\frac{{\bm{w}}_{t}}{\|{\bm{w}}_{t}\|}|<1\geq\frac{1}{2}\right]:

Thus w.p. at least 19\frac{1}{9}, equation 24 and equation 21 happen together, which implies

Step 3. To stay in the cone {w∣∠we1≤ε}\{{\bm{w}}|\angle{\bm{w}}{\bm{e}}_{1}\leq\varepsilon\}, the SGD update ∥wt+1−wt′∥=∥ηB∑b=1B∇ln⁡(1+exp⁡(−xt,b⊤wt∥wt∥yt,b))∥\|{\bm{w}}_{t+1}-{\bm{w}}^{\prime}_{t}\|=\|\frac{\eta}{B}\sum_{b=1}^{B}\nabla\ln(1+\exp(-{\bm{x}}_{t,b}^{\top}\frac{{\bm{w}}_{t}}{\|{\bm{w}}_{t}\|}y_{t,b}))\| has to be smaller than ∥wt∥sin⁡2ε\|{\bm{w}}_{t}\|\sin 2\varepsilon for any t=T0+T1,…,T0+T1+T2t=T_{0}+T_{1},\ldots,T_{0}+T_{1}+T_{2}. However, step 1 and 2 together show that ∥∇ln⁡(1+exp⁡(−xt⊤wt∥wt∥yt))∥≥2∥wt∥ε\|\nabla\ln(1+\exp(-{\bm{x}}_{t}^{\top}\frac{{\bm{w}}_{t}}{\|{\bm{w}}_{t}\|}y_{t}))\|\geq 2\|{\bm{w}}_{t}\|\varepsilon w.p. 19\frac{1}{9} per iteration. Thus the probability that wt{\bm{w}}_{t} always stays in the cone for every t=T0+T1,…,T0+T1+T2t=T_{0}+T_{1},\ldots,T_{0}+T_{1}+T_{2} is less than (89)T2≤δ\left(\frac{8}{9}\right)^{T_{2}}\leq{\delta}. ∎

It’s interesting that the only property of the global minimum we use is that the if both wt{\bm{w}}_{t}, wt+1{\bm{w}}_{t+1} are ε−\varepsilon-optimal, then the angle between wt{\bm{w}}_{t} and wt+1{\bm{w}}_{t+1} is at most 2ε2\varepsilon. Thus we indeed have proved a stronger statement: At least once in every 12(ηλ−2ε2)ln⁡64∥wT0∥2εBηm−2+9ln⁡1δ\frac{1}{2(\eta\lambda-2\varepsilon^{2})}\ln\frac{64\|w_{T_{0}}\|^{2}\varepsilon\sqrt{B}}{\eta\sqrt{m-2}}+9\ln\frac{1}{\delta} iterations, the angle between wt{\bm{w}}_{t} and wt+1{\bm{w}}_{t+1} will be larger than 2ϵ2\epsilon. In other words, if the the amount of the update stabilizes to some direction in terms of angle, then the fluctuation in terms of angle must be larger than 2ηλ\sqrt{2\eta\lambda} for this simple model, no matter how small the noise is.

A.7 Omitted Proofs in Section 4

Suppose loss LL is scale invariant, then LL is non-convex in the following two sense:

The domain is non-convex: scale invariant loss can’t be defined at origin;

There exists no ball containing origin such that the loss is locally convex, unless the loss is constant function.

Suppose L(θ∗)=sup⁡θ∈BL(θ)L({\bm{\theta}}^{*})=\sup_{{\bm{\theta}}\in B}L({\bm{\theta}}). W.L.O.G, we assume ∥θ∗∥<1\|{\bm{\theta}}^{*}\|<1. By convexity, every line segment passing θ∗{\bm{\theta}}^{*} must have constant loss, which implies the loss is constant over set B−{cθ∗∥θ∗∥∣−1≤c≤0}{\mathcal{B}}-\{c\frac{{\bm{\theta}}^{*}}{\|{\bm{\theta}}^{*}\|}\mid-1\leq c\leq 0\}. Applying the above argument on any other maximum point θ′{\bm{\theta}}^{\prime} implies the loss is constant over B−{0}{\mathcal{B}}-\{\bm{0}\}. ∎

Suppose the momentum factor γ=0\gamma=0, LR ηt=η\eta_{t}=\eta is constant, and the loss function LL is lower bounded. If ∃c>0\exists c>0 and T≥0T\geq 0 such that ∀t≥T\forall t\geq T, f(θt+1)−f(θt)≤−cη∥∇L(θt)∥2f({\bm{\theta}}_{t+1})-f({\bm{\theta}}_{t})\leq-c\eta\|\nabla L({\bm{\theta}}_{t})\|^{2}, then lim⁡t→∞∥θt∥=0\lim_{t\to\infty}\|{\bm{\theta}}_{t}\|=0.

By Lemma 1.3 and the update rule of GD with WD, we have

Note that by assumption we have ∑t=TT′−1∥∇L(θt)∥2=1cηf(θT)−f(θT′)\sum_{t=T}^{T^{\prime}-1}\|\nabla L({\bm{\theta}}_{t})\|^{2}=\frac{1}{c\eta}f({\bm{\theta}}_{T})-f({\bm{\theta}}_{T^{\prime}}).

As a conclusion, we have ∑t=T∞∥θt∥2≤f(θT)−min⁡θf(θ)cη2λ+∥θT∥2λη\sum_{t=T}^{\infty}\|{\bm{\theta}}_{t}\|^{2}\leq\frac{f({\bm{\theta}}_{T})-\min_{{\bm{\theta}}}f({\bm{\theta}})}{c\eta^{2}\lambda}+\frac{\|{\bm{\theta}}_{T}\|^{2}}{\lambda\eta}, which implies lim⁡t→∞∥θt∥2=0\lim\limits_{t\to\infty}\|{\bm{\theta}}_{t}\|^{2}=0. ∎

Appendix B Other Results

Now we rigorously analyze norm growth in this algorithm. This greatly extends previous analyses of effect of normalization schemes (Wu et al., 2018; Arora et al., 2018) for vanilla SGD.

Under the update rule 1.2 with λt=0\lambda_{t}=0, the norm of scale invariant parameter θt{\bm{\theta}}_{t} satisfies the following property:

Almost Monotone Increasing: ∥θt+1∥2−∥θt∥2≥−γt+1ηtη0(∥θ0∥2−∥θ−1∥2)\|{\bm{\theta}}_{t+1}\|^{2}-\|{\bm{\theta}}_{t}\|^{2}\geq-\gamma^{t+1}\frac{\eta_{t}}{\eta_{0}}(\|{\bm{\theta}}_{0}\|^{2}-\|{\bm{\theta}}_{-1}\|^{2}).

Assuming ηt=η\eta_{t}=\eta is a constant, then

Let’s use Rt,Dt,CtR_{t},D_{t},C_{t} to denote ∥θt∥2,∥θt+1−θt∥2,θt⊤(θt+1−θt)\|{\bm{\theta}}_{t}\|^{2},\|{\bm{\theta}}_{t+1}-{\bm{\theta}}_{t}\|^{2},{\bm{\theta}}_{t}^{\top}({\bm{\theta}}_{t+1}-{\bm{\theta}}_{t}) respectively.

The only property we will use about loss is ∇θLt⊤θt=0\nabla_{\bm{\theta}}L_{t}^{\top}{\bm{\theta}}_{t}=0.

Expanding the square of ∥θt+1∥2=∥(θt+1−θt)+θt∥2\|{\bm{\theta}}_{t+1}\|^{2}=\|({\bm{\theta}}_{t+1}-{\bm{\theta}}_{t})+{\bm{\theta}}_{t}\|^{2}, we have

Simplify S(t)ηt−γS(t−1)ηt−1+P(t)\frac{S(t)}{\eta_{t}}-\frac{\gamma S(t-1)}{\eta_{t-1}}+P(t), we have

Further if ηt=η\eta_{t}=\eta is a constant, we have

which covers the result without momentum in (Arora et al., 2019) as a special case:

For general deep nets, we have the following result, suggesting that the mean square of the update are constant compared to the mean square of the norm. The constant is mainly determined by ηλ\eta\lambda, explaining why the usage of weight decay prevents the parameters to converge in direction. (Page, ) had a similar argument for this phenomenon by connecting this to the LARS(You et al., 2017), though it’s not rigorous in the way it deals with momentum and equilibrium of norm.

For SGD with constant LR η\eta, weight decay λ\lambda and momentum γ\gamma, when the limits R∞=lim⁡T→∞1T∑t=0T−1∥wt∥2R_{\infty}=\lim_{T\to\infty}\frac{1}{T}\sum_{t=0}^{T-1}\|{\bm{w}}_{t}\|^{2}, D∞=lim⁡T→∞1T∑t=0T−1∥wt+1−wt∥2D_{\infty}=\lim_{T\to\infty}\frac{1}{T}{\sum_{t=0}^{T-1}\|{\bm{w}}_{t+1}-{\bm{w}}_{t}\|^{2}} exist, we have

Take average of Equation 26 over tt, when the limits R∞=lim⁡T→∞1T∑t=0T−1∥wt∥2R_{\infty}=\lim_{T\to\infty}\frac{1}{T}\sum_{t=0}^{T-1}\|{\bm{w}}_{t}\|^{2}, D∞=lim⁡T→∞1T∑t=0T−1∥wt+1−wt∥2D_{\infty}=\lim_{T\to\infty}\frac{1}{T}{\sum_{t=0}^{T-1}\|{\bm{w}}_{t+1}-{\bm{w}}_{t}\|^{2}} exists, we have

Appendix C Scale Invariance in Modern Network Architectures

In this section, we will discuss how Normalization layers make the output of the network scale-invariant to its parameters. Viewing a neural network as a DAG, we give a sufficient condition for the scale invariance which could be checked easily by topological order, and apply this on several standard network architectures such as Fully Connected(FC) Networks, Plain CNN, ResNet(He et al., 2016a), and PreResNet(He et al., 2016b). For simplicity, we restrict our discussions among networks with ReLU activation only. Throughout this section, we assume the linear layers and the bias after last normalization layer are fixed to its random initialization, which doesn’t harm the performance of the network empirically(Hoffer et al., 2018b).

Suppose kk is an integer and θ{\bm{\theta}} is all the parameters of the network, then ff is said to be homogeneous of degree kk, or kk-homogeneous, if ∀c>0\forall c>0, f(cθ)=ckf(θ)f(c{\bm{\theta}})=c^{k}f({\bm{\theta}}). The output of ff can be multi-dimensional. Specifically, scale invariance means degree of homogeneity is 0.

Suppose the network only contains following modules, and we list the degree of homogeneity of these basic modules, given the degree of homogeneity of its input.

Linear Layer, e.g. Convolutional Layer or Fully Connected Layer

Bias Layer(Adding Trainable Bias to the output of the previous layer)

Addition Layer (adding the outputs of two layers with the same dimension Addition Layer(+) is mainly used in ResNet and other similar architectures. In this section, we also use it as an alternative definition of Bias Layer(B). See Figure 7.)

Normalization Layer without affine transformation(including BN, GN, LN, IN etc.)

Normalization Layer with affine transformation

For the purpose of deciding the degree of homogeneity of a network, there’s no difference among convolutional layers, fully connected layer and the diagonal linear layer in the affine transformation of Normalization layer, since they’re all linear and the degree of homogeneity is increased by 1 after applying them.

On the other hand, BN and IN has some benefit which GN and LN doesn’t have, namely the bias term (per channel) immediately before BN or IN has zero effect on the network output and thus can be removed. (See Figure 15)

We also demonstrate the homogeneity of the output of the modules via the following figures, which will be reused to later to define network architectures.

For a network only consisting of modules defined above and ReLU activation, we can view it as a Directed acyclic graph and check its scale invariance by the following algorithm.

C.2 Networks without Affine Transformation and Bias

We start with the simple cases where all bias term(including that of linear layer and normalization layer) and the scaling term of normalization layer are fixed to be 0 and 1 element-wise respectively, which means the bias and the scaling could be dropped from the network structure. We empirically find this doesn’t affect the performance of network in a noticeable way. We will discuss the full case in the next subsection.

ResNet:

See Figure 10. To ensure the scaling invariance, we add an additional normalizaiton layer in the shortcut after downsampling. This implementation is sometimes used in practice and doesn’t affect the performance in a noticeable way.

Preactivation ResNet:

See Figure 11. Preactivation means to change the order between convolutional layer and normalization layer. For similar reason, we add an additional normalizaiton layer in the shortcut before downsampling.

C.3 Networks with Affine Transformation

Now we discuss the full case where the affine transformation part of normalization layer is trainable. Due to the reason that the bias of linear layer (before BN) has 0 gradient as we mentioned in C.2, the bias term is usually dropped from network architecture in practice to save memory and accelerate training( even with other normalization methods)(See PyTorch Implementation (Paszke et al., 2017)). However, when LN or GN is used, and the bias term of linear layer is trainable, the network could be scale variant (See Figure 15).

ResNet:

See Figure 13. To ensure the scaling invariance, we add an additional normalizaiton layer in the shortcut after downsampling. This implementation is sometimes used in practice and doesn’t affect the performance in a noticeable way.

Preactivation ResNet:

See Figure 14. Preactivation means to change the order between convolutional layer and normalization layer. For similar reason, we add an additional normalizaiton layer in the shortcut before downsampling.