{
  "File Number": "1060",
  "Title": "Understanding the Generalization Benefit of Normalization Layers: Sharpness Reduction",
  "abstractText": "Normalization layers (e.g., Batch Normalization, Layer Normalization) were introduced to help with optimization difficulties in very deep nets, but they clearly also help generalization, even in not-so-deep nets. Motivated by the long-held belief that flatter minima lead to better generalization, this paper gives mathematical analysis and supporting experiments suggesting that normalization (together with accompanying weight-decay) encourages GD to reduce the sharpness of loss surface. Here “sharpness” is carefully defined given that the loss is scale-invariant, a known consequence of normalization. Specifically, for a fairly broad class of neural nets with normalization, our theory explains how GD with a finite learning rate enters the so-called Edge of Stability (EoS) regime, and characterizes the trajectory of GD in this regime via a continuous sharpness-reduction flow.",
  "Reviewer Comment": "Reviewer_1: Overall, the paper is clearly written, and of relatively high quality and originality. I think its significance could be improved by devoting more space to the algorithm for estimating the sample cover number (see below); by making more explicit the role of invariance in the theoretical results; and fully considering the trade-off between model complexity and empirical risk in generalization bounds.\nThe theory is missing the connection between invariance-induced model complexity reduction and improved generalization. In particular, both in the main text and in the appendix, the role of invariance isn't clear. Generating the sample cover from a set of transformations is intuitive, but once we have that, the role of invariance doesn't seem particularly important. I'm guessing that I missed something so it would be helpful for the authors to clarify.\nFurther to that point, all of the theoretical results bound the covering number or Rademacher complexity of\nH\n, and of course that's only one part of a generalization bound. One could map all points to a singleton and have a covering number of 1, but that won't do well empirically. What assumptions are needed about the underlying data distribution in order to either i) guarantee that the empirical risk won't increase (at least in probability); or ii) control the trade-off between empirical risk increase and model complexity decrease?\nThe theoretical development seems correct, and is a nice complementary perspective to the function-space perspective (though I would argue that the distinction isn't meaningful---the function space simplifies because the data space simplifies and vice versa). I am much more enthusiastic about the proposed techniques for estimating sample cover numbers. These are potentially very useful. However, the algorithmic challenges are swept to the appendix, where they are mostly swept under the rug. The challenges should be brought front-and-center, and identified as important for subsequent work. With that in mind, I think the paper would be improved by moving most or all of the linear model class special case to the appendix and devoting additional page space to algorithmic considerations and challenges.\nFinally, there are some minor typos scattered throughout the text that the authors should fix.\nLimitations And Societal Impact:\nThe authors haven't made clear the extent to which their results focus only on model complexity, nor the potential limitations of their proposed algorithm.\nNeeds Ethics Review: No\nTime Spent Reviewing: 2.5\n\nReviewer_2: I think this is a great paper, with nice theoretical results and simple yet surprisingly insightful experimental results (though I note that only briefly skimmed the proofs). I particularly appreciate that this paper gives not only meaningful improvements to generalization bounds, but also a concrete prescription for how to choose data augmentations to improve generalization in practice.\nI do think it's a bit limiting that these results hold only for functions which are fully invariant, as this rarely holds without some sort of strong structural prior. Would the proof techniques not work for functions which are close to invariant? For example, suppose we assume the function class is\nκ\n-Lipschitz generally, but\nκ\n′\n-Lipschitz over group transformations, for\nκ\n′\n≪\nκ\n(or some other measure of \"approximate invariance\", as Lipschitzness may not appropriately capture such invariance for certain transformations). Would this not allow for a similar result, with an additional error term?\nminor nits:\nIn line 95, the definition of covering number for function classes is presented with an argument ordering which is permuted; this should be made consistent to match the orderings used later on.\nLine 206, these are classes of functions, so this should be \"subset of\" (\n⊂\n), not \"element of\" (\n∈\n).\nLimitations And Societal Impact:\nSure\nNeeds Ethics Review: No\nTime Spent Reviewing: 2.5\n\nReviewer_3: I think the paper has the potential to be accepted after some careful polishment. However, I think the current version has some nonnegligible flaws.\nContributions\nThe authors show that the Rademacher complexity can be reduced when the model is invariant to some transformation (via sample covering number) under Lipschitz and linear regimes.\nThe authors propose an algorithm to estimate the sample covering number empirically.\nConcerns\nDuring the proof of Proposition 3.3, since the requirement of Proposition 3.6 is much stronger (a Lipschitz requirement), it cannot be directly applied during the proof of Proposition 3.3.\nThe current conclusion (theory part) in this paper is still not insightful enough. I believe if the transformation can greatly reduce the sample complexity, the generalization could be better. If the authors want to claim \"the theory just gives some intuition and the most surprising part is that the practice agreed with the theory\", more experiments should be conducted to verify the statements, e.g., CIFAR-100 and ImageNet.\nWrittings.\nI believe this paper can benefit from careful writing.\nFor example, is Proposition 3.3 a well-known result? If so, I wonder why the authors give the proof based on Proposition 3.6 (see Line 498-499). Besides, During the proof of Proposition 3.6, I wish the authors can distinguish between Equation 3.3 and Proposition 3.3 (see line 556). When I first read the proofs, I am a little bit puzzled.\nLine 118-119, why c(r) = |r| instead of |r-x1|?\nLimitations And Societal Impact:\nNo Societal Impact.\nEthical Concerns:\nNo Ethical Concerns.\nNeeds Ethics Review: No\nTime Spent Reviewing: 4",
  "1 Introduction": "Training modern deep neural nets crucially relies on normalization layers to make the training process less sensitive to hyperparameters and initialization. The two of the most popular normalization layers are Batch Normalization (BN) [55] for vision tasks and Layer Normalization (LN) [9] for language tasks. Recent works also proposed other normalization layers aiming for better performance, most notably including Group Normalization (GN) [120], Weight Normalization (WN) [102], Scaled Weight Standardization (SWS) [97, 53, 14], etc. Most normalization layers amount to a reparametrization of the neural net so that the loss becomes invariant to the scale of most parameters, and with a minor change, to all parameters: L(cw) = L(w) for all scalings c > 0 [55, 7, 77]. The current paper assumes this scale-invariance for all parameters and analyzes the trajectory of gradient descent with weight decay (WD): wt+1 ← (1− η̂λ̂)wt − η̂∇L(wt). (1) The use of WD is a common practice that has been adopted in training state-of-the-art neural nets, such as ResNets [46, 47] and Transformers [29, 15]. Previous ablation studies showed that adding WD to normalized nets indeed leads to better generalization [126, 72, 125]. More notably, Liu et al. [83] conducted experiments of training ResNets initialized from global minima with poor test accuracy, and showed that SGD with WD escapes from those bad global minima and attains good test accuracy. In contrast, training with vanilla SGD yields significant generalization degradation.\nIn the traditional view, WD regularizes the model by penalizing the parameter norm, but this may appear nonsensical for scale-invariant loss because one can scale down the norm arbitrarily without changing the loss value. However, the scale of the parameter does matter in backward propagation, and thus WD can affect the training dynamics. In particular, simple calculus shows ∇L(w) = 1‖w‖2∇L( w ‖w‖2 ) ∝ 1 ‖w‖2 and ∇ 2L(w) = 1‖w‖22∇ 2L( w‖w‖2 ) ∝ 1 ‖w‖22\n, so WD is in effect trying to enlarge the gradient and Hessian in training. This makes the training dynamics very different from unnormalized nets and requires revisiting classical convergence analyses [77, 78, 84, 80].\n36th Conference on Neural Information Processing Systems (NeurIPS 2022).\nThe current paper aims to improve mathematical understanding of how normalization improves generalization. While this may arise from many places, we focus on studying the dynamics of (fullbatch) GD (1), which is a necessary first step towards understanding SGD. We show that the interplay between normalization and WD provably induces an implicit bias to persistently reduce the sharpness of the local loss landscape during the training process, which we call the sharpness-reduction bias.\nIt is long believed that flatter minima generalize better [50, 63, 95], but the notion of sharpness/flatness makes sense only if it is carefully defined in consideration of various symmetries in neural nets. One of the most straightforward measures of sharpness is the maximum eigenvalue of Hessian, namely λ1(∇2L(wt)). But for normalized nets, this sharpness measure is vulnerable to weight rescaling, because one can scale the weight norm to make a minimizer arbitrarily flat [31]. Also, this sharpness measure may not decrease with the number of training steps: an empirical study by Cohen et al. [24] shows that for various neural nets (including normalized nets), GD has an overwhelming tendency to persistently increase λ1(∇2L(wt)) until it reaches the Edge of Stability (EoS) regime, a regime where λ1(∇2L(wt)) stays around 2/η̂ (η̂ is the learning rate). See also Section 6 and Figure 2c.",
  "1.1 Our Contributions": "The sharpness measure we use in this paper takes care of the scale-invariance in normalized nets. We are motivated by our experiments on matrix completion (with BN) and CIFAR-10, where our sharpness measure decreases as the training proceeds, and the generalization improves accordingly; see Figures 1 and 2. We note that techniques from previous works [92, 95, 37] can be easily adopted here to establish a PAC-Bayes bound on the test error, where our sharpness measure appears as an additive term (see Appendix C).\nDefinition 1.1 (Spherical Sharpness). For a scale-invariant loss L(w) (i.e., L(cw) = L(w) for all c > 0), the spherical sharpness at w ∈ RD is defined by λ1(∇2L( w‖w‖2 )), the maximum eigenvalue of the Hessian matrix after projecting w onto the unit sphere.\nBased on Definition 1.1, we study the aforementioned sharpness-reduction bias in training normalized nets with GD+WD (defined in (1)). For constant learning rate η̂ and weight decay λ̂, we can rewrite this rule equivalently as Projected Gradient Descent (PGD) on the unit sphere with adaptive learning rates, θt+1 ← Π(θt − η̃t∇L(θt)), where θt := wt‖wt‖2 is the direction ofwt, and η̃t is the “effective” learning rate at step t (see Lemma 3.1). We call η̃t adaptive because it can be shown to resemble the behaviors of adaptive gradient methods (e.g., RMSprop [49]): η̃t increases when gradient is small and decreases when gradient is large (Figure 3). Our main contributions are as follows:\n1. After θt reaches a point near the manifold of minimizers of L, we theoretically show that the effective learning rate η̃t increases until GD enters a regime where 2/η̃t roughly equals to the spherical sharpness (or equivalently 2/η̂ ≈ λ1(∇2L(wt))), namely the EoS regime (Section 4.1).\n2. In the EoS regime, we show that for GD with a small (but finite) learning rate, θt oscillates around the manifold and moves approximately along a sharpness-reduction flow, which is a gradient flow for minimizing spherical sharpness on the manifold (with gradient-dependent learning rate) (Section 4.2).\n3. As an application of our theory, we show that for linear regression with BN, GD+WD finds the minimizer that corresponds to the linear model with minimum weight norm, which looks surprisingly the same as the conventional effect of WD but is achieved through the completely different sharpness-reduction mechanism (Section 5).\n4. We experimentally verified the sharpness-reduction phenomenon predicted by our theorem and its benefits to generalization on CIFAR-10 with VGG-11 and ResNet-20, as well as matrix completion with BN (Appendix P).\n5. We generalize our theoretical results of sharpness-reduction bias to a broader class of adaptive gradient methods, most notably a variant of RMSprop with scalar learning rate (Appendix B).\nTechnical Contribution. Our proof technique is novel and may have independent interest to the ML community. The main challenge is that we need to analyze the implicit bias of GD in the EoS regime which crucially relies on step size being finite — this is in sharp contrast to many previous works on implicit bias of GD [107, 106, 87, 59, 43, 42, 76, 100, 4, 22, 79, 88, 101, 108, 38] where the same bias exists at infinitesimal LR. Our analysis is inspired by a previous line of works [13, 25, 81] showing that label noise can drive SGD to move on the minimizer manifold along the direction of minimizing the trace of Hessian. We borrow a few lemmas from those analyses, but the overall proof strategy is very different because our setting does not even have any stochastic gradient noise. Instead, we connect the dynamics in the EoS regime to power methods and show that GD oscillates around the minimizer manifold. This oscillation then becomes a driving power that pushes the parameter to move on the manifold. Finally, we analyze the speed of this movement by modeling two key parameters of the dynamics as a 1-dimensional Hamiltonian system (Figure 6). To the best of our knowledge, we are the first to provide theoretical proof for a sharpness measure to decrease during the standard GD training, without any additional regularization (e.g., label noise [13, 25, 81]) and without involving uncommon variants of GD (e.g., normalized GD or non-smooth wrappings on the loss function [8]).",
  "2 Related Works": "Sharpness and Generalization. It has been long believed that flat minima generalize better [50]. Several empirical studies [63, 74, 117, 57] verified the positive correlation between flatness and generalization. Neyshabur et al. [95] justified this via PAC-Bayes theory [92]. Several other theoretical papers explored the generalization properties of flat minima specifically for two-layer nets [13, 94, 44, 81, 30] and deep linear nets [93]. Jiang et al. [60] conducted extensive experiments for all existing generalization measures to evaluate their correlation and causal relationships with generalization error, concluding that sharpness-based measures perform the best overall. In light of this, Foret et al. [37] proposed SAM algorithm to improve the generalization by minimizing the sharpness. Despite so many positive results on sharpness-based measures, a common issue of many works is that the measures may suffer from sensitivity to rescaling of parameters in deep nets [31]. Another issue is that the minima could lie in asymmetric valleys that are flat on one side and sharp on the other [45].\nUnderstanding Normalization Layers. The benefits of normalization layers can be shown in various aspects. A series of works studied the forward propagation of deep nets at random initialization, showing that normalization layers stabilize the growth of intermediate layer outputs with depth [14, 10, 28], provably avoid rank collapse [26] and orthogonalize representations [27]. Although these works mainly focused on BN [55], Lubana et al. [85], Labatie et al. [67] provided thorough discussions on the applicability of these arguments to other normalization layers. It is also believed that BN has a unique regularization effect through the noise in batch statistics [86, 111, 104]. Several other works argued that normalization layers lead to a smoothening or preconditioning effect of the loss landscape [103, 12, 39, 61, 82, 68], which may help optimization. By analyzing the training dynamics, Arora et al. [7] rigorously proved that normalization yields an auto-tuning effect of the effective learning rate η̃t, which makes the asymptotic speed of optimization much less sensitive to the learning rate and initialization. In linear regression settings, Cai et al. [16], Kohler et al. [65] showed that training with BN leads to a faster convergence rate; Wu et al. [119] studied the implicit regularization effect of WN [102]. For two-layer nets with normalization, Ma and Ying [90] derived a mean-field formulation of the training dynamics; Dukler et al. [33] proved a convergence rate via NTK-based analysis. The current paper focuses on the interplay between normalization and WD during training, whereas all the above works either do not analyze the dynamics or assume no WD.\nInterplay Between Normalization and WD. A common feature of normalization layers (including but not limited to BN, WN, LN, GN, SWS) is that they make the loss invariant to the scale of layer weights. In presence of both scale-invariance and WD, training dynamics can go out of the scope of the classical optimization theory, e.g., one can train the net to small loss even with learning rates exponentially increasing [77]. A series of works investigated into the interplay between normalization and WD and argued that the training dynamic with SGD eventually reaches an “equilibrium” state, where the parameter norm [78, 113, 21] and the size of angular update [114] become stable. Li et al. [78], Wang and Wang [115] provided empirical and theoretical evidence that the function represented by the net also equilibrates to a stationary distribution that is independent of initialization. This could be related to Liu et al. [83]’s experiments on the ability of SGD with WD to escape from bad initialization, but it remains unclear why the generalization should be good at the equilibrium state. In this paper, we focus on (full-batch) GD, which is the most basic and important special case of SGD.",
  "3 Preliminaries": "Let SD−1 := {θ ∈ RD : ‖θ‖2 = 1} be the unit sphere equipped with subspace topology. We say a loss function L(w) defined on RD \\ {0} is scale-invariant if L(cw) = L(w) for all c > 0. In other words, the loss value does not change with the parameter norm. For a differentiable scaleinvariant function L(w), the gradient is (−1)-homogeneous and it is always perpendicular to w, i.e., ∇L(cw) = c−1∇L(w) for all c > 0 and 〈∇L(w),w〉 = 0 (see Lemma D.1). The focus of this paper is the dynamics of GD+WD on scale-invariant loss. (1) gives the update rule for learning rate (LR) η̂ and weight decay (WD) λ̂. We use θt := wt‖wt‖2 to denote the projection of wt onto SD−1 at step t. We write GD+WD on scale-invariant loss as a specific kind of Projected Gradient Descent (PGD) and define the effective learning rate to be the LR η̃t := η̂(1−η̂λ̂)‖wt‖22\nthat appears in the update rule of PGD. This notion is slightly different from the effective learning rate η̂ ‖wt‖22 defined in previous works [113, 52, 7], but ours is more convenient for our analysis. Lemma 3.1. When the parameters wt are updated as (1), θt satisfies the following equation: θt+1 = Π(θt − η̃t∇L(θt)), (2)\nwhere η̃t := η̂(1−η̂λ̂)‖wt‖22 is called the effective learning rate at step t, and Π : w 7→ w‖w‖2 is the projection operator that projects any vector onto the unit sphere.",
  "4 GD+WD on Scale-Invariant Loss Functions": "This section analyzes GD+WD (1) on a scale-invariant loss L(w), in particular what happens after approaching a manifold of local minimizers. Section 4.1 analyzes the dynamics in the stable regime, where loss is guaranteed to decrease monotonically, and Theorem 4.2 suggests wt can get close to a local minimizer at some time t0. We show that the effective LR keeps increasing after t0, causing\nGD+WD to eventually leave this stable regime and enter a new regime which we call the Edge of Stability (EoS). In Section 4.2, we establish our main theorem, which connects the dynamics of wt in the EoS regime to a sharpness-reduction flow.",
  "4.1 GD+WD Eventually Leaves the Stable Regime": "A standard step of analyzing optimization methods is to do Taylor expansion locally for the loss function, and show that how the optimization method decreases the loss using a descent lemma. In our case of scale-invariant loss functions, we useH(w) := ∇2L(w) ∈ RD×D to denote the Hessian matrix of L at w ∈ RD, and λH1 (w) := λ1(H(w)) to denote the top eigenvalue ofH(w). Lemma 4.1 (Descent Lemma). For scale-invariant loss L(w), at step t of GD+WD we have\nL(θt+1) ≤ L(θt)− η̃t(1− η̃tλ(t)max/2)‖∇L(θt)‖22.\nwhere λ(t)max := supα∈[0,η̃t] { λH1 (θt − α∇L(θt)) } is an upper bound of spherical sharpness locally.\nThis descent lemma shows that the training loss L(θt) keeps decreasing as long as the effective LR η̃t is smaller than 2/λ (t) max, We call the regime of η̃t < 2/λ (t) max as the stable regime of GD+WD. If η̃t ≈ 2/λ(t)max with a small difference, then we call it as the Edge of Stability (EoS) regime. We remark that this condition for EoS regime is essentially the same as η̂ ≈ 2/λH1 (w) in Cohen et al. [24]’s definition because η̃t · λ(t)max ≈ η̂ · λH1 (w); see Appendix G.3. Fix an initial pointw0 ∈ RD \\ {0}. Now we aim to characterize the dynamics of GD+WD when LR η̂ and WD λ̂ are small enough. The convergence rate of GD+WD has been analyzed by Li et al. [80]. Here we present a variant of their theorem that bounds both the gradient and effective LR.\nTheorem 4.2 (Variant of Theorem D.2, Li et al. [80]). Let L(w) be a scale-invariant loss function and ρ2 := sup{‖∇2L(w)‖2 : w ∈ SD−1} be the smoothness constant of L restricted on the unit sphere. For GD+WD (1) with η̂λ̂ ≤ 1/2 and η̃0 ≤ 1π2ρ2(1−η̂λ̂) , let T0 := ⌈ 1 2η̂λ̂ ln ‖w0‖22 ρ2π2η̂ ⌉ steps, there must exist 0 ≤ t ≤ T0 such that ‖∇L(θt)‖22 ≤ 8π4ρ22λ̂η̂ and η̃t ≤ 2π2ρ2(1−η̂λ̂) .\nTheorem 4.2 shows that for some t0 ≤ T0, ‖∇L(θt0)‖22 ≤ O(λ̂η̂) and η̃t0 ≤ 1π2ρ2 < 2 ρ2 , which means θt0 is an approximate first-order stationary point of L on the unit sphere. This does not guarantee that θt0 is close to any global minimizer, but in practice the training loss rarely gets stuck at a non-optimal value when the model is overparameterized [70, 96, 71, 125]. We are thus motivated to study the case where θt0 not only has small gradient ‖∇L(θt0)‖22 ≤ O(λ̂η̂) but also is close to a local minimizer θ∗ ∈ SD−1 of L in the sense that ‖θt0 −θ∗‖2 ≤ O((λ̂η̂)1/2) (assuming smoothness, the latter implies the former).\nAs the gradient is small near the local minimizer θ∗, starting from step t0, the norm ofwt decreases due to the effect of WD. See Figure 3a. Since the effective LR is inversely proportional to ‖wt‖22, this leads to the effective LR to increase. Then Theorem 4.4 will show that the GD+WD dynamic eventually leaves the stable regime at some time t1 > t0, and enters the EoS regime where η̃t ≈ 2/λ(t)max. To establish Theorem 4.4, we need to assume that L satisfies Polyak-Łojasiewicz (PL) condition locally, which is a standard regularity condition in the optimization literature to ease theoretical analysis around a minimizer. Intuitively,\nPL condition guarantees that the gradient grows faster than a quadratic function as we move a parameter θ away from θ∗. Note that PL condition is strictly weaker than convexity as the function can still be non-convex under PL condition (see, e.g., [62]).\nDefinition 4.3 (Polyak-Łojasiewicz Condition). For a scale-invariant loss L(w) and µ > 0, we say that L satisfies µ-Polyak-Łojasiewicz condition (or µ-PL) locally around a local minimizer θ∗ on SD−1 if for some neighborhood U ⊆ SD−1 of θ∗, ∀θ ∈ U : 12‖∇L(θ)‖22 ≥ µ · (L(θ)− L(θ∗)).\nTheorem 4.4. Let L(w) be a C2-smooth scale-invariant loss that satisfies µ-PL around a local minimizer θ∗ on the unit sphere, and ρ2 := sup{‖∇2L(w)‖2 : w ∈ SD−1}. For GD+WD on L(w) with learning rate η̂ and weight decay λ̂, if at some step t0, ‖θt0 − θ∗‖2 ≤ O((λ̂η̂)1/2) and η̃t0 ≤ 2ρ2 < 2 λH1 (θ ∗) , and if λ̂η̂ is small enough, then there exists a time t1 > t0 such that ‖θt1 − θ∗‖2 = O((λ̂η̂)1/2) and η̃t1 = 2λH1 (θ∗) +O((λ̂η̂) 1/2).\n4.2 Dynamics at the Edge of Stability\nFrom the analysis in the previous subsection, we know that θt can get close to a local minimizer θ∗ and enter the EoS regime at some step t1. But what happens after t1?\nFigure 4 gives a warm-up example on a 3D scale-invariant loss L : R3 \\ {0} → R, where the black line is a manifold Γ consisting of all the minimizers. In training with GD+WD, θt first goes close to a local minimizer ζ0, then Theorem 4.4 suggests that WD causes the effective LR to steadily increase until the dynamic enters the EoS regime. Now something interesting happens — θt moves a bit away from ζ0 and starts to oscillate around the manifold Γ . This oscillation is not completely perpendicular to Γ but actually forms a small angle that pushes θt to move downward persistently until θt approaches the minimizer ζ∗ denoted in the plot.\nFor a general scale-invariant loss L : RD \\ {0} → R, which minimizer does θt move towards? In this work, we consider the setting where there is a manifold Γ consisting only of local minimizers (but not necessarily all of them). We show that θt always oscillates around the manifold once it approaches the manifold and enters the EoS regime, and meanwhile θt keeps moving in a direction of reducing spherical sharpness.",
  "4.2.1 Assumptions": "Now we formally introduce our main assumption on the local minimizer manifold Γ . Assumption 4.5. The loss function L : RD \\ {0} → R is C4-smooth and scale-invariant. Γ is a C2-smooth, (DΓ − 1)-dimensional submanifold of SD−1 for some 0 ≤ DΓ < D, where every θ ∈ Γ is a local minimizer of L on SD−1 and rank(H(θ)) = D −DΓ.\nScale-invariance has become a standard assumption in studying neural nets with normalization layers [77, 78, 84]. For VGG and ResNet, the scale-invariance can be ensured after making minor changes to the architectures (see Appendix Q.1). The training loss L may not be smooth if the activation is ReLU, but lately it has become clear that differentiable activations such as Swish [98], GeLU [48] can perform equally well. Swish is indeed used in our VGG-11 experiments (Figure 2), but ResNet with ReLU activation also exhibits a sharpness-reduction bias empirically (see Appendix P.2).\nFor any local minimizer θ ∈ Γ , the eigenvalues λHk (θ) must be non-negative. And λHk (θ) = 0 for all D − DΓ < k ≤ D, since Γ is of dimension DΓ − 1. The condition rank(H(θ)) = D − DΓ ensures that the Hessian is maximally non-degenerate on Γ , which also appears as a key assumption in previous works [81, 8, 35]. This condition simplifies the calculus on Γ in our analysis as it ensures that the null space of the matrixH(θ) equals to the tangent space of Γ at θ ∈ Γ . It is also closely related to PL condition (Definition 4.3) as Assumption 4.5 implies that L(θ) satisfies µ-PL (for some µ > 0) locally around every θ ∈ Γ on the unit sphere (Arora et al. [8], Lemma B.3). To ease our analysis, we also need the following regularity condition to ensure that the largest eigenvalue is unique. In our experiments, sharpness reduction happens even when the multiplicity of the top eigenvalue is more than 1, but we leave the analysis of that case to future work. Assumption 4.6. For all θ ∈ Γ , λH1 (θ) > λH2 (θ). That is, the top eigenvalue ofH(θ) is unique.",
  "4.2.2 Main Theorem": "First, we define ηin := η̂λ̂ as the intrinsic learning rate (name from Li et al. [78]) for convenience. As suggested in Theorems 4.2 and 4.4, θt can get close to a local minimizer and be in the EoS regime at some step t1: if ζ0 is the local minimizer, then ‖θt1 − ζ0‖2 = O(η1/2in ) and η̃t1 = 2λH1 (ζ0) +O(η 1/2 in ). In our main theorem, we start our analysis from step t1 while setting t1 = 0 WLOG (otherwise we can shift the step numbers). We connect GD+WD in the EoS regime to the following gradient flow (3) on the manifold Γ minimizing spherical sharpness (with gradient-dependent learning rate), and show that one step of GD+WD tracks a time interval of length ηin in the gradient flow.\nζ(0) = ζ0 ∈ Γ , d dτ ζ(τ) = − 2∇Γ log λ H 1 (ζ(τ)) 4 + ‖∇Γ log λH1 (ζ(τ))‖22 . (3)\nHere we use the notation ∇ΓR(θ) for any R : RD → R to denote the projection of ∇R(θ) onto the tangent space Tθ(Γ ) at θ ∈ Γ . ζ(τ) reduces sharpness as it moves in direction of the negative gradient of log λH1 (ζ(τ)) on Γ . A simple chain rule shows how fast the spherical sharpness decreases:\nd dt log λH1 (ζ(τ)) = − 2‖∇Γ log λH1 (ζ(τ))‖22 4 + ‖∇Γ log λH1 (ζ(τ))‖22 ≈ {− 12‖∇Γ log λH1 (ζ(τ))‖22 for small gradient; −2 for large gradient.\nNote that it is not enough to just assume that θ0 is close to ζ0. If θ0 = ζ0 holds exactly, then the subsequent dynamic of wt is described by wt = (1− η̂λ̂)tw0 with direction unchanged. There are also some other bad initial directions of w0 that may not lead to the sharpness-reduction bias. This motivates us to do a smoothed analysis for the initial direction: the initial direction is ζ with tiny random perturbation, where the perturbation scale is allowed to vary from exp(−η−o(1)in ) to η 1/2−o(1) in , and we show that a good initial direction is met with high probability as ηin → 0.1 Alternatively, one can regard it as a modeling of the tiny random noise in GD+WD due to the precision errors in floating-point operations. See Figure 5b; the training loss can never be exactly zero in practice.\nInitialization Scheme. Given a local minimizer ζ0 ∈ Γ , we initializew0 ∈ RD \\ {0} as follows: draw ξ ∼ N (0, σ20I/D) from Gaussian and set the direction of w0 to ζ0+ξ‖ζ0+ξ‖2 , where σ0 can take any value in [exp(−η−o(1)in ), η 1/2−o(1) in ]; then set the parameter norm ‖w0‖2 to be any value that\nsatisfies ∣∣∣η̃0 − 2λH1 (ζ0) ∣∣∣ ≤ η1/2−o(1)in , where η̃0 := η̂(1−η̂λ̂)‖w0‖22 is the effective LR for the first step.\nTheorem 4.7. Under Assumptions 4.5 and 4.6, for GD+WD (1) with sufficiently small intrinsic learning rate ηin := η̂λ̂, if we follow the above initialization scheme for some ζ0 ∈ Γ , then with probability 1 − O(η1/2−o(1)in ), the trajectory of θt := wt‖wt‖2 approximately tracks a sharpnessreduction flow ζ : [0, T ]→ Γ that starts from ζ0 and evolves as the ODE (3) up to time T (if solution exists), in the sense that ‖θt − ζ(tηin)‖2 = O(η1/4−o(1)in ) for all 0 ≤ t ≤ T/ηin. Remark 4.8 (Magnitude of Oscillation). As suggested by Figure 4, θt actually oscillates around the manifold. But according to our analysis, the magnitude of oscillation is as small as O(η1/2−o(1)in ), so it is absorbed into our final bound O(η1/4−o(1)in ) for the distance between θt and ζ(tηin).",
  "4.2.3 Proof Idea": "Throughout our proof, we view GD+WD for wt as a PGD for θt with effective LR η̃t (Lemma 3.1). To track θt with ζ(tηin), for each step t, we construct a local minimizer φt ∈ Γ that serves as the “projection” of θt onto the manifold Γ , in the sense that the displacement xt := θt − φt is approximately perpendicular to the tangent space of Γ atφt. Our entire proof works through induction. According to the initial conditions, the dynamic is initially in the EoS regime: ‖xt‖2 ≤ η1/2−o(1)in and |η̃t − 2/λH1 (φt)| ≤ η1/2−o(1)in at t = 0. In our induction, we maintain the induction hypothesis that these two EoS conditions continue to hold for all t ≥ 0.\n1Here η−o(1)in can be constant, O(log(1/ηin)), or O(polylog(1/ηin)), but not η − in if > 0 is a constant. As mentioned later, this need for random initialization is very similar to the one needed in power method for computing eigenvalues.\nPeriod-Two Oscillation. A key insight in our proof is that after a few initial steps, θt is oscillating around φt along the ±vH1 (θ) directions, where vH1 (θ) is a unit top eigenvector of H(θ) and is chosen in a way that vH1 (θ) is continuous on Γ . More specifically, xt = htv H 1 (φt) +O(‖xt‖22) for ht := 〈xt,vH1 (φt)〉. The oscillation is of period 2: ht > 0 when t is even and ht < 0 when t is odd. See Figure 5d for an example.\nThis oscillation can be connected to a power method for the matrix I − η̃tH(φt). In the EoS regime, we can approximate θt+1 (when xt is small) as θt+1 = Π(θt−η̃t∇L(θt)) ≈ Π(θt−η̃tH(φt)xt) ≈ θt− η̃tH(φt)xt by Taylor expansions of∇L and Π : RD \\ {0} → SD−1. We can further show that φt+1 ≈ φt due to our choice of projections. Then the connection to power method is shown below:\nxt+1 ≈ θt+1 − φt ≈ (I − η̃tH(φt))xt. By simple linear algebra, vH1 (φt) is an eigenvector of I − η̃tH(φt), associated with eigenvalue 1− η̃tλH1 (φt) ≈ −1. The remaining eigenvalues are {1− η̃tλHi (φt)}Di=2, where λHi (φt) is the i-th largest eigenvalue ofH(θt), and they lie in the range (−1, 1] since λHi (φt) ∈ [0, λH1 (φt)). Using a similar analysis to power method, we show that xt quickly aligns to the direction of ±vH1 (φt) after a few initial steps, as the corresponding eigenvalue has approximately the largest absolute value.2\nTo formally establish the above result, we need a tiny initial alignment between x0 and vH1 (φ0), just as the initial condition in power method. This is where we need the initial random perturbation.\nOscillation Drives φt to Move. This period-two oscillation is the driving power to push φt to move on the manifold. The main idea here is to realize that the oscillation direction deviates slightly from the direction of ±vH1 (φt) by using a higher-order approximation. We specifically use the Taylor approximation to show that this deviation leads φt to move slightly on Γ : after each cycle of oscillation, φt+2 ≈ φt − 4h2t∇Γ log λH1 (φt) +O(η1.5−o(1)in ), which resembles two steps of gradient descent on Γ to minimize the logarithm of spherical sharpness with learning rate 2h2t ,\nPeriodic Behavior of ht and η̃t. It remains to analyze the dynamics of ht so that we can know how fast the sharpness reduction is. Our analysis is inspired by an empirical study from Lobacheva et al. [84], which reveals a periodic behavior of gradients and effective learning rates in training normalized nets with weight decay. In our theoretical setting, we capture this periodic behavior by showing that ht and η̃t do evolve periodically. See Figures 5c and 5d for an example.\nThe key is that η̃t changes as an adaptive gradient method: η̃t increases when gradient is small and decreases when gradient is large (due to the effect of WD; see Figures 3a and 3b), and in our case the gradient norm scales as |ht| since∇L(θt) ≈ htλH1 (φt)vH1 (φt). By the power method approximation,\n2Our construction of φt ensures that xt only has a small overlap with the 1-eigenspace of I − η̃tH(φt), so xt can only align to ±vH1 (φt).\nht+2 ≈ (1− η̃tλH1 (φt))2ht, so |ht| decreases when η̃t < 2/λH1 (φt). But |ht| cannot decrease forever, since η̃t increases when |ht| is sufficiently small. When η̃t rises to over 2/λH1 (φt), |ht| changes from decreasing to increasing according to our approximation. But ht cannot increase indefinitely either, since η̃t decreases when |ht| is sufficiently large. A period finishes when η̃t < 2/λH1 (φt) holds again. In our theoretical analysis, we connect this periodic behavior with a 1-dimensional Hamiltonian system (see Appendix H.2), and show that 2h2t in each step can be approximated by its average value in the period without incurring a large error. Further calculations show that this average value is approximately 2ηin\n4+‖∇Γ log λH1 (ζ(tηin))‖2 , the learning rate in the flow (3) multiplied with ηin. We can\ntherefore conclude that each step of φt (or θt) tracks a time interval of ηin in the flow.\nExtensions. We note that this periodic behavior is not limited to GD+WD on scale-invariant loss, since the above intuitive argument holds as long as the effective LR changes adaptively with respect to gradient change. Based on this intuition, an important notion called Quasi-RMSprop scheduler is proposed. For a PGD method, a learning rate scheduler is a rule for changing the effective LR in each step, and Quasi-RMSprop is a specific class of schedulers we define, including the way that the effective LR changes in GD+WD on scale-invariant loss (if viewed as PGD). Our proof is done in a unified way that works as long as the effective LR changes in each step according to a Quasi-RMSprop scheduler. As a by-product, a similar theorem can be proved for GD (without projection) on non-scale-invariant loss if the LR changes as a Quasi-RMSprop in each step. For example, we can extend our analysis to RMSprop with a scalar learning rate. See Appendix B.",
  "5 Case Study: Linear Regression with Batch Normalization": "In this section, we analyze the GD+WD dynamics on linear regression with Batch Normalization (BN), as a simple application of our theory. Let {(xi, yi)}ni=1 be a dataset, where xi ∈ Rd and yi ∈ R are inputs and regression targets. We study the over-parameterized case where d n, and we assume that the regression targets are generated by an unknown linear model.\nA classic linear model is parameterized by (w, b) ∈ Rd × R and outputs w>x + b given input x, but now we add a BN to the output. More specifically, we consider a batch-normalized linear model Φ(x;w, γ, β) := γ · w>x−µ1σ1 + β, where µ1, σ1 are the mean and standard deviation of {w\n>xi}ni=1 over the whole dataset3, and the bias term b is cancelled out due to BN. Note that Φ(x;w, γ, β) is still a linear function with respect to x. Let µx ∈ Rd and Σx ∈ Rd×d be the mean and covariance of the input data {xi}ni=1. Then Φ(x;w, γ, β) can be rewritten as:\nΦ(x;w, γ, β) = w̃>x+ b̃, where w̃ := γw/‖w‖Σx , b̃ := β − w̃>µx. (4) No matter how w is set, the output mean and variance of Φ are always β and γ2. To simplify our analysis, we fix β, γ to be non-trainable constants so that the mean and variance of Φ’s output match with those of {yi}ni=1, that is, we set β = µy and γ = σy to be the mean and standard deviation of yi over the whole dataset. Then the training loss is L(w) := 1n ∑ i∈[n](Φ(xi;w, γ, β)− yi)2.\nTheorem 5.1. In our setting of linear regression with BN, the sharpness-reduction flow ζ defined in (3) converges to the solution w∗ ∈ Sd−1 that minimizes sharpness λH1 (w∗) on Γ , regardless of the initialization. Moreover, the coefficients (w̃, b̃) associated with w∗ (defined in (4)) are the optimal solution of the following constrained optimization problem (M):\nmin ‖w‖22 s.t. w>xi + b = yi, ∀i ∈ [n]. (M) At first sight the result may appear trivial because the intent of WD is to regularize L2-norm. But this is deceptive because in scale-invariant nets the regularization effect of WD is not explicit. This result also challenges conventional view of optimization. GD is usually viewed as a discretization of its continuous counterpart, gradient flow (GF), and theoretical insight for the discrete update including convergence rate and implicit bias is achieved by analyzing the continuous counterpart (See Appendix A for a list). However, GF does not have the same sharpness-reduction bias as GD. As discussed in [77], adding WD only performs a time-rescaling on the GF trajectory on scale-invariant loss, but does not change the point that GF converge to if we project the trajectory onto the unit sphere. One can easily show that GF may converge to any zero-loss solution, but no matter how small\n3Note that the batch size is n here as we are running full-batch GD\nLR is, GD exhibits the sharpness-reduction bias towards the optimal solution of (M). To our best knowledge, this result is the first concrete example where even with arbitrarily small LR, GD can still generalize better than GF under natural settings.",
  "6 Discussion": "Experimental Verification of Sharpness Reduction. Besides Figures 1 and 2, Appendix P.1 provides additional matrix completion experiments with different data size, and Appendix P.2 provides CIFAR-10 experiments with ResNet-20. In all these experiments, we observed that GD continues to improve the test accuracy even after fitting the training set, and this phenomenon is correlated with the decreasing trend of spherical sharpness. See also Appendix P.3 for the validation for the periodic behavior we analyze in theory.\nAblation Studies on Normalization and Weight Decay. Our theoretical analysis crucially relies on the interplay between normalization and WD to establish the sharpness-reduction flow. We also conducted ablation studies on normalization and WD to highlight the importance of this interplay. First, if normalization is removed, the spherical sharpness becomes undefined, and we do not know if GD implicitly minimizes any sharpness measure. But even if a similar measure does exist, it cannot be strongly related to generalization, because we can verify that the test accuracy becomes very bad without normalization (56.8% on CIFAR-10, Figure 14), and continuing training after fitting the training set no longer improves test accuracy. Second, if WD is removed, the analysis in Arora et al. [7] guarantees convergence in the stable regime, and we can verify that the spherical sharpness and test accuracy stop changing when the loss is small. The final test accuracy is stuck at 66.4% (Figure 15), whereas training with WD leads to 84.3%.\nExplaining the Progressive Sharpening and EoS Phenomena. Cohen et al. [24] conducted extensive empirical studies on the dynamics of GD in deep learning (without weight decay), formally wt+1 ← wt − η̂∇L̃(wt). They observed the progressive sharpening phenomenon: λ1(∇2L̃(wt)) tends to increase so long as it is less than 2/η̂. Then they observed that the training typically enters the EoS regime, which they define as a regime that (1) λ1(∇2L̃(wt)) hovers right at, or just above 2/η̂; and (2) the training loss L̃(wt) goes up and down over short timescales, yet still decreases in the long-term run. A recent research trend focuses on explaining the progressive sharpening and EoS phenomena [1, 91, 8, 18]. Our work corresponds to an important special case where L̃(w) is a scale-invariant loss with L2-regularization, namely L(w) + λ̂2 ‖w‖22. By analyzing the interplay between normalization and WD, the first part of our results (Section 4.1) attributes progressive sharpening to norm change, and the second part (Section 4.2) justifies in theory that the training can make progress in the EoS regime. See Appendix G.3 for more discussion.",
  "7 Conclusions and Future Work": "We exhibited settings where gradient descent has an implicit bias to reduce spherical sharpness in training neural nets with normalization layers and weight decay, and we verified experimentally this sharpness-reduction bias predicted by our theorem as well as its generalization benefit on CIFAR-10.\nOur theoretical analysis applies to dynamics around a minimizer manifold and requires a small (but finite) learning rate so that we can show that the parameter oscillates locally and approximately tracks a sharpness-reduction flow. We note that in practice a decrease in spherical sharpness is observed even with moderate LR and even before getting close to a minimizer manifold. Explaining these phenomena is left for future work. Now we list some other future directions. The first is to generalize our results to SGD, where the sharpness measure may not be the spherical sharpness and could depend on the structure of gradient noise. Second, to understand the benefit of reducing spherical sharpness on specific tasks, e.g., why does reducing spherical sharpness encourage low-rank on matrix completion with BN (Figure 1)? Third, to study sharpness-reduction bias for neural net architectures that are not scale-invariant on all parameters (e.g., with certain unnormalized layers).",
  "Acknowledgements": "This work is funded by NSF, ONR, Simons Foundation, DARPA and SRC. ZL is also supported by Microsoft Research PhD Fellowship.",
  "Reviewer Summary": "Reviewer_1: This submission derives model complexity bounds using the idea of transformation-induced sample covering numbers, proposes an algorithm for estimating them, and implements the algorithm on a few data sets.\n\nReviewer_2: The paper provides a bound on the Rademacher complexity of a class of Lipschitz and transformation-invariant functions by upper bounding the covering number of the function class by a similar covering number which uses a \"sample cover induced by data transformations\". This is the induced covering number which accounts for transformations of the original sample set and can be smaller due to the transformation invariance of the function. This directly gives improved generalization bounds for transformation-invariant functions. The paper gives some helpful intuition and simple cases where these bounds may be applied.\nFurthermore, the paper presents experiments in which the sample covering number induced by different transformations is approximated, and the generalization ability of a model which is trained to be invariant to those respective transformations is shown to be strongly correlated with the sample covering number.\n\nReviewer_3: The authors tried to understand the generalization benefit based on the invariant transformation by improving the sample covering number. Although the paper focuses on an interesting question (how model invariance helps generalization), it seems that it is still not in its best shape. I believe this paper will benefit from (a) careful polishment on the writing, (b) some more insightful results, and (c) more experiments on some complex datasets."
}