On Linear Stability of SGD and Input-Smoothness of Neural Networks

Chao Ma, Lexing Ying

Introduction

Stochastic gradient descent (SGD) is the most widely used optimization algorithm to train neural networks . By taking mini-batches of training data instead of all the data in each iteration, it was firstly designed as a substitute of the gradient descent (GD) algorithm to reduce its computational cost. Extensive researches are conducted on the convergence of SGD, both on convex and non-convex objective functions . In these studies, convergence is usually proven in the cases where the learning rate is sufficiently small, hence the gradient noise is small. In practice, however, SGD is preferred over GD not only for the low computational cost, but also for the implicit regularization effect that produces solutions with good generalization performance . Since a trajectory of SGD tends to that of GD when the learning rate goes to , this implicit regularization effect must come from the gradient noise induced by mini-batch and a moderate learning rate.

When studying the gradient noise of SGD, a majority of work treat SGD as an SDE, and studies the noise of the SDE . However, SGD is close to SDE only when the learning rate is small, and it is unclear that in practical setting whether the Gaussian noise of SDE can fully characterize the gradient noise of SGD. Some work resort to heavy-tailed noise like the Levy process . Another perspective to study the behavior of SGD is by its linear stability . This is relevant when the learning rate is not very small. The linear stability theory can explain the fast escape of SGD from sharp minima. The escape time derived from this theory depends on the logarithm of the barrier height, while the escape time derived from the diffusion theory based on SDE depends exponentially on the barrier height . The former is more consistent with empirical observations .

An important observation that connects the generalization performance of the solution with the landscape of the loss function is that flat minima tend to generalize better . SGD is shown to pick flat minima, especially when the learning rate is big and the batch size is small . Algorithms that prefer flat minima are designed to improve generalization . On the other hand, though, the reason why flat minima generalize better is still unclear. Intuitive explanations from description length or Bayesian perspective are provided in and . In , the authors show sharp minimum can also generalize by rescaling the parameters at a flat minimum. Hence, flatness is not a necessary condition of good generalization performance, but it is still possible to be a sufficient condition. In the study of linear stability in , besides the sharpness (a quantity inversely proportional to flatness), another quantity named non-uniformity is proposed which roughly characterizes the second order moment of the gradient noise. It is shown that SGD selects solutions with both low sharpness and low non-uniformity.

In this paper, we build a complete theoretical pipeline to analyze the implicit regularization effect and generalization performance of the solution found by SGD. Our starting points are the following two questions: (1) Why SGD finds flat minima? (2) Why flat minima generalize better? Our answers to these two questions go beyond the flatness and cover the non-uniformity and higher-order moments of the gradient noise. This distinguishes SGD from GD, and is out of the scope that can be explained by SDE. For the first question, we extend the linear stability theory of SGD from the second-order moments of the iterator of the linearized dynamics to the high-order moments. At the interpolation solutions found by SGD, by the linear stability theory, we derive a set of accurate upper bounds of the gradients’ moment. For the second question, using the multiplicative structure of the input layer of neural networks, we show that the upper bounds obtained in the first step regularize the Sobolev seminorms of the model function. Finally, bridging the two components, our main result is a bound of generalization error under some assumptions of the data distribution. The bound works well when the distribution is supported on a low-dimensional manifold (or a union of low-dimensional manifolds). An informal statement of our main result is

(Main result) Around an interpolation solution of the neural network model, assume that (1)the kk-th order moment of SGD’s iterator of the linearized dynamics is stable, (2)with probability at least 1−ε1-\varepsilon the testing data is close to a training data with distance smaller than δ\delta, and (3) both the model function and the target function are upper bounded by a constant MM. Then, at this interpolation solution we have

where nn is the number of data. The bound depends on the learning rate and the batch size of SGD as constant factors.

The formal description is stated in Theorem 6 of Section 5. Our analysis also provide bounds for adversarial robustness. As a byproduct, we theoretically show that flatness of the minimum controls the gradient norm of the model function at the training data. Therefore, searching for flat minima has the effect of Lipschitz regularization, which is shown to be able to improve generalization .

where ∂f(W1x,W2)∂W1x\frac{\partial f(W_{1}\mathbf{x},W_{2})}{\partial W_{1}\mathbf{x}} is usually a long expression produced by back propagation from the output to the first layer. By (1) we have

Hence, from (2) we can obtain the following equation that gives bounds for the gradients of the model function with respect to the input data at the training data,

The left hand side of (4) is usually used to regularize the Lipschitz constant of the model function, and such regularization can improve the generalization performance and adversarial robustness of the model. Hence, (4) reveals the regularization effect of flat minima. Later in the paper, we extend the analysis to higher-order moments of the gradient and combine the results with the linear stability theory of SGD to explain the implicit regularization effect of SGD. We also extend the bound on ∇xf(x,W∗)\nabla_{\mathbf{x}}f(\mathbf{x},W^{*}) from training data to all x\mathbf{x} in a neighborhood of the training data, which implies the regularization of flatness is actually stronger than the left-hand-side of (4).

The strong correlation between ∇Wf(x,W)\nabla_{W}f(\mathbf{x},W) and ∇xf(x,W)\nabla_{\mathbf{x}}f(\mathbf{x},W) is justified by numerical experiments in practical settings. Specifically, in experiments we compare the following two quantities:

Figure 1 shows the results for a fully-connected network trained on FashionMNIST dataset and a VGG-11 network trained on CIFAR10 dataset. In each plot, gWg_{W} and gxg_{\mathbf{x}} of different solutions found by SGD are shown by scatter plots. The plots show strong correlations between the two quantities. The colors of the points show that SGD with big learning rate and small batch size tends to converge to solutions with small gWg_{W} and gxg_{\mathbf{x}}, which is consistent with our theoretical results on the Sobolev regularization effect of SGD. To summarize, the main contributions of this paper are:

We extend the linear stability analysis of SGD to high-order moments of the iterators. At the solutions selected by SGD, we find a class of conditions satisfied by the gradients of different training data. These conditions cover the flatness and non-uniformity, and also include higher order moments. They characterize the regularization effect of SGD beyond GD and SDE.

By exploring the multiplicative structure of the neural networks’ input layer, we build relations between the model function’s derivatives with respect to the parameters and with respect to the inputs. By these relations we turn the conditions obtained for SGD into bounds of different Sobolev (semi)norms of the model function. In particular, we show that flatness of the minimum regularizes the L2L^{2} norm of the gradient of the model function. This explains how the flatness (as well as other stability conditions for SGD) benefits generalization and adversarial robustness.

Still using the multiplicative structure, the bounds for Sobolev seminorms can be extended from the training data to a neighborhood around the training data, based on certain smoothness assumption of the model function (with respect to parameters). Then, bounds for generalization error and adversarial robustness are provided under reasonable assumptions of the data distribution. The bounds work well when the data are distributed effectively in a set that consists of low dimensional manifolds.

Preliminaries

Problem settings

We remark that most neural networks have form (6), including convolutional networks, residual networks, recurrent networks, and even transformers. Note that since the x\mathbf{x} in (6) can also be understood as fixed features calculated using input data, (6) also includes random feature models.

For any i=1,2,...,ni=1,2,...,n, let Li(W)=12(f(xi,W)−yi)2L_{i}(W)=\frac{1}{2}(f(\mathbf{x}_{i},W)-y_{i})^{2} be the loss at xi\mathbf{x}_{i}. Then, the iteration scheme of the SGD with learning rate η\eta and batch size BB is

where ξt=(ξ1t,ξ2t,...,ξBt)\xi^{t}=(\xi^{t}_{1},\xi^{t}_{2},...,\xi^{t}_{B}) is a BB-dimensional random variable uniformly distributed on the BB-tuples in {1,2,...,n}\{1,2,...,n\} and independent with WtW_{t}. In the paper, we study interpolation solutions W∗W^{*} found by SGD, which satisfies f(xi,W∗)=yif(\mathbf{x}_{i},W^{*})=y_{i} for any i=1,2,...,ni=1,2,...,n. Obtaining interpolation solutions is possible in the over-parameterized setting , and is widely studied in existing work .

Some assumptions will be made when deriving the generalization error bounds. Firstly, we assume the model function with respect to the parameter WW to be smooth around W∗W^{*}.

Let δ\delta, CC be positive numbers, and kk be a positive integer. We say the model f(x,W)f(\mathbf{x},W) satisfies the (C,δ,k)(C,\delta,k)-local smoothness condition at data x\mathbf{x} and parameter WW, if for any W′W^{\prime} such that ∥W′−W∥2≤δ\|W^{\prime}-W\|_{2}\leq\delta, there is

In the definition above, we consider the 2k2k-norm of the gradients for the convenience of later analysis. When k=1k=1, the condition (8) becomes ∥∇Wf(x,W′)∥2≤C(∥∇Wf(x,W)∥2+1)\|\nabla_{W}f(\mathbf{x},W^{\prime})\|_{2}\leq C(\|\nabla_{W}f(\mathbf{x},W)\|_{2}+1). This is weaker than local approximation by Taylor expansion, which usually yields results like ∥∇Wf(xi,W)−∇Wf(xi,W∗)∥2≤Cδ\|\nabla_{W}f(\mathbf{x}_{i},W)-\nabla_{W}f(\mathbf{x}_{i},W^{*})\|_{2}\leq C\delta. Here, we only require that the gradient with respect to the parameters does not get exceedingly large when WW is close to W∗W^{*}.

Next, we need the data distribution μ\mu to support roughly on a low dimensional manifold (or a union of low dimensional manifolds), thus the neighborhoods of training data can well cover all test data.

i.e. with high probability a point sampled from μ\mu lies close to a point in {xi}\{\mathbf{x}_{i}\}.

The uniform upper bound κ(x)≤K\kappa(\mathbf{x})\leq K in the above definition can be weakened as an integral upper bound 1VX∫Xκ(x)dx≤K\frac{1}{V_{\mathcal{X}}}\int_{\mathcal{X}}\kappa(\mathbf{x})d\mathbf{x}\leq K, where X=⋃i=1nB(xi,δ)\mathcal{X}=\bigcup_{i=1}^{n}B(\mathbf{x}_{i},\delta) and VXV_{\mathcal{X}} is the Lebesgue volume of X\mathcal{X}.

On the other hand, for positive integer nn and positive constants δ\delta, ε1\varepsilon_{1} and KK, we say μ\mu satisfies the (n,δ,ε1,K)(n,\delta,\varepsilon_{1},K)-scattered condition, if with probability at least 1−ε11-\varepsilon_{1} over the choice of nn i.i.d. sampled data {xi}\{\mathbf{x}_{i}\} from μ\mu, {xi}\{\mathbf{x}_{i}\} is (δ,K)(\delta,K)-scattered.

Later in the analysis of the generalization error (Section 5), we will assume the model and the data distribution satisfy the conditions in Definition 1 and 4 with appropriately chosen constants.

Linear stability theory of SGD

Compared with full-batch GD, SGD adds in each iteration a random “noise” to the gradient of the loss function. Hence, it is harder for SGD to be stable around minima than GD. This is shown by the linear stability theory of SGD.

Recall that the iteration scheme of SGD with learning rate η\eta and batch size BB is given by (7). Let W∗W^{*} be an interpolation solution for the learning problem. When {Wt}\{W_{t}\} is close to W∗W^{*}, the behavior of (7), including its stability around the minimum, can be characterized by the linearized dynamics at W∗W^{*}:

Next, we define the stability of the above dynamics.

In , the following condition on the linear stability for k=2k=2 is provided.

(Theorem 1 in ) The global minimum W∗W^{*} is 2nd2^{\textrm{nd}}-order linearly stable for SGD with learning rate η\eta and batch size BB if

where H=1n∑i=1nHiH=\frac{1}{n}\sum\limits_{i=1}^{n}H_{i}, and Σ=1n∑i=1nHi2−H2\Sigma=\frac{1}{n}\sum\limits_{i=1}^{n}H_{i}^{2}-H^{2}.

Shown by the proposition, the spectra of HH and Σ\Sigma influence the linear stability of SGD. Thus, in the biggest eigenvalue of HH and Σ\Sigma are named sharpness and non-uniformity, respectively. The condition (13) is then be relaxed into a condition of sharpness and non-uniformity. Similar analysis was also conducted in for linear least squares problems.

holds for any A∈Mk+A\in\mathcal{M}_{k}^{+} if kk is an even number, or for any A∈MkA\in\mathcal{M}_{k} is kk is an odd number.

All proofs are provided in the appendix. As a corollary, when k=2k=2, we can write down another sufficient condition for linear stability than Proposition 1. See Corollary 3 in the appendix.

Recall that we let ai=∇Wf(xi,W∗)\bm{a}_{i}=\nabla_{W}f(\mathbf{x}_{i},W^{*}) and Hi=aiaiTH_{i}=\bm{a}_{i}\bm{a}_{i}^{T}. The linear stability conditions in Theorem 1 imply the following bound on the moments of ai\bm{a}_{i}. Specifically, we have

If a global minimum W∗W^{*} is kthk^{\textrm{th}} order linearly stable for SGD with learning rate η\eta and batch size BB, then, for any j∈{1,2,...,p}j\in\{1,2,...,p\}, we have

where ai,j\bm{a}_{i,j} means the jthj^{\textrm{th}} entry of ai\bm{a}_{i}.

By Theorem 2, if a global minimum is stable for SGD with some order, then the gradient moment of this order is controlled. Summing jj from 11 to ww, we have 1n∑i=1n∥∇Wf(xi,W)∥2k2k≤2w(2B)k−1ηk\frac{1}{n}\sum_{i=1}^{n}\left\|\nabla_{W}f(\mathbf{x}_{i},W)\right\|_{2k}^{2k}\leq\frac{2w(2B)^{k-1}}{\eta^{k}}. For k=1k=1 and 22, this gives control to the flatness and non-uniformity of the minimum, respectively. For general kk, applying the Hölder inequality on (18), we have the following corollary which bounds the mean 2k2k-norm of the gradients at the training data.

If a global minimum W∗W^{*} is kthk^{\textrm{th}} order linearly stable for SGD with learning rate η\eta and batch size BB, then

The Sobolev regularization effect

In this section, we build connection between ∇Wf(x,W)\nabla_{W}f(\mathbf{x},W) and ∇xf(x,W)\nabla_{\mathbf{x}}f(\mathbf{x},W) using the multiplication of W1W_{1} and x\mathbf{x}. For general parameterized model, it is hard to build connection between the two gradients. However, this is possible for neural network models, in which the input variable is multiplied with a set of parameters (the first-layer parameter) before any non-linear operation. By this connection, at an interpolation solution that is stable for SGD, we can turn the moments bounds derived in the previous section into the bounds on ∇xf(x,W)\nabla_{\mathbf{x}}f(\mathbf{x},W). For different kk, the moment bound on ∇Wf(x,W)\nabla_{W}f(\mathbf{x},W) controls the Sobolev seminorms of f(⋅,W)f(\cdot,W) at the training data with different index pp. When k=1k=1, this becomes a bound for the sum of gradient square at the training data, which is used in the literature as a regularization term to regularize the Lipschitz constant of the model function. This explains the favorable generalization performance of flat minima.

Combining Corollary 2 with the stability condition in Theorem 2, we have the following control for the Sobolev seminorm of the model function at interpolation solutions that are stable for SGD.

If a global minimum W∗W^{*} which interpolates the training data is kthk^{\textrm{th}} order linearly stable for SGD with learning rate η\eta and batch size BB, and W∗=(W1∗,W2∗)W^{*}=(W_{1}^{*},W_{2}^{*}). Then,

By Corollary 2 and Theorem 3, as long as the data are not very small (in practical problems, the input data are usually normalized), and the input-layer parameters are not very large, the Sobolev seminorms of the model function (evaluated at the training data) is regularized by the linear stability of SGD. The regularization effect on Sobolev seminorm gets stronger for bigger learning rate and smaller batch size. When kk is big, the dependence of the bound with pp is negligible.

Proposition 3 turns the local smoothness condition in the parameter space into a local smoothness condition in the data space. This is made possible by the multiplicative structure of the network’s input layer. Specifically, since in the first layer W1W_{1} and x\mathbf{x} are multiplied together, a perturbation of x\mathbf{x} can be turned to a perturbation of W1W_{1} without changing the value of their product. See the proof of the proposition in Appendix B.2 for more detail.

By the results above, we can obtain the following theorem which estimates the Sobolev seminorm of the model function on a neighborhood of the training data.

Let W∗=(W1∗,W2∗)W^{*}=(W_{1}^{*},W_{2}^{*}) be an interpolation solution that is kthk^{\textrm{th}} order linearly stable for SGD with learning rate η\eta and batch size BB. Let {x1,...,xn}\{\mathbf{x}_{1},...,\mathbf{x}_{n}\} be the training data. Suppose the model f(x,W)f(\mathbf{x},W) satisfies (C,δapprox,k)(C,\delta_{\textrm{approx}},k)-local smoothness condition at W∗W^{*} and xix_{i} for any i=1,2,...,ni=1,2,...,n. Consider the set Xδ:=⋃i=1n{x: ∥x−xi∥≤δ}\mathcal{X}_{\delta}:=\bigcup_{i=1}^{n}\left\{\mathbf{x}:\ \|\mathbf{x}-\mathbf{x}_{i}\|\leq\delta\right\} with δ≤δapprox∥xi∥2/∥W1∗∥2\delta\leq\delta_{\textrm{approx}}\|\mathbf{x}_{i}\|_{2}/\|W_{1}^{*}\|_{2}. Assume {x1,...,xn}\{\mathbf{x}_{1},...,\mathbf{x}_{n}\} satisfies (δ,K)(\delta,K)-scattered condition as defined in Definition 3. Then, we have

where VXδV_{\mathcal{X}_{\delta}} is the Lebesgue volume of Xδ\mathcal{X}_{\delta}.

By Theorem 4, the model function found by SGD is smooth in a neighborhood of the training data, given that the landscape of the model in the parameter space is smooth. When k=1k=1, the results implies that flatness regularizes ∣∇xf(x,W∗)∣1,2,Xδ|\nabla_{\mathbf{x}}f(\mathbf{x},W^{*})|_{1,2,\mathcal{X}_{\delta}}, which is stronger than the gradient square at training data.

The bounds in this section depend on the norm of W1∗W_{1}^{*}. This norm may be big, especially when homogeneous activation functions, such as ReLU, is used. In the ReLU case, for example, we can simply scale the first layer parameters to be arbitrarily large and second layer small while not changing the model function.

However, in practice SGD does not find these solutions with unbalanced layers because the homogeneity of ReLU induces an invariant in parameters. Specifically, let WlW_{l} and Wl−1W_{l-1} be the parameter matrices in the lthl^{\textrm{th}} and (l−1)th(l-1)^{\textrm{th}} layers, then Wl−1TWl−1−WlWlTW_{l-1}^{T}W_{l-1}-W_{l}W_{l}^{T} does not change significantly throughout the training (it is actually fixed in the zero learning rate limit). This invariant keeps layers balanced and prevents the first layer parameters from getting big alone.

On the other hand, we conduct numerical experiments to check the norm of W1W_{1} during training. Table 1 shows the average l2l_{2}-norm of W1W_{1} for the same experiments in part (a) of Figure1. The model is a fully-connected neural network, and the dataset is FashionMNIST. Results show that the norm of W1W_{1} increases at the beginning, but becomes stable afterwards. It will not keep increasing during the training.

Generalization error and adversarial robustness

Let W∗=(W1∗,W2∗)W*=(W_{1}^{*},W_{2}^{*}) be an interpolation solution that is kthk^{\textrm{th}} order linearly stable for SGD with learning rate η\eta and batch size BB. Let {x1,...,xn}\{\mathbf{x}_{1},...,\mathbf{x}_{n}\} be the training data. Suppose the model f(x,W)f(\mathbf{x},W) satisfies (C,δapprox,k)(C,\delta_{\textrm{approx}},k)-local smoothness condition at W∗W^{*} and xi\mathbf{x}_{i} for any 1=1,2,...,n1=1,2,...,n. Recall the definition of Xδ\mathcal{X}_{\delta} in Theorem 4. Then, for any x∈Xδ\mathbf{x}\in\mathcal{X}_{\delta}, we have

With the result above, we can bound the generalization error if most test data are close to the training data, i.e. the data distribution μ\mu satisfies a covered condition. This happens for machine learning problems with sufficient training data, especially for those where the training data lie approximately on a union of some low-dimensional surfaces. This is common in practical problems .

The bound (26) tends to as n→∞n\rightarrow\infty as long as δ\delta decays faster than n−12kn^{-\frac{1}{2k}}. From a geometric perspective, this happens when the dimension of the support of μ\mu is less than kk. And the lower the dimension, the faster the decay. It is possible to get rid of the nn dependency in the bound when kk is sufficiently large. We may use the estimate of Sobolev functions with scattered zeros, e.g. Theorem 4.1 in . We leave the analysis to future work.

Neural network models suffer from adversarial examples , because the model function changes very fast in some directions so the function value becomes very different after a small perturbation. However, the results in Theorem 5 directly imply the adversarial robustness of the model at the training data. Hence, flatness, as well as high-order linear stability conditions, also imply adversarial robustness. Specifically, we have the following theorem.

Let W∗=(W1∗,W2∗)W*=(W_{1}^{*},W_{2}^{*}) be an interpolation solution that is kthk^{\textrm{th}} order linearly stable for SGD with learning rate η\eta and batch size BB. Let {x1,...,xn}\{\mathbf{x}_{1},...,\mathbf{x}_{n}\} be the training data. Suppose the model f(x,W)f(\mathbf{x},W) satisfies (C,δapprox,k)(C,\delta_{\textrm{approx}},k)-local smoothness condition at W∗W^{*} and xi\mathbf{x}_{i} for any 1=1,2,...,n1=1,2,...,n. Then, for any x\mathbf{x} that satisfies ∥x−xi∥2≤δ\|\mathbf{x}-\mathbf{x}_{i}\|_{2}\leq\delta for some i∈{1,...,n}i\in\{1,...,n\} and δ≤δapproxmin⁡i∥xi∥2/∥W1∗∥2\delta\leq\delta_{\textrm{approx}}\min_{i}\|\mathbf{x}_{i}\|_{2}/\|W_{1}^{*}\|_{2}, we have

Conclusion

In this paper, we connect the linear stability theory of SGD with the generalization performance and adversarial robustness of the neural network model. As a corollary, we provide theoretical insights of why flat minimum generalizes better. To achieve the goal, we explore the multiplicative structure of the neural network’s input layer, and build connection between the model’s gradient with respect to the parameters and the gradient with respect to the input data. We show that as long as the landscape on the parameter space is mild, the landscape of the model function with respect to the input data is also mild, hence the flatness (as well as higher order linear stability conditions) has the effect of Sobolev regularization. Our study reveals the significance of the multiplication structure between data (or features in intermediate layers) and parameters. It is an important source of implicit regularization of neural networks and deserves further exploration.

References

Checklist

Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]

Did you describe the limitations of your work? [Yes] Our generalization bounds work on effectively low dimensional problems.

Did you discuss any potential negative societal impacts of your work? [N/A]

Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]

If you are including theoretical results…

Did you state the full set of assumptions of all theoretical results? [Yes] In both Section 2 and the statement of theorems.

Did you include complete proofs of all theoretical results? [Yes]

Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] See Section F and the URL therein.

Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] Section F

Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [N/A]

Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] Section F

If you are using existing assets (e.g., code, data, models) or curating/releasing new assets…

If your work uses existing assets, did you cite the creators? [N/A]

Did you mention the license of the assets? [N/A]

Did you include any new assets either in the supplemental material or as a URL? [N/A]

Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A]

Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A]

If you used crowdsourcing or conducted research with human subjects…

Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]

Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]

Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]

Appendix A Proofs for Section 3

Next, we show the necessity. Let A∈MkA\in\mathcal{M}_{k}, then AA has the following decomposition

For any A∈MkA\in\mathcal{M}_{k} and A≠0A\neq 0, if ∥TkA∥F>∥A∥F\|\mathcal{T}_{k}A\|_{F}>\|A\|_{F}, then lim⁡m→∞∥(Tk)mA∥F=∞\lim\limits_{m\rightarrow\infty}\|(\mathcal{T}_{k})^{m}A\|_{F}=\infty.

Then, a similar construction as in the even case completes the proof.

A.2 Corollary 3 and the proof

The global minimum W∗W^{*} is 2nd2^{\textrm{nd}}-order linearly stable for SGD with learning rate η\eta and batch size BB if

For each i∈{1,2,...,n}i\in\{1,2,...,n\}, HiH_{i} appears in (n−1B−1)\binom{n-1}{B-1} batches, and for each (i,j)(i,j), i,j∈{1,2,...,n}i,j\in\{1,2,...,n\}, HiH_{i} and HjH_{j} appears in (n−2B−2)\binom{n-2}{B-2} batches simultaneously. Hence,

Then, the result is a direct application of Theorem 1.

A.3 Proof of Theorem 2

Next, we will use the following lemma, whose proof is also provided in the appendix.

For any batch I={i1,i2,...,iB}\mathfrak{I}=\{i_{1},i_{2},...,i_{B}\}, let t=η/B∑k=1Baik,j2t=\eta/B\sum_{k=1}^{B}\bm{a}_{i_{k},j}^{2}, we obtain

Taking expectation over batches, by (34) we have

Appendix B Proofs for Section 4

In this proof, ∥⋅∥2k\|\cdot\|_{2k} always means the vector or matrix 2k2k-norm, not the function norm. Then, we have

Since W1W_{1} is a subset of WW, obviously we have

B.2 Proof of Proposition 3

for VV. The linear system above is under-determined, hence solutions exist. We take the minimal norm solution

Let W=(W1,W2∗)W=(W_{1},W_{2}^{*}), then ∥W−W∗∥2=∥W1−W1∗∥F≤δapprox\|W-W^{*}\|_{2}=\|W_{1}-W_{1}^{*}\|_{F}\leq\delta_{\textrm{approx}}. Hence, by (8) we have

This together with (37) completes the proof of (23).

B.3 Proof of Theorem 4

where VBδV_{B_{\delta}} is the volume of B(xi,δ)B(\mathbf{x}_{i},\delta), which does not depend on xi\mathbf{x}_{i}. Sum the above integral up for all training data, we have

Appendix C Proofs for Section 5

for any j=1,2,...,wj=1,2,...,w. Therefore, for any jj,

Hence, for any i=1,2,...,ni=1,2,...,n, ∥∇Wf(xi,W∗)∥2k≤(2nwB)12k2Bη\|\nabla_{W}f(\mathbf{x}_{i},W^{*})\|_{2k}\leq\left(\frac{2nw}{B}\right)^{\frac{1}{2k}}\sqrt{\frac{2B}{\eta}}, which together with Proposition 3 finishes the proof.

C.2 Proof of Theorem 6

Let Xδ=⋃i=1n{x: ∥x−xi∥2≤δ}\mathcal{X}_{\delta}=\bigcup\limits_{i=1}^{n}\left\{\mathbf{x}:\ \|\mathbf{x}-\mathbf{x}_{i}\|_{2}\leq\delta\right\}. Then, we have

In the last line, the dδ\sqrt{d}\delta term comes from

Inserting (44) to (41) yields the result.

Appendix D Additional proofs

We show the following more general result.

where σi\sigma_{i} are eigenvalues of AA. Hence, ∥Ax∥2>∥x∥2\|A\mathbf{x}\|_{2}>\|\mathbf{x}\|_{2} means

which means there exists j∈{1,2,...,n}j\in\{1,2,...,n\} such that yj≠0y_{j}\neq 0 and σi2>1\sigma_{i}^{2}>1. Then,

D.2 Proof of Lemma 2

When t∈[0,1)t\in[0,1), we have tk+(1−t)k≤(t+1−t)k=1t^{k}+(1-t)^{k}\leq(t+1-t)^{k}=1. Hence,

When t≥1t\geq 1, by the Hölder inequality,

Taking kk-th order on both sides, we have

Appendix E Additional Experiments

Except the gWg_{W} and gxg_{\mathbf{x}} in (5), we also checked the gradient norms with higher kk in the same experiment settings. We consider

Figures 2 and 3 show the scatter plot for k=2k=2 and k=3k=3, respectively. The figures shows that in most cases there is still a strong correlation between the gradient norm with respect to WW and the gradient norm with respect to x\mathbf{x}.

The next figure (Figure 4) shows experiment results on more complicated dataset and network architectures, where we trained a 1414-layer Resnet on a subset of the CIFAR100 dataset. The scattered plots show similar results as in Figrue 1, which further justifies our theoretical predictions.

Appendix F Experiment details

In the numerical experiments shown by Figure 1, 2 and 3, we train fully-connected deep neural networks and VGG-like networks on FashionMNIST and CIFAR10, respectively. As shown in the figures, for each network, different learning rates and bacth sizes are chosen. 55 repetitions are conducted for each learning rate and batch size. In each experiment, SGD is used to optimize the network from a random initialization. The SGD is run for 100000100000 iterations to make sure finally the iterator is close to a global minimum. then, gxg_{\mathbf{x}} and gWg_{W} in (5) are evaluated at the parameters given by the last iteration. In the experiments shown in Figure 4, we train a residual network on CIFAR100. Experiments are still repeated by 55 times in each combination of learning rate and batch size. In each experiment, SGD is run for 5000050000 iterations. All experiments are conducted on a MacBook pro 13" only using CPU. See the code at https://github.com/ChaoMa93/Sobolev-Reg-of-SGD.

Dataset

For the FashionMNIST dataset, 5 out of the 10 classes are picked, and 10001000 images are taken for each class. For the CIFAR10 dataset, the first 2 classes are picked with 10001000 images per class. For the CIFAR100 dataset, the first 10 classes for picked with 500500 images in each class.

Network structures

The fully-connected network has 33 hidden layers, with 500500 hidden neurons in each layer. The ReLU activation function is used. The VGG-like network consists of a series of convolution layers and max pooling layers. Each convolution layer has kernel size 3×33\times 3, and is followed by a ReLU activation function. The max poolings have stride 22. The order of the layers are

where each number means a convolutional layer with the number being the number of channels, and “M” means a max pooling layer. A fully-connected layer with width 128128 follows the last max pooling.

The residual network takes conventional architecture of Resnet. It consists of 6 residual blocks. The number of channels in the blocks are 32,32,64,64,128,12832,32,64,64,128,128, from the input block to the output block.