The large learning rate phase of deep learning: the catapult mechanism

Aitor Lewkowycz, Yasaman Bahri, Ethan Dyer, Jascha Sohl-Dickstein, Guy Gur-Ari

Introduction

Deep learning has shown remarkable success across a variety of machine learning tasks. At the same time, our theoretical understanding of deep learning methods remains limited. In particular, the interplay between training dynamics, properties of the learned network, and generalization remains a largely open problem.

In this work we take a step toward addressing these questions. We present a dynamical mechanism that allows deep networks trained using SGD to find flat minima and achieve superior performance. Our theoretical predictions agree well with empirical results in a variety of deep learning settings. In many cases we are able to predict the regime of learning rates where optimal performance is achieved. Figure 1 summarizes our main results. This work builds on several existing results, which we now review.

SGD training with large initial learning rates often leads to improved performance over training with small initial learning rates (see Li et al. (2019); Leclerc & Madry (2020); Xie et al. (2020); Frankle et al. (2020); Jastrzebski et al. (2020) for recent discussions). It has been suggested that one of the mechanisms underlying the benefit of large learning rates is that noise from stochastic gradient descent leads to flat minima, and that flat minima generalize better than sharp minima (Hochreiter & Schmidhuber, 1997; Keskar et al., 2016; Smith & Le, 2018; Jiang et al., 2020; Park et al., 2019) (though see Dinh et al. (2017) for discussion of some caveats). According to this suggestion, training with a large learning rate (or with a small batch size) can improve performance because it leads to more stochasticity during training (Mandt et al., 2017; Smith et al., 2017; Smith & Le, 2018; Smith et al., 2018).

We will develop a connection between large learning rate and flatness of minima in models trained via SGD. Unlike the relationship explored in most previous work though, this connection is not driven by SGD noise, but arises solely as a result of training with a large initial learning rate, and holds even for full batch gradient descent.

2 The existing theory of infinite width networks is insufficient to describe large learning rates

A recent body of work has investigated the gradient descent dynamics of deep networks in the limit of infinite width (Daniely, 2017; Jacot et al., 2018; Lee et al., 2019; Du et al., 2019; Zou et al., 2018; Allen-Zhu et al., 2019; Li & Liang, 2018; Chizat et al., 2019; Mei et al., 2018; Rotskoff & Vanden-Eijnden, 2018; Sirignano & Spiliopoulos, 2018; Woodworth et al., 2019; Naveh et al., ). Of particular relevance is the work by Jacot et al. (2018) showing that gradient flow in the space of functions is governed by a dynamical quantity called the Neural Tangent Kernel (NTK) which is fixed at its initial value in this limit. Lee et al. (2019) showed this result is equivalent to training the linearization of a model around its initialization in parameter space. Finally, moving away from the strict limit of infinite width by working perturbatively, Dyer & Gur-Ari (2020); Huang & Yau (2019) introduced an approach to computing the finite-width corrections to network evolution.

Despite this progress, it seems these results are insufficient to capture the full dynamics of deep networks, as well as their superior performance, in regimes applicable to practice. Prior work has focused on comparisons between various infinite-width kernels associated with deep networks and their finite-width, SGD-trained counterparts (Lee et al., 2018; Novak et al., 2019; Arora et al., 2019). Specific findings vary depending on precise choices for architecture and hyperparameters. However, dramatic performance gaps are consistently observed between non-linear CNNs and their limiting kernels, implying that the theory is not sufficient to explain the performance of deep networks in this realistic setup. Furthermore, some hyperparameter settings in finite-width models have no known analogue in the infinite width limit, and it is these settings that often lead to optimal performance.

In particular, finite width networks are often trained with large learning rates that would cause divergence for infinite width linearized models. Further, these large learning rates cause finite width networks to converge to flat minima. For infinite width linearized models, trained with MSE loss, all minima have the same curvature, and the notion of flat minima does not apply. We argue that the reduction in curvature during optimization, and support for learning rates that are infeasible for infinite width linearized models, may thus partially explain performance gaps observed between linear and non-linear models.

3 Our contribution: three learning rate regimes

In this work, we identify a dynamical mechanism which enables finite-width networks to stably access large learning rates. We show that this mechanism causes training to converge to flatter minima and is associated with improved generalization. We further show that this same mechanism can describe the behavior of infinite width networks, if training time is increased along with network width.

This new mechanism enables a characterization of gradient descent training in terms of three learning rate regimes, or phases: the lazy phase, the catapult phase, and the divergent phase. In Section 2 we analytically derive the behavior in these three learning rate regimes for one hidden layer linear networks with large but finite width, trained with MSE loss. We confirm experimentally in Section 3 that these phases also apply to deep nonlinear fully- connected, convolutional, and residual architectures. In Section 4 we study additional predictions of the analytic solution.

We now summarize all three phases, using η\eta to indicate the learning rate, and λ0\lambda_{0} to indicate the initial curvature (defined precisely in Section 2.1). The phase is determined by the curvature at initialization and by the learning rate, despite the fact that the curvature may change significantly during training. Based on the experimental evidence we expect the behavior described below to apply in typical deep learning settings, when training sufficiently wide networks using SGD.

For sufficiently small learning rate, the curvature λt\lambda_{t} at training step tt remains constant during the initial part of training. The model behaves (loosely) as a model linearized about its initial parameters (Lee et al., 2019); this becomes exact in the infinite width limit, where these dynamics are sometimes called lazy training (Jacot et al., 2018; Lee et al., 2019; Du et al., 2019; Li & Liang, 2018; Zou et al., 2018; Allen-Zhu et al., 2019; Chizat et al., 2019; Dyer & Gur-Ari, 2020). For a discussion of trainability and the connection to the NTK in the lazy phase see Xiao et al. (2019).

In this phase, the curvature at initialization is too high for training to converge to a nearby point, and the linear approximation quickly breaks down. Optimization begins with a period of exponential growth in the loss, coupled with a rapid decrease in curvature, until curvature stabilizes at a value λfinal<2/η\lambda_{\rm final}<2/\eta. Once the curvature drops below 2/η2/\eta, training converges, ultimately reaching a minimum that is flatter than those found in the lazy phase. This initial period lasts for a number of training steps that is of order log⁡(n)\log(n), where nn is the network width, and is therefore quite short for realistic networks (often lasting less than a single epoch). Optimal performance is often achieved when the initial learning rate is in this range. The gradient descent dynamics in this phase are visualized in SM Figure S1 and in Figure 1.

When the learning rate is above the maximum learning rate of the model, the loss diverges and the model does not train.

Theoretical results

We now present our main theoretical result, an analysis of gradient descent dynamics for a neural network with large but finite width.

We denote by λ\lambda the maximum eigenvalue of the kernel. In large width models, λ\lambda provides a local measure of the loss landscape curvature that is similar to the top eigenvalue of the Hessian (Dyer & Gur-Ari, 2020).

In this section, we will consider a network with one hidden layer and linear activations, where the network function ff is given by

Next, consider the update equations in function space. These can be written in terms of the Neural Tangent Kernel. For this model, the kernel evaluated on the training set is a scalar which is equal to λ\lambda, its top eigenvalue, and is given by

At initialization, both f2f^{2} and λ\lambda scale as n0=1n^{0}=1 with width. The following update equations for ff and λ\lambda at step tt can be derived from (4).

Taking the strict infinite width limit, equations (6) and (7) become

When η<ηcrit\eta<\eta_{\rm crit}, λ\lambda remains constant throughout training. This is a special case of NTK dynamics, where the kernel is constant and the network evolves as a linear model (Lee et al., 2019). The function and the loss both shrink to zero because the multiplicative factor obeys ∣1−ηλt∣<1|1-\eta\lambda_{t}|<1. This convergence happens in O(n0)=O(1)\mathcal{O}(n^{0})=\mathcal{O}(1) steps.

1.2 Catapult phase

When ηcrit<η<ηmax\eta_{\rm crit}<\eta<\eta_{\rm max}, the loss diverges in the infinite width limit. Indeed, from (8) we see that the kernel is constant in the limit, while ff receives multiplicative updates where ∣1−ηλt∣>1|1-\eta\lambda_{t}|>1. This is the well known instability of gradient descent dynamics for linear models with MSE loss. However, the underlying model is not linear in its parameters, and finite width contributions turn out to be important. We therefore relax the infinite width limit and analyze equations (6,7) for large but finite width, n≫1n\gg 1.

First, note that ηλ0−4<0\eta\lambda_{0}-4<0 by assumption, and therefore the (additive) kernel updates are negative for all tt. During early training, ∣ft∣|f_{t}| grows (as in the infinite width limit) while λt\lambda_{t} remains constant up to small O(n−1)\mathcal{O}(n^{-1}) updates. After t∼log⁡(n)t\sim\log(n) steps, ∣ft∣|f_{t}| grows to order n1/2n^{1/2}. At this point, the kernel updates are no longer negligible because ft2/nf_{t}^{2}/n is of order n0n^{0}. The kernel λt\lambda_{t} receives negative, non-negligible updates while both ftf_{t} and the loss continue to grow (for now, we ignore the term in (6) with an explicit 1/n1/n dependence). This continues until the kernel is sufficiently small that the condition ηλt≲2\eta\lambda_{t}\lesssim 2 is met.The bound is not exact because of the term we neglected. We call this curvature-reduction effect the catapult effect. Beyond this point, ∣1−ηλt∣<1|1-\eta\lambda_{t}|<1 holds, ∣ft∣|f_{t}| shrinks, and the loss converges to a global minimum. The nn dependence of the steps until optimization converges is log⁡(n)\log{(n)}.

It remains to show that the term in (6) with an explicit n−1n^{-1} dependence does not affect these conclusions. Once ∣ft∣|f_{t}| grows to order n1/2n^{1/2}, this term is no longer negligible and can cause the multiplicative factor in front of ftf_{t} to become smaller than 1 in absolute value, causing ∣ft∣|f_{t}| to start shrinking. However, once ∣ft∣|f_{t}| shrinks sufficiently this term again becomes negligible. Therefore, the loss will not converge to zero unless the curvature eventually drops below 2/η2/\eta. Conversely, notice that this term cannot cause ∣ft∣|f_{t}| to diverge for learning rates below ηmax\eta_{\rm max}. Indeed, if this were to happen then equation (7) would drive λt\lambda_{t} to negative values, leading to a contradiction. This completes the analysis in this phase.

Let us make a few comments about the catapult phase.

It is important for the analysis that we take a modified large width limit, in which the number of training steps grows like log⁡(n)\log(n) as nn becomes large. This is different than the large width limit commonly studied in the literature, in which the number of steps is kept fixed as the width is taken large. When using this modified limit, the analysis above holds even in the limit. Note as well that the catapult effect takes place over log⁡(n)\log(n) steps, and for practical networks will occur within the first 100 steps or so of training.

In the catapult phase, the kernel at the end of training is smaller by an order n0n^{0} amount compared with its value at initialization. The kernel provides a local measure of the loss curvature. Therefore, the minima that SGD finds in the catapult phase are flatter than those it finds in the lazy phase. Contrast this situation, in which the kernel receives non-negligible updates, with the conclusions of Jacot et al. (2018) where the kernel is constant throughout training. The difference is due to the large learning rate, which leads to a breakdown of the linearized approximation even at large width.

Figure 2 illustrates the dynamics in the catapult phase. For learning rates ηcrit<η<ηmax\eta_{\rm crit}<\eta<\eta_{\rm max} we observe the catapult effect: the loss goes up before converging to zero. The curvature exhibits the expected sharp transitions as a function of the learning rate: it is constant in the lazy phase, decreases in the catapult phase, and diverges for η>ηmax\eta>\eta_{\rm max}.

1.3 Divergent phase

Completing the analysis of this model, when η>ηmax\eta>\eta_{\rm max} the loss diverges because the kernel receives positive updates, accelerating the rate of growth of the function. Therefore, ηmax=4/λ0\eta_{\rm max}=4/\lambda_{0} is the maximum learning rate of the model.

2 Full model

We now turn to analyzing the model presented at the beginning of this section, with dd-dimensional inputs and mm training samples with general labels. The full analysis is presented in SM Section D.1; here we summarize the argument. The conclusions are essentially the same as those of the warmup model.

Experimental results

In this section we test the extent to which the behavior of our theoretical model describes the dynamics of deep networks in practical settings. The theoretical results of Section 2, describing distinct learning rate phases, are not guaranteed to hold beyond the model analyzed there. We treat these results as predictions to be tested empirically, including the values ηcrit\eta_{\rm crit} and ηmax\eta_{\rm max} of the learning rates that separate the three phases.

In a variety of deep learning settings, we find clear evidence of the different phases predicted by the model. The experiments all use MSE loss, sufficiently wide networks, and SGDWhile our theoretical framework focused on (full-batch) gradient descent, we expect these the phases to happen at similar points for SGD as long as evolution is not noise dominated, in which case we expect all phases to be shifted towards smaller learning rates.. Parameters such as network architecture, choice of non-linearity, weight parameterization, and regularization, do not significantly affect this conclusion.

Building on the observed correlation between lower curvature and generalization performance (Keskar et al., 2016; Jiang et al., 2020), we conjecture that optimal performance occurs in the large learning rate (catapult) phase, where the loss converges to a flatter minimum. For a fixed amount of computational budget, we find that this conjecture holds in all cases we tried. Even when comparing different learning rates trained for a fixed amount of physical time tphys=t⋅ηt_{\rm phys}=t\cdot\eta, we find that performance of models trained in the catapult phase either matches or exceeds that of models trained in the lazy phase.

Our theoretical model makes detailed predictions for the gradient descent evolution of λ\lambda, the top eigenvalue of the NTK. Here we test these predictions against empirical results in a variety of deep learning models (see the Supplement for additional experimental results).

Figure 3 shows λ\lambda during the early part of training for two deep learning settings. The results are compared against the theoretical predictions of a phase transition at ηcrit=2/λ0\eta_{\rm crit}=2/\lambda_{0}, and a maximum learning rate of 4/λ04/\lambda_{0}. Here λ0\lambda_{0} is the top eigenvalue of the empirical NTK at initialization.

For learning rates η<ηcrit\eta<\eta_{\rm crit}, we find that λ\lambda is independent of the learning rate and constant throughout training, as expected in the lazy phase. For ηcrit<η<4/λ0\eta_{\rm crit}<\eta<4/\lambda_{0} we find that λ\lambda decreases during training to below 2/η2/\eta, matching the predicted behavior in the catapult phase (note that in the Wide ResNet example, λ\lambda initially increases before reaching its stable value).

The large learning rate behavior predicted by the model appears to persist up to the maximum learning rate, which is larger in these experiments than in the theoretical model. In these and other experiments involving ReLU networks, we find that ηmax≈12/λ0\eta_{\rm max}\approx 12/\lambda_{0} is a good predictor of the maximum learning rate (in the SM C.4 we discuss other nonlinearities). We conjecture that this is the typical maximum learning rate of networks with ReLU non-linearities.

Figure 3 also shows the loss initially increasing before converging in the catapult phase, confirming another prediction of the model. This transient behavior is very short, taking less than 10 steps to complete.

2 Generalization performance

We now consider the performance of trained models in the different phases discussed in this work. Keskar et al. (2016) observed a correlation between the flatness of a minimum found by SGD and the generalization performance (see Jiang et al. (2020) for additional empirical confirmation of this correlation). In this work, we showed that the minima SGD finds are flatter in the catapult phase, as measured by the top kernel eigenvalue. Our measure of flatness differs from that of Keskar et al. (2016), but we expect that these measures are correlated.

We therefore conjecture that optimal performance is often obtained for learning rates above ηcrit\eta_{\rm crit} and below the maximum learning rate.

In this section we test this conjecture empirically. We find that performance in the large learning rate range always matches or exceeds the performance when η<ηcrit\eta<\eta_{\rm crit}. For a fixed compute budget, we find that the best performance is always found in the catapult phase.

Figure 4 shows the accuracy as a function of the learning rate for a fully-connected ReLU network trained on a subset of MNIST. We find that the optimal performance is achieved above ηcrit\eta_{\rm crit} and close to ηmax=12/λ0\eta_{\rm max}=12/\lambda_{0}, the expected maximum learning rate.

Next, Figure 5 shows the performance of a convolutional network and a Wide ResNet (WRN) trained on CIFAR-10. The experimental setup, which we now describe, was chosen to ensure a fair comparison of the performance across different learning rates. The network is trained with different initial learning rates, followed by a decay at a fixed physical time t⋅ηt\cdot\eta to the same final learning rate. This schedule is introduced in order to ensure that all experiments have the same level of SGD noise toward the end of training.

We present results using two different stopping conditions. In Figure 5a, 5c, all models were trained for a fixed number of training steps. We find a significant performance gap between small and large learning rates, with the optimal learning rate above ηcrit\eta_{\rm crit} and close to ηmax\eta_{\rm max}. Beyond this learning rate, performance drops sharply.

The fixed compute stopping condition, while of practical interest, biases the results in favor of large learning rates. Indeed, in the limit of small learning rate, training for a fixed number of steps will keep the model close to initialization. To control for this, in Figure 5b,5d models were trained for the same amount of physical time t⋅ηt\cdot\eta. For the CNN of figure 5b, decaying the learning rate does not have a significant effect on performance and we observe that performance is flat up to ηmax\eta_{\rm max}, and there is no correlation between our measure of curvature and generalization performance. Figure 5d shows the analogous experiment for WRN. When decaying the learning rate toward the end of training to control for SGD noise, we find that optimal performance is achieved above ηcrit\eta_{\rm crit}. In all these cases, ηmax\eta_{\rm max} is a good predictor of the maximal learning rate, despite significant differences in the architectures. Notice that by tuning the learning rate to the catapult phase, we are able to achieve performance using MSE loss, and without momentum, that is competitive with the best reported results for this model (Zagoruyko & Komodakis, 2016).

In SM B.1, we present additional results for WRN on CIFAR-100, with similar conclusions as those for WRN on CIFAR-10.

Additional properties of the model

So far we have focused on the generalization performance and curvature of the large learning rate phase. Here we investigate additional predictions made by our model.

One striking prediction of the model is that after a period of excursion, the logit differences settle back to O(1)\mathcal{O}(1) values, the NTK stops changing, and evolution is again well approximated by a linear model with constant kernel at large width.

We speculate that the return to linearity and constancy of the kernel may hold asymptotically in width for more general models for a range of learning rates above ηcrit\eta_{\rm crit}. We test this by evolving the model for order log⁡(n)\log(n) steps until the catapult effect is over, linearizing the model, and comparing the evolution of the two models beyond this point. Figure 6 shows an example of this. At fixed width, the accuracy of the linear and non-linear networks match for a range of learning rates above the transition up to 4/λ04/\lambda_{0}. We present additional evidence for this asymptotic linearization behavior in the Supplement.

2 Non-perturbative phase transition

The large width analysis of the small learning rate phase has been the subject of much work. In this phase, at infinite width, the network map evolves as a linear random features model, ft+1(0)=ft(0)−Θft(0)f^{(0)}_{t+1}=f_{t}^{(0)}-\Theta f_{t}^{(0)}, where f(0)f^{(0)} is the function of the linearized model. At large but finite width, corrections to this linear evolution can be systematically incorporated via a perturbative expansion (Taylor expansion) around infinite width (Dyer & Gur-Ari, 2020; Huang & Yau, 2019).

The evolution equations (10) and (11) of the solvable model are an example of this. At large width and in the small learning rate phase, the O(n−1)O(n^{-1}) terms are suppressed for all times. In contrast, the leading order dynamics of ft(0)f^{(0)}_{t} diverge when η>ηcrit\eta>\eta_{\rm crit}, and so the true evolution cannot be described by the linear model. Indeed, the logits grow to O(n1/2)\mathcal{O}(n^{1/2}) and thus all terms in (10) and (11) are of the same order. Similarly, the growth observed empirically in the catapult phase for more general models cannot be described by truncating the series (12) at any order, because the terms all become comparable.

Discussion

In this work we took a step toward understanding the role of large learning rates in deep learning. We presented a dynamical mechanism that allows deep networks to be trained at larger learning rates than those accessible to their linear counterparts. For MSE loss, linear model training diverges when the learning rate is above the critical value ηcrit=2/λ0\eta_{\rm crit}=2/\lambda_{0}, where λ0\lambda_{0} is the curvature at initialization. We showed that deep networks can train for larger learning rates by navigating to an area of the landscape that has sufficiently low curvature. Perhaps counterintuitively, training in this regime involves an initial period during which the loss increases before converging to its final, small value. We call this the catapult effect.

These observations are made concrete in our theoretical model, where we fully analyze the gradient descent dynamics as a function of the learning rate. The analysis involves a modified large width limit, in which both the width and training time are taken to be large. Sweeping the learning rate from small to large, and working in the limit, we find sharp transitions from a lazy phase where linearized model training is stable, to a catapult phase in which only the full model converges, and finally to a divergent phase in which training is unstable. These transitions have the hallmarks of phase transitions that commonly appear in physical systems such as ferromagnets or water, as one changes parameters such as temperature. In particular, these transitions are non-perturbative: a Taylor series expansion of the linearized model that takes into account finite width corrections is not sufficient to describe the behavior beyond the critical learning rate.

We derive the learning rates at which these transitions occur as a function of the curvature at initialization. We then treat these theoretical results as predictions, to be tested beyond the regime where they are guaranteed to hold, and find good quantitative agreement with empirical results across a variety of realistic deep learning settings.

2 Reducing misalignment of activations and gradients

The catapult dynamics for the simplified model in Section 2.1 reduce curvature by shrinking the component of the first layer weights uu which is orthogonal to the second layer weights vv, and shrinking the component of the second layer weights vv which is orthogonal to the first layer weights uu. We can rewrite the simplified model in terms of a hidden layer h=uxh=ux, where f(x)=n−1/2v⊤hf(x)=n^{-1/2}v^{\top}h. The gradient with respect to this hidden layer is ∂L∂h=n−1/2f(x)v\frac{\partial L}{\partial h}=n^{-1/2}f(x)v. These hidden layer gradients ∂L∂h\frac{\partial L}{\partial h} thus point in the same direction as vv, while the hidden activations hh point in the same direction as uu. An alternative interpretation of the catapult dynamics is then that they reduce the components of hh and ∂L∂h\frac{\partial L}{\partial h} which are orthogonal to each other. The catapult dynamics thus serve, in this simplified model, to reduce the misalignment between feedforward activations hh, and backpropagated gradients ∂L∂h\frac{\partial L}{\partial h}. We hypothesize that this reduction of misalignment between activations and gradients may be a feature of large learning rates and catapult dynamics in deep, as well as shallow, networks. We further hypothesize that it may play a directly beneficial role in generalization, for instance by making the model output less sensitive to orthogonal, out-of-distribution, perturbations of activations.

3 Catapult dynamics often improve generalization

Our results shed light on the regularizing effect of training at large learning rates. The effect presented here is independent of the regularizing effect of stochastic gradient noise, which has been studied extensively. Building on previous works, we noted the observed correlation between flatness and generalization performance. Based on these observations, we expect the optimal performance to often occur for learning rates larger than ηcrit\eta_{\rm crit}, where the linearized model is unstable. Observing this effect required controlling for several confounding factors that affect the comparison of performance between different learning rates. Under a fair comparison, and also for a fixed compute budget, we find that this expectation holds in practice.

4 Beyond infinite linear models

One outcome of our work is to address the performance gap between ordinary neural networks, and linear models inspired by the theory of wide networks. Optimal performance is often obtained at large learning rates which are inaccessible to linearized models. In such cases, we expect the performance gap to persist even at arbitrarily large widths. We hope our work can further improve the understanding of deep learning methods.

5 Other open questions

There are several remaining open questions. While the model predicts a maximum learning rate of 4/λ04/\lambda_{0}, for models with ReLU activations we find that the maximum learning rate is consistently higher. This may be due to a separate dynamical curvature-reduction mechanism that relies on ReLU. In addition, we do not explore the degree to which our results extend to softmax classification. While we expect qualitatively similar behavior there, the non-constant Hessian of the softmax cross entropy makes controlled experiments more challenging. Similarly, behavior for other optimizers such as SGD with momentum may differ. For example, the maximum learning rate when training a linear model is larger for gradient descent with momentum than for vanilla gradient descent, and therefore the transition to the catapult phase (if it exists) will occur at a higher learning rate. We leave these questions to future work.

Acknowledgements

The authors would like to thank Kyle Aitken, Dar Gilboa, Justin Gilmer, Boris Hanin, Tengyu Ma, Andrea Montanari, and Behnam Neyshabur for useful discussions. We would also like to thank Jaehoon Lee for early discussions about empirical properties of the lazy phase.

References

Supplementary materials

Appendix A Experimental details

We are using JAX (Bradbury et al., 2018) and the Neural Tangents Library for our experiments (Novak et al., 2020).

All the models have been trained with Mean Squared Error normalized as L({x,y}B)=12k∣B∣∑(x,y)∈B,i(fi(x)−yi)2{\cal L}(\{x,y\}_{B})=\frac{1}{2k|B|}\sum_{(x,y)\in B,i}(f^{i}(x)-y^{i})^{2}, where kk is the number of classes and yiy^{i} are one-targets.

In a similar way, we have normalized the NTK as Θij(x,x′)=1k∣B∣∑α∂αfi(x)∂αfj(x′)\Theta_{ij}(x,x^{\prime})=\frac{1}{k|B|}\sum_{\alpha}\partial_{\alpha}f^{i}(x)\partial_{\alpha}f^{j}(x^{\prime}) so that the eigenvalues of the NTK are the same as the non-zero eigenvalues of the Fisher information: 1k∣B∣∑x∈B,i∂αfi(x)∂βfi(x)\frac{1}{k|B|}\sum_{x\in B,i}\partial_{\alpha}f^{i}(x)\partial_{\beta}f^{i}(x).

In our experiments we measure the top eigenvalue of the NTK using Lanczos’ algorithm. We construct the NTK on a small batch of data, typically several hundred samples, compute the top eigenvalue, and then average over batches. In this work, we do not focus on precision aspects such as fluctuations in the top eigenvalue across batches.

All experiments that compare different learning rates use the same seed for the weights at initialization and we consider only one such initialization (unless otherwise stated) although we have not seen much variance in the phenomena described. We let σw,σb\sigma_{w},\sigma_{b} denote the constant (width-independent) coefficient of the standard deviation of the weight and bias initializations, respectively.

Here we describe experimental settings specific to a figure.

Figure 3a,3b,3c. Fully connected, three hidden layers w=2048w=2048, ReLU non-linearity trained using SGD (no momentum) on MNIST. Batch size=512=512, using NTK normalization, σw=2,σb=0\sigma_{w}=\sqrt{2},\sigma_{b}=0.

Figures 3d,3e,3f. Wide ResNet 28-18 trained on CIFAR10 with SGD (no momentum). Batch size of 128128, LeCun initialization with σw=2,σb=0\sigma_{w}=\sqrt{2},\sigma_{b}=0, L2=0L_{2}=0.

Figures 4,6 Fully connected network with one hidden layer and ReLU non-linearity trained on 512 samples of MNIST with SGD (no momentum). Batch size of 512512, NTK initialization with σw=2,σb=0\sigma_{w}=\sqrt{2},\sigma_{b}=0.

Figures 5a,5b. The convolutional network has the following architecture: Conv1(320)→ReLU→Conv2(320)→ReLU→MaxPool((2,2), ’VALID’)→Conv1(320)→ReLU→Conv2(128)→MaxPool((2,2), ’VALID’)→Flatten()→Dense(256)→ReLU→Dense(10)\text{Conv}_{1}(320)\rightarrow\text{ReLU}\rightarrow\text{Conv}_{2}(320)\rightarrow\text{ReLU}\rightarrow\text{MaxPool((2,2), 'VALID')}\rightarrow\text{Conv}_{1}(320)\rightarrow\text{ReLU}\rightarrow\text{Conv}_{2}(128)\rightarrow\text{MaxPool((2,2), 'VALID')}\rightarrow\text{Flatten()}\rightarrow\text{Dense}(256)\rightarrow\text{ReLU}\rightarrow\text{Dense}(10). Dense(n)\text{Dense}(n) denotes a fully-connected layer with output dimension nn. Conv1(n),Conv2(n)\text{Conv}_{1}(n),\text{Conv}_{2}(n) denote convolutional layers with ’SAME’ or ’VALID’ padding and nn filters, respectively; all convolutional layers use (3,3)(3,3) filters. MaxPool((2,2), ’VALID’) performs max pooling with ’VALID’ padding and a (2,2) window size. LeCun initialization is used, with the standard deviation of the weights and biases drawn as σw=2\sigma_{w}=\sqrt{2}, σb=0.05\sigma_{b}=0.05, respectively. Trained on CIFAR-10 with SGD, batch size of 256 and L2 regularization = 0.001.

Figures 1, 5c,5d. Wide ResNet on CIFAR10 using SGD (no momentum). Training on v3-8 TPUs with a total batch size of 10241024 (and per device batch size of 128128). They all use L2L_{2} regularization=0.0005=0.0005, LeCun initialization with σw=1,σb=0\sigma_{w}=1,\sigma_{b}=0. There is also data augmentation: we use flip, crop and mixup. With softmax classification, these models can get test accuracy of 0.9650.965 if one uses cosine decay, so we don’t observe a big performance decay due to using MSE. Furthermore, we are using JAX’s implementation of Batch Norm which doesn’t keep track of training batch statistics for test mode evaluation. We have not hyperparameter tuned for learning rates nor L2L_{2} regularization parameter.

Figures S2,S3. Wide ResNet on CIFAR100 using SGD (no momentum). Same setting as figure 5c, 5d except for the different dataset, different L2 regularization =0.000025=0.000025 and label smoothing (we have subtracted 0.010.01 from the target one-hot labels).

Figure S7. Two hidden layer, ReLU network for one data point x=1,y=1x=1,y=1.

Figure S10. Fully connected network with two hidden layers and tanh non-linearity trained on MNIST with SGD (no momentum). Batch size of 512512, LeCun initialization with σw=1,σb=0\sigma_{w}=1,\sigma_{b}=0.

Figure S8a. Two-hidden layer fully connected network trained on MNIST with batch size 512512, NTK normalization with σw=2,σb=0\sigma_{w}=\sqrt{2},\sigma_{b}=0. Trained using both momenta γ=0.9\gamma=0.9 and vanilla SGD for three different non-linearities: tanh, ReLU and identity (no non-linearity). The learning rate for each non-linearity was chosen to correspond to η=1λ0\eta=\frac{1}{\lambda_{0}}.

Rest of SM figures. Small modifications of experiments in previous figures, specified in captions.

Appendix B Experimental results: Late time performance

We can also repeat the performance experiments for CIFAR-100 and the same Wide ResNet 28-10 setup. In this case, using MSE and SGD we require to evolve the system for longer times, which requires a smaller L2L_{2} regularization. We didn’t tune for it, but found that 2.5×10−52.5\times 10^{-5} works. With only one decay we can get within 3%3\% of the Zagoruyko & Komodakis (2016) performance that used softmax classification and two learning rate decays. However, evolution for longer time is needed: we found that different learning rates converge at ≈2000\approx 2000 physical epochs. Similar to the main text experiments, we observe that if we decay after evolving for the same amount of physical epochs, larger learning rates do better. See figure S2.

B.2 Different learning rates converge at the same physical time

We can also plot the test accuracy versus physical time for different learning rates to show that for vanilla SGD, the performance curves of different learning rates are basically on top of each other if we plot them in physical time, which is why we find that the fair comparison between learning rates should be at the same physical time.

We have picked a subset of learning rates of the previous WRN28-18 CIFAR100 experiment of SM B.1. In figure S3, we see how even if the curves are slightly different they converge to roughly the same accuracy. The only curve which is slightly different is η=2.5\eta=2.5 which is a rather high learning rate (close to 12λ0\frac{12}{\lambda_{0}}).

Even if in the main section we have considered a model with fixed L2L_{2} regularization, we can study the effect without L2L_{2} or with a different value. In these two examples, we will be considering the same setup as figures 5c,5d.

Without L2L_{2} regularization, we see that the larger learning rate does better even in the absence of learning rate decay, although training takes a really long time. In our experience, comparing this setup with state of the art, L2=0L_{2}=0 regularization makes the experiment take longer before convergence but does not influence performance much.

In the presence of L2L_{2} regularization we picked the particular value L2=0.0005L_{2}=0.0005 in order to make sure that our conclusion is not dependent on the choice of L2L_{2}, the only hyperparameter (other than η\eta), we have considered a larger L2=0.001L_{2}=0.001. We see that the optimal performance in physical time is also peaked in the catapult phase, although the difference here is smaller.

B.4 Training accuracy plots

The training accuracies of the previous experiments are shown in figure S6.

Appendix C Experimental results: Early time dynamics

In the main text we have been using ReLU non-linearities. Compared with the simple model with no non-linearities, ReLU networks have a broader trainability regime after η=4λ0\eta=\frac{4}{\lambda_{0}}. It looks like these networks generically well train until η=12λ0\eta=\frac{12}{\lambda_{0}}. This is a generic feature of deep ReLU networks and can be already observed for the model of section 22 with a target y=1y=1, two hidden layers and a ReLU non-linearity: f=u.ReLU(w.ReLU(v))f=u.ReLU(w.ReLU(v)), as shown in figure S7). In this single sample context for η≥12λ\eta\geq\frac{12}{\lambda}, the loss doesn’t diverge but the neurons die and end up giving the trivial f=0f=0 function. For deep networks with more than one hidden layer and multiple samples, as discussed in the main text, we observe that the loss diverges after ∼12λ\sim\frac{12}{\lambda}.

C.2 Momenta

The effect of the optimizer also affects these dynamics. If we consider a similar setup with momenta, first we expect that a linear model converges in a broader range η<2λ0(1+γ)\eta<\frac{2}{\lambda_{0}}(1+\gamma). For smooth non-linearities, we observe that for η<2λ0\eta<\frac{2}{\lambda_{0}}, the λt\lambda_{t} is constant. However this is not true for ReLU, see figure S8a. In fact, for ReLu networks, we observe that there is a small learning rate, roughly ηeff,crit=ηcrit1−γ\eta_{\rm eff,crit}=\frac{\eta_{\rm crit}}{1-\gamma}, below which the time dynamics of λt\lambda_{t} is similar (but non-constant). However, for η>ηeff,crit\eta>\eta_{\rm eff,crit}, there are strong time dynamics, we illustrate this in figure S8b with a 3 hidden layer ReLu network.

We don’t expect L2L_{2} regularization to affect the early time dynamics, but because of the strong rearrangement that goes on in the first steps, it could potentially have a non-trivial effect; among other things, the Hessian spectrum necessarily is decaying. We can see how the dynamics that drives the rearrangement is roughly the same, even in the maximum eigenvalue at early times is decreasing slowly.

C.4 Tanh activations

We observe that for Tanh activation, ηmax\eta_{\rm max} is closer to the simple model expectation 4λ0\frac{4}{\lambda_{0}}, see figure S10.

C.5 WRN NTK Normalization

As illustrated in the text in figures \reffig:FCc,\reffig:FCe\ref{fig:FCc},\ref{fig:FCe} we also see this behaviour for NTK normalization. For completeness we include the WRN model with NTK normalization. From the linearized intuition, we expect the phases to also be determined by the quantity ηλt\eta\lambda_{t}, independently of the normalization. Figure S11 has the same setup as in figure 3.

Appendix D Theoretical details

Here we provide additional details on the theoretical analysis of the full model in Section 2.2. The gradient descent update equations are

The update equations for the error and kernel evaluated on training set inputs are

Appendix E Model dynamics close to the critical learning rate

Here we consider the gradient descent dynamics of the model analyzed in Section 2, for learning rates η\eta that are close to the critical point ηcrit=2/λ0\eta_{\rm crit}=2/\lambda_{0}. The analysis reveals that the gradient descent dynamics of the model are qualitatively different above and below this point. For example, the loss decreases monotonically during training when η<ηcrit\eta<\eta_{\rm crit}, but not when η>ηcrit\eta>\eta_{\rm crit}. In this section we show that the transition from small to large learning rate becomes sharp once we take the modified large width limit, in the following sense: certain functions of the learning rate become non-analytic at ηcrit\eta_{\rm crit} in the limit. This sharp transition bears close resemblance to phase transitions of the kind found in physical systems, such as the transition between the liquid and gaseous phases of water. In particular, our case involves a dynamical system, where the dynamics are governed by the gradient descent equations. These dynamics undergo a phase transition as a function of the learning rate — an external parameter. We point to the logistic map (May, 1976) as a well-known example of a dynamical system that undergoes phase transitions as a function of an external parameter.

A phase transition is a drastic change in a system’s behavior incurred under a small change in external parameters. Mathematically, it is a non-analyticity in some property of the system as a function of these parameters. For example, consider the property λ∗(η)\lambda_{*}(\eta), the curvature of the model at the end of training as a function of the learning rate. In the modified large width limit, λ∗(η)\lambda_{*}(\eta) is constant for η<ηcrit\eta<\eta_{\rm crit}, but not for η>ηcrit\eta>\eta_{\rm crit}. Therefore, this function is not analytic at ηcrit\eta_{\rm crit}. Notice that this statement is true in the limit but not necessarily at finite width, where the final curvature may be an analytic function of the learning rate even at ηcrit\eta_{\rm crit}. It is well known in physics that phase transitions only occur in a limit where the number of dynamical variables (in this case the number of model parameters) is taken to infinity. One immediate consequence of the non-analyticity at ηcrit\eta_{\rm crit} is that the large learning rate phase is inaccessible from the small learning rate phase via a perturbative expansion. In other words, we cannot describe all properties of the model for some η>ηcrit\eta>\eta_{\rm crit} by doing a Taylor expansion around a point η0<ηcrit\eta_{0}<\eta_{\rm crit} and keeping a finite number of terms.

Dyer & Gur-Ari (2020); Huang & Yau (2019) developed a formalism that allows one to compute finite-width corrections to various properties of deep networks, using a perturbative expansion around the infinite width limit. We have argued that the usual infinite width approximation to the training dynamics is not valid for learning rates above ηcrit\eta_{\rm crit}, and that a full analysis must account for large finite-width effects. One may have hoped that including the perturbative finite-width corrections discussed in Dyer & Gur-Ari (2020); Huang & Yau (2019) would allow us to regain analytic control over the dynamics. The results presented here suggest that this is not the case: For η>ηcrit\eta>\eta_{\rm crit}, we expect that the perturbative expansion will not provide a good approximation to the gradient descent dynamics at any finite order in inverse width.

E.2 Critical exponents

When the external parameters are close to a phase transition, one often finds that the dynamical properties of the system obey power law behavior. The exponents of these power laws (called critical exponents) are of interest because they are often found to be universal, in the sense that the same set of exponents is often found to describe the phase transitions of completely different physical systems.

Here we consider t∗(η)t_{*}(\eta), the number of steps until convergence, as a function of the learning rate. We will now show that t∗t_{*} exhibits power-law behavior when η\eta is close to ηcrit\eta_{\rm crit}. For simplicity we consider the warmup model studied in Section 2. First, suppose that we are below the transition, setting ηλ0=2−ϵ\eta\lambda_{0}=2-\epsilon for some small ϵ>0\epsilon>0. From the update equation, ft+1≈(1−ηλt)ft≈−(1−ϵ)ftf_{t+1}\approx(1-\eta\lambda_{t})f_{t}\approx-(1-\epsilon)f_{t} we see that ftf_{t} will converge to some fixed small value f∗f_{*} after time t∗≈ϵ−1log⁡(f∗−1)∼ϵ−1t_{*}\approx\epsilon^{-1}\log(f_{*}^{-1})\sim\epsilon^{-1}. Here we assumed that λt\lambda_{t} is constant in tt, which is true as long as t∗t_{*} is independent of nn (namely we fix ϵ\epsilon and then take nn large). Therefore, the convergence time below the transition scales as t∗∼(ηcrit−η)−1t_{*}\sim(\eta_{\rm crit}-\eta)^{-1}, and the critical exponent is -1.

Next, suppose that ηλ0=2+ϵ\eta\lambda_{0}=2+\epsilon with ϵ>0\epsilon>0. Now the update equation reads ft+1≈−(1+ϵ)ftf_{t+1}\approx-(1+\epsilon)f_{t}. This approximation holds early during training, when the curvature updates are small. Initially, ∣ft∣|f_{t}| will grow until it is of order n\sqrt{n}, at which point the updates to λt\lambda_{t} become of order n0n^{0}. This will happen in time t^∼ϵ−1log⁡n\hat{t}\sim\epsilon^{-1}\log\sqrt{n}. Following this, the optimizer will converge. At this point ηλt\eta\lambda_{t} is no longer tuned to be close to the transition, and so the convergence time measured from this point on will not be sensitive to ϵ\epsilon. Therefore, for small ϵ\epsilon the convergence time will be dominated by the early part of training, namely t∗≈t^∼ϵ−1t_{*}\approx\hat{t}\sim\epsilon^{-1}. The critical exponent is again -1. Figure S12 show an empirical verification of this behavior.

Appendix F Additional evidence for linearization in the catapult phase.

Here we present some more detailed evidence for the re-emergence of linear dynamics in the catapult phase. Figure S13 show results for models trained on subsets of MNIST with learning rates η>ηcrit\eta>\eta_{\rm crit}. In figure Figure S13a we see that for a one-hidden-layer fully connected model trained on 512 MNIST images, the performance of the full non-linear model and model linearized after 10 steps track closely. Models evolve as linear models when the NTK is constant. In Figure S13b we give evidence that as networks become wider, the change in the kernel decreases.