Gradient Descent Maximizes the Margin of Homogeneous Neural Networks

Kaifeng Lyu, Jian Li

Introduction

A major open question in deep learning is why gradient descent or its variants, are biased towards solutions with good generalization performance on the test set. To achieve a better understanding, previous works have studied the implicit bias of gradient descent in different settings. One simple but insightful setting is linear logistic regression on linearly separable data. In this setting, the model is parameterized by a weight vector w{\bm{w}}, and the class prediction for any data point x{\bm{x}} is determined by the sign of w⊤x{\bm{w}}^{\top}{\bm{x}}. Therefore, only the direction w/∥w∥2{\bm{w}}/\|{\bm{w}}\|_{2} is important for making prediction. Soudry et al. (2018a; b); Ji & Telgarsky (2018; 2019c); Nacson et al. (2019c) investigated this problem and proved that the direction of w{\bm{w}} converges to the direction that maximizes the L2L^{2}-margin while the norm of w{\bm{w}} diverges to +∞+\infty, if we train w{\bm{w}} with (stochastic) gradient descent on logistic loss. Interestingly, this convergent direction is the same as that of any regularization path: any sequence of weight vectors {wt}\{{\bm{w}}_{t}\} such that every wt{\bm{w}}_{t} is a global minimum of the L2L^{2}-regularized loss L(w)+λt2∥w∥22\mathcal{L}({\bm{w}})+\frac{\lambda_{t}}{2}\|{\bm{w}}\|_{2}^{2} with λt→0\lambda_{t}\to 0 (Rosset et al., 2004). Indeed, the trajectory of gradient descent is also pointwise close to a regularization path (Suggala et al., 2018).

The aforementioned linear logistic regression can be viewed as a single-layer neural network. A natural and important question is to what extent gradient descent has similiar implicit bias for modern deep neural networks. For theoretical analysis, a natural candidate is to consider homogeneous neural networks. Here a neural network Φ\Phi is said to be (positively) homogeneous if there is a number L>0L>0 (called the order) such that the network output Φ(θ;x)\Phi({\bm{\theta}};{\bm{x}}), where θ{\bm{\theta}} stands for the parameter and x{\bm{x}} stands for the input, satisfies the following:

It is important to note that many neural networks are homogeneous (Neyshabur et al., 2015a; Du et al., 2018). For example, deep fully-connected neural networks or deep CNNs with ReLU or LeakyReLU activations can be made homogeneous if we remove all the bias terms, and the order LL is exactly equal to the number of layers.

In (Wei et al., 2019), it is shown that the regularization path does converge to the max-margin direction for homogeneous neural networks with cross-entropy or logistic loss. This result suggests that gradient descent or gradient flow may also converges to the max-margin direction by assuming homogeneity, and this is indeed true for some sub-classes of homogeneous neural networks. For gradient flow, this convergent direction is proven for linear fully-connected networks (Ji & Telgarsky, 2019a). For gradient descent on linear fully-connected and convolutional networks, (Gunasekar et al., 2018b) formulate a constrained optimization problem related to margin maximization and prove that gradient descent converges to the direction of a KKT point or even the max-margin direction, under various assumptions including the convergence of loss and gradient directions. In an independent work, (Nacson et al., 2019a) generalize the result in (Gunasekar et al., 2018b) to smooth homogeneous models (we will discuss this work in more details in Section 2).

In this paper, we identify a minimal set of assumptions for proving our theoretical results for homogeneous neural networks on classification tasks. Besides homogeneity, we make two additional assumptions:

Exponential-type Loss Function. We require the loss function to have certain exponential tail (see Appendix A for the details). This assumption is not restrictive as it includes the most popular classfication losses: exponential loss, logistic loss and cross-entropy loss.

Separability. The neural network can separate the training data during training (i.e., the neural network can achieve 100%100\% training accuracy)Note that this does NOT mean the training loss is 0..

While the first assumption is natural, the second requires some explanation. In fact, we assume that at some time t0t_{0}, the training loss is smaller than a threshold, and the threshold here is chosen to be so small that the training accuracy is guaranteed to be 100%100\% (e.g., for the logistic loss and cross-entropy loss, the threshold can be set to ln⁡2\ln 2). Empirically, state-of-the-art CNNs for image classification can even fit randomly labeled data easily (Zhang et al., 2017). Recent theoretical work on over-parameterized neural networks (Allen-Zhu et al., 2019; Zou et al., 2018) show that gradient descent can fit the training data if the width is large enough. Furthermore, in order to study the margin, ensuring the training data can be separated is inevitable; otherwise, there is no positive margin between the data and decision boundary.

Our Contribution. Similar to linear models, for homogeneous models, only the direction of parameter θ{\bm{\theta}} is important for making predictions, and one can see that the margin γ(θ)\gamma({\bm{\theta}}) scales linearly with ∥θ∥2L\|{\bm{\theta}}\|_{2}^{L}, when fixing the direction of θ{\bm{\theta}}. To compare margins among θ{\bm{\theta}} in different directions, it makes sense to study the normalized margin, γˉ(θ):=γ(θ)/∥θ∥2L\bar{\gamma}({\bm{\theta}}):=\gamma({\bm{\theta}})/\|{\bm{\theta}}\|_{2}^{L}.

In this paper, we focus on the training dynamics of the network after t0t_{0} (recall that t0t_{0} is a time that the training loss is less than the threshold). Our theoretical results can answer the following questions regarding the normalized margin.

Second, how large is the normalized margin at convergence? To answer this question, we formulate a natural constrained optimization problem which aims to directly maximize the margin. We show that every limit point of {θ(t)/∥θ(t)∥2:t>0}\{{\bm{\theta}}(t)/\left\|{\bm{\theta}}(t)\right\|_{2}:t>0\} is along the direction of a KKT point of the max-margin problem. This indicates that gradient descent/gradient flow performs margin maximization implicitly in deep homogeneous networks. This result can be seen as a significant generalization of previous works (Soudry et al., 2018a; b; Ji & Telgarsky, 2019a; Gunasekar et al., 2018b) from linear classifiers to homogeneous classifiers.

As by-products of the above results, we derive tight asymptotic convergence/growth rates of the loss and weights. It is shown in (Soudry et al., 2018a; b; Ji & Telgarsky, 2018; 2019c) that the loss decreases at the rate of O(1/t)O(1/t), the weight norm grows as O(log⁡t)O(\log t) for linear logistic regression. In this work, we generalize the result by showing that the loss decreases at the rate of O(1/(t(log⁡t)2−2/L))O(1/(t(\log t)^{2-2/L})) and the weight norm grows as O((log⁡t)1/L)O((\log t)^{1/L}) for homogeneous neural networks with exponential loss, logistic loss, or cross-entropy loss.

Experiments.Code available: https://github.com/vfleaking/max-margin The main practical implication of our theoretical result is that training longer can enlarge the normalized margin. To justify this claim empiricaly, we train CNNs on MNIST and CIFAR-10 with SGD (see Section K.1). Results on MNIST are presented in Figure 1. For constant step size, we can see that the normalized margin keeps increasing, but the growth rate is rather slow (because the gradient gets smaller and smaller). Inspired by our convergence results for gradient descent, we use a learning rate scheduling method which enlarges the learning rate according to the current training loss, then the training loss decreases exponentially faster and the normalized margin increases significantly faster as well.

For feedforward neural networks with ReLU activation, the normalized margin on a training sample is closely related to the L2L^{2}-robustness (the L2L^{2}-distance from the training sample to the decision boundary). Indeed, the former divided by a Lipschitz constant is a lower bound for the latter. For example, the normalized margin is a lower bound for the L2L^{2}-robustness on fully-connected networks with ReLU activation (see, e.g., Theorem 4 in (Sokolic et al., 2017)). This fact suggests that training longer may have potential benefits on improving the robustness of the model. In our experiments, we observe noticeable improvements of L2L^{2}-robustness on both training and test sets (see Section K.2).

Related Work

Implicit Bias in Training Linear Classifiers. For linear logistic regression on linearly separable data, Soudry et al. (2018a; b) showed that full-batch gradient descent converges in the direction of the max L2L^{2}-margin solution of the corresponding hard-margin Support Vector Machine (SVM). Subsequent works extended this result in several ways: Nacson et al. (2019c) extended the results to the case of stochastic gradient descent; Gunasekar et al. (2018a) considered other optimization methods; Nacson et al. (2019b) considered other loss functions including those with poly-exponential tails; Ji & Telgarsky (2018; 2019c) characterized the convergence of weight direction without assuming separability; Ji & Telgarsky (2019b) proved a tighter convergence rate for the weight direction.

Those results on linear logistic regression have been generalized to deep linear networks. Ji & Telgarsky (2019a) showed that the product of weights in a deep linear network with strictly decreasing loss converges in the direction of the max L2L^{2}-margin solution. Gunasekar et al. (2018b) showed more general results for gradient descent on linear fully-connected and convolutional networks with exponential loss, under various assumptions on the convergence of the loss and gradient direction.

Margin maximization phenomenon is also studied for boosting methods (Schapire et al., 1998; Rudin et al., 2004; 2007; Schapire & Freund, 2012; Shalev-Shwartz & Singer, 2010; Telgarsky, 2013) and Normalized Perceptron (Ramdas & Pena, 2016).

Implicit Bias in Training Nonlinear Classifiers. Soudry et al. (2018a) analyzed the case where there is only one trainable layer of a ReLU network. Xu et al. (2018) characterized the implicit bias for the model consisting of one single ReLU unit. Our work is closely related to a recent independent work by (Nacson et al., 2019a) which we discuss in details below.

Comparison with (Nacson et al., 2019a). Very recently, (Nacson et al., 2019a) analyzed gradient descent for smooth homogeneous models and proved the convergence of parameter direction to a KKT point of the aforementioned max-margin problem. Compared with their work, our work adopt much weaker assumptions: (1) They assume the training loss converges to , but in our work we only require that the training loss is lower than a small threshold value at some time t0t_{0} (and we prove the exact convergence rate of the loss after t0t_{0}); (2) They assume the convergence of parameter direction Assuming the convergence of the parameter direction may seem quite reasonable, however, the problem here can be quite subtle in theory. In Appendix J, we present a smooth homogeneuous function ff, based on the Mexican hat function (Absil et al. (2005)), such that even the direction of the parameter does not converge along gradient flow (it moves around a cirle when tt increases). , while we prove that KKT conditions hold for all limit points of {θ(t)/∥θ(t)∥2:t>0}\{{\bm{\theta}}(t)/\|{\bm{\theta}}(t)\|_{2}:t>0\}, without requiring any convergence assumption; (3) They assume the convergence of the direction of losses (the direction of the vector whose entries are loss values on every data point) and Linear Independence Constraint Qualification (LICQ) for the max-margin problem, while we do not need such assumptions. Besides the above differences in assumptions, we also prove the monotonicity of the normalized margin and provide tight convergence rate for training loss. We believe both results are interesting in their own right.

Another technical difference is that their work analyzes discrete gradient descent on smooth homogeneous models (which fails to capture ReLU networks). In our work, we analyze both gradient descent on smooth homogeneous models and also gradient flow on homogeneous models which could be non-smooth.

Other Works on Implicit Bias. Banburski et al. (2019) also studied the dynamics of gradient flow and among other things, provided mathematical insights to the implicit bias towards max margin solution for homogeneous networks. We note that their analysis of gradient flow decomposes the dynamics to the tangent component and radial component, which is similar to our proof of Theorem 4.1 in spirit. Wilson et al. (2017); Ali et al. (2019); Gunasekar et al. (2018a) showed that for the linear least-square problem gradient-based methods converge to the unique global minimum that is closest to the initialization in L2L^{2} distance. Du et al. (2019); Jacot et al. (2018); Lee et al. (2019); Arora et al. (2019b) showed that over-parameterized neural networks of sufficient width (or infinite width) behave as linear models with Neural Tangent Kernel (NTK) with proper initialization and gradient descent converges linearly to a global minimum near the initial point. Other related works include (Ma et al., 2019; Gidel et al., 2019; Arora et al., 2019a; Suggala et al., 2018; Blanc et al., 2019; Neyshabur et al., 2015b; a).

Preliminaries

Gradient Descent. We consider the process of training this neural network Φ\Phi with either gradient descent or gradient flow. For gradient descent, we assume the training loss L(θ)\mathcal{L}({\bm{\theta}}) is C2\mathcal{C}^{2}-smooth and describe the gradient descnet process as θ(t+1)=θ(t)−η(t)∇L(θ(t)){\bm{\theta}}(t+1)={\bm{\theta}}(t)-\eta(t)\nabla\mathcal{L}({\bm{\theta}}(t)), where η(t)\eta(t) is the learning rate at time tt and ∇L(θ(t))\nabla\mathcal{L}({\bm{\theta}}(t)) is the gradient of L\mathcal{L} at θ(t){\bm{\theta}}(t).

Gradient Descent / Gradient Flow on Homogeneous Model

Gradient Flow. For gradient flow, we assume the following:

(Regularity). For any fixed x{\bm{x}}, Φ( ⋅ ;x)\Phi(\,\cdot\,;{\bm{x}}) is locally Lipschitz and admits a chain rule;

(Homogeneity). There exists L>0L>0 such that ∀α>0:Φ(αθ;x)=αLΦ(θ;x)\forall\alpha>0:\Phi(\alpha{\bm{\theta}};{\bm{x}})=\alpha^{L}\Phi({\bm{\theta}};{\bm{x}});

(Separability). There exists a time t0t_{0} such that L(θ(t0))<1\mathcal{L}({\bm{\theta}}(t_{0}))<1.

(A1) is a technical assumption about the regularity of the network output. As shown in (Davis et al., 2020), the output of almost every neural network admits a chain rule (as long as the neural network is composed by definable pieces in an o-minimal structure, e.g., ReLU, sigmoid, LeakyReLU).

Gradient Descent. For gradient descent, we assume (A2), (A3), (A4) similarly as for gradient flow, and the following two assumptions (S1) and (S5).

2 Main Theorem: Monotonicity of Normalized Margins

The margin for a single data point (xn,yn)({\bm{x}}_{n},y_{n}) is defined to be qn(θ):=ynΦ(θ;xn)q_{n}({\bm{\theta}}):=y_{n}\Phi({\bm{\theta}};{\bm{x}}_{n}), and the margin for the entire dataset is defined to be qmin⁡(θ):=min⁡n∈[N]qn(θ)q_{\min}({\bm{\theta}}):=\min_{n\in[N]}q_{n}({\bm{\theta}}). By homogenity, the margin qmin⁡(θ)q_{\min}({\bm{\theta}}) scales linearly with ∥θ∥2L\|{\bm{\theta}}\|_{2}^{L} for any fixed direction since qmin⁡(cθ)=cLqmin⁡(θ)q_{\min}(c{\bm{\theta}})=c^{L}q_{\min}({\bm{\theta}}). So we consider the normalized margin defined as below:

We say ff is an ϵ\epsilon-additive approximation for the normalized margin if γˉ−ϵ≤f≤γˉ\bar{\gamma}-\epsilon\leq f\leq\bar{\gamma}, and cc-multiplicative approximation if cγˉ≤f≤γˉc\bar{\gamma}\leq f\leq\bar{\gamma}.

Gradient Flow. Our first result is on the overall trend of the normalized margin γˉ(θ(t))\bar{\gamma}({\bm{\theta}}(t)). For both gradient flow and gradient descent, we identify a smoothed version of the normalized margin, and show that it is non-decreasing during training. More specifically, we have the following theorem for gradient flow.

Gradient Descent. For gradient descent, Theorem 4.1 holds similarly with a slightly different function γ^(θ)\hat{\gamma}({\bm{\theta}}) that approximates γˉ(θ)\bar{\gamma}({\bm{\theta}}) multiplicatively rather than additively.

Under assumptions (S1), (A2) - (A4), (S5), there exists an (1−O(1/(log⁡1L)))(1-O(1/(\log\frac{1}{\mathcal{L}})))-multiplicative approximation function γ^(θ)\hat{\gamma}({\bm{\theta}}) for the normalized margin such that the following statements are true for gradient descent:

For all t>t0t>t_{0}, γ^(θ(t+1))≥γ^(θ(t))\hat{\gamma}({\bm{\theta}}(t+1))\geq\hat{\gamma}({\bm{\theta}}(t));

For all t>t0t>t_{0}, either γ^(θ(t+1))>γ^(θ(t))\hat{\gamma}({\bm{\theta}}(t+1))>\hat{\gamma}({\bm{\theta}}(t)) or θ(t+1)∥θ(t+1)∥2=θ(t)∥θ(t)∥2\frac{{\bm{\theta}}(t+1)}{\|{\bm{\theta}}(t+1)\|_{2}}=\frac{{\bm{\theta}}(t)}{\|{\bm{\theta}}(t)\|_{2}};

L(θ(t))→0\mathcal{L}({\bm{\theta}}(t))\to 0 and ∥θ(t)∥2→∞\|{\bm{\theta}}(t)\|_{2}\to\infty as t→+∞t\to+\infty; therefore, ∣γˉ(θ(t))−γ^(θ(t))∣→0\lvert\bar{\gamma}({\bm{\theta}}(t))-\hat{\gamma}({\bm{\theta}}(t))\rvert\to 0.

Due to the discreteness of gradient descent, the explicit formula for γ^(θ)\hat{\gamma}({\bm{\theta}}) is somewhat technical, and we refer the readers to Appendix E for full details.

It is shown in Theorem 4.1, 4.2 that L(θ(t))→0\mathcal{L}({\bm{\theta}}(t))\to 0 and ∥θ(t)∥2→∞\|{\bm{\theta}}(t)\|_{2}\to\infty. In fact, with a more refined analysis, we can prove tight loss convergence and weight growth rates using the monotonicity of normalized margins.

For gradient flow under assumptions (A1) - (A4) or gradient descent under assumptions (S1), (A2) - (A4), (S5), we have the following tight bounds for training loss and weight norm:

where T=tT=t for gradient flow and T=∑τ=t0t−1η(τ)T=\sum_{\tau=t_{0}}^{t-1}\eta(\tau) for gradient descent.

3 Main Theorem: Convergence to KKT Points

To understand the implicit regularization effect, a natural question arises: what optimality property does the limit of normalized margin have? To this end, we identify a natural constrained optimization problem related to margin maximization, and prove that θ(t){\bm{\theta}}(t) directionally converges to its KKT points, as shown below. We note that we can extend this result to the finite time case, and show that gradient flow or gradient descent passes through an approximate KKT point after a certain amount of time. See Theorem A.9 in Appendix A and Theorem E.4 in Appendix E for the details. We will briefly review the definition of KKT points and approximate KKT points for a constraint optimization problem in Appendix C.1.

For gradient flow under assumptions (A1) - (A4) or gradient descent under assumptions (S1), (A2) - (A4), (S5), any limit point θˉ\bar{{\bm{\theta}}} of {θ(t)∥θ(t)∥2:t≥0}\left\{\frac{{\bm{\theta}}(t)}{\|{\bm{\theta}}(t)\|_{2}}:t\geq 0\right\} is along the direction of a KKT point of the following constrained optimization problem (P):

That is, for any limit point θˉ\bar{{\bm{\theta}}}, there exists a scaling factor α>0\alpha>0 such that αθˉ\alpha\bar{{\bm{\theta}}} satisfies Karush-Kuhn-Tucker (KKT) conditions of (P).

Minimizing (P) over its feasible region is equivalent to maximizing the normalized margin over all possible directions. The proof is as follows. Note that we only need to consider all feasible points θ{\bm{\theta}} with qmin⁡(θ)>0q_{\min}({\bm{\theta}})>0. For a fixed θ{\bm{\theta}}, αθ\alpha{\bm{\theta}} is a feasible point of (P) iff α≥qmin⁡(θ)−1/L\alpha\geq q_{\min}({\bm{\theta}})^{-1/L}. Thus, the minimum objective value over all feasible points of (P) in the direction of θ{\bm{\theta}} is 12∥θ/qmin⁡(θ)1/L∥22=12γˉ(θ)−2/L\frac{1}{2}\|{\bm{\theta}}/q_{\min}({\bm{\theta}})^{1/L}\|_{2}^{2}=\frac{1}{2}\bar{\gamma}({\bm{\theta}})^{-2/L}. Taking minimum over all possible directions, we can conclude that if the maximum normalized margin is γˉ∗\bar{\gamma}_{*}, then the minimum objective of (P) is 12γˉ∗−2/L\frac{1}{2}\bar{\gamma}_{*}^{-2/L}.

It can be proved that (P) satisfies the Mangasarian-Fromovitz Constraint Qualification (MFCQ) (See Lemma C.7). Thus, KKT conditions are first-order necessary conditions for global optimality. For linear models, KKT conditions are also sufficient for ensuring global optimality; however, for deep homogeneous networks, qn(θ)q_{n}({\bm{\theta}}) can be highly non-convex. Indeed, as gradient descent is a first-order optimization method, if we do not make further assumptions on qn(θ)q_{n}({\bm{\theta}}), then it is easy to construct examples that gradient descent does not lead to a normalized margin that is globally optimal. Thus, proving the convergence to KKT points is perhaps the best we can hope for in our setting, and it is an interesting future work to prove stronger convergence results with further natural assumptions.

Moreover, we can prove the following corollary, which characterizes the optimality of the normalized margin using SVM with Neural Tangent Kernel (NTK, introduced in (Jacot et al., 2018)) defined at limit points. The proof is deferred to Appendix C.6.

Assume (S1). Then for gradient flow under assumptions (A2) - (A4) or gradient descent under assumptions (A2) - (A4), (S5), any limit point θˉ\bar{{\bm{\theta}}} of {θ(t)/∥θ(t)∥2:t≥0}\{{\bm{\theta}}(t)/\|{\bm{\theta}}(t)\|_{2}:t\geq 0\} is along the max-margin direction for the hard-margin SVM with kernel Kθˉ(x,x′)=<∇Φx(θˉ),∇Φx′(θˉ)>K_{\bar{{\bm{\theta}}}}({\bm{x}},{\bm{x}}^{\prime})=\left<\nabla\Phi_{{\bm{x}}}(\bar{{\bm{\theta}}}),\nabla\Phi_{{\bm{x}}^{\prime}}(\bar{{\bm{\theta}}})\right>, where Φx(θ):=Φ(θ;x)\Phi_{{\bm{x}}}({\bm{\theta}}):=\Phi({\bm{\theta}};{\bm{x}}). That is, for some α>0\alpha>0, αθˉ\alpha\bar{{\bm{\theta}}} is the optimal solution for the following constrained optimization problem:

If we assume (A1) instead of (S1) for gradient flow, then there exists a mapping h(x)∈∂∘Φx(θˉ){\bm{h}}({\bm{x}})\in\partial^{\circ}\Phi_{{\bm{x}}}(\bar{{\bm{\theta}}}) such that the same conclusion holds for Kθˉ(x,x′)=<h(x),h(x′)>K_{\bar{{\bm{\theta}}}}({\bm{x}},{\bm{x}}^{\prime})=\left<{\bm{h}}({\bm{x}}),{\bm{h}}({\bm{x}}^{\prime})\right>.

4 Other Main Results

The above results can be extended to other settings as shown below.

Then all our results for gradient flow continue to hold (Appendix A). Using a similar modification, we can also extend it to gradient descent (Appendix F).

Cross-entropy Loss. In multi-class classification, we can define qnq_{n} to be the difference between the classification score for the true label and the maximum score for the other labels, then the margin qmin⁡:=min⁡n∈[N]qnq_{\min}:=\min_{n\in[N]}q_{n} and the normalized margin γˉ(θ):=qmin⁡(θ)∥θ∥2L\bar{\gamma}({\bm{\theta}}):=\frac{q_{\min}({\bm{\theta}})}{\|{\bm{\theta}}\|_{2}^{L}} can be similarly defined as before. In Appendix G, we define the smoothed normalized margin for cross-entropy loss to be the same as that for logistic loss (See Remark A.4). Then we show that Theorem 4.1 and Theorem 4.4 still hold (but with a slightly different definition of (P)) for gradient flow, and we also extend the results to gradient descent.

Multi-homogeneous Models. Some neural networks indeed possess a stronger property than homogeneity, which we call multi-homogeneity. For example, the output of a CNN (without bias terms) is 11-homogeneous with respect to the weights of each layer. In general, we say that a neural network Φ(θ;x)\Phi({\bm{\theta}};{\bm{x}}) with θ=(w1,…,wm){\bm{\theta}}=({\bm{w}}_{1},\dots,{\bm{w}}_{m}) is (k1,…,km)(k_{1},\dots,k_{m})-homogeneous if for any x{\bm{x}} and any c1,…,cm>0c_{1},\dots,c_{m}>0, we have Φ(c1w1,…,cmwm;x)=∏i=1mciki⋅Φ(w1,…,wm;x)\Phi(c_{1}{\bm{w}}_{1},\dots,c_{m}{\bm{w}}_{m};{\bm{x}})=\prod_{i=1}^{m}c_{i}^{k_{i}}\cdot\Phi({\bm{w}}_{1},\dots,{\bm{w}}_{m};{\bm{x}}). In the previous example, an LL-layer CNN with layer weights θ=(w1,…,wL){\bm{\theta}}=({\bm{w}}_{1},\dots,{\bm{w}}_{L}) is (1,…,1)(1,\dots,1)-homogeneous.

One can easily see that that (k1,…,km)(k_{1},\dots,k_{m})-homogeneity implies LL-homogeneity, where L=∑i=1mkiL=\sum_{i=1}^{m}k_{i}, so our previous analysis for homogeneous models still applies to multi-homogeneous models. But it would be better to define the normalized margin for multi-homogeneous model as

In this case, the smoothed approximation of γˉ\bar{\gamma} for general binary classification loss (under some conditions) can be similarly defined for gradient flow:

Proof Sketch: Gradient Flow on Homogeneous Model with Exponential Loss

In this section, we present a proof sketch in the case of gradient flow on homogeneous model with exponential loss to illustrate our proof ideas. Due to space limit, the proof for the main theorems on gradient flow and gradient descent in Section 4 are deferred to Appendix A and E respectively.

Lemma 5.1 below is the key lemma in our proof. It decomposes the growth of the smoothed normalized margin into the ratio of two quantities related to the radial and tangential velocity components of θ{\bm{\theta}} respectively. We will give a proof sketch for this later in this section. We believe that this lemma is of independent interest.

For ease of presentation, we ignore the regularity issues of taking derivatives in this proof sketch. We start from the equation dLdt=−<∂∘L(θ(t)),dθdt>=−∥dθdt∥22\frac{d\mathcal{L}}{dt}=-\left<\partial^{\circ}\mathcal{L}({\bm{\theta}}(t)),\frac{d{\bm{\theta}}}{dt}\right>=-\left\|\frac{d{\bm{\theta}}}{dt}\right\|_{2}^{2} which follows from the chain rule (see also Lemma I.3). Then we note that dθdt\frac{d{\bm{\theta}}}{dt} can be decomposed into two parts: the radial component v:=θ^θ^⊤dθdt{\bm{v}}:=\hat{{\bm{\theta}}}\hat{{\bm{\theta}}}^{\top}\frac{d{\bm{\theta}}}{dt} and the tangent component u:=(I−θ^θ^⊤)dθdt{\bm{u}}:=({\bm{I}}-\hat{{\bm{\theta}}}\hat{{\bm{\theta}}}^{\top})\frac{d{\bm{\theta}}}{dt}.

The radial component is easier to analyze. By the chain rule, ∥v∥2=θ^⊤dθdt=1ρ<θ,dθdt>=1ρ⋅12dρ2dt\|{\bm{v}}\|_{2}=\hat{{\bm{\theta}}}^{\top}\frac{d{\bm{\theta}}}{dt}=\frac{1}{\rho}\left<{\bm{\theta}},\frac{d{\bm{\theta}}}{dt}\right>=\frac{1}{\rho}\cdot\frac{1}{2}\frac{d\rho^{2}}{dt}. For 12dρ2dt\frac{1}{2}\frac{d\rho^{2}}{dt}, we have an exact formula:

The last equality is due to <∂∘qn,θ>=Lqn\left<\partial^{\circ}q_{n},{\bm{\theta}}\right>=Lq_{n} by homogeneity of qnq_{n}. This is sometimes called Euler’s theorem for homogeneous functions (see Theorem B.2). For differentiable qnq_{n}, it can be easily proved by taking the derivative over cc on both sides of qn(cθ)=cLqn(θ)q_{n}(c{\bm{\theta}})=c^{L}q_{n}({\bm{\theta}}) and letting c=1c=1.

With (6), we can lower bound 12dρ2dt\frac{1}{2}\frac{d\rho^{2}}{dt} by

where the last inequality uses the fact that e−qmin⁡≤Le^{-q_{\min}}\leq\mathcal{L}. (7) also implies that 12dρ2dt>0\frac{1}{2}\frac{d\rho^{2}}{dt}>0 for t>t0t>t_{0} since L(t0)<1\mathcal{L}(t_{0})<1 and L\mathcal{L} is non-increasing. As ddtlog⁡ρ=12ρ2dρ2dt\frac{d}{dt}\log\rho=\frac{1}{2\rho^{2}}\frac{d\rho^{2}}{dt}, this also proves the first inequality of Lemma 5.1.

Now, we have ∥v∥22=1ρ2(12dρ2dt)2=12dρ2dt⋅ddtlog⁡ρ\left\|{\bm{v}}\right\|_{2}^{2}=\frac{1}{\rho^{2}}\left(\frac{1}{2}\frac{d\rho^{2}}{dt}\right)^{2}=\frac{1}{2}\frac{d\rho^{2}}{dt}\cdot\frac{d}{dt}\log\rho on the one hand; on the other hand, by the chain rule we have dθ^dt=1ρ2(ρdθdt−dρdtθ)=1ρ2(ρdθdt−(θ^⊤dθdt)θ)=uρ\frac{d\hat{{\bm{\theta}}}}{dt}=\frac{1}{\rho^{2}}(\rho\frac{d{\bm{\theta}}}{dt}-\frac{d\rho}{dt}{\bm{\theta}})=\frac{1}{\rho^{2}}(\rho\frac{d{\bm{\theta}}}{dt}-(\hat{{\bm{\theta}}}^{\top}\frac{d{\bm{\theta}}}{dt}){\bm{\theta}})=\frac{{\bm{u}}}{\rho}. So we have

Dividing 12dρ2dt\frac{1}{2}\frac{d\rho^{2}}{dt} on the leftmost and rightmost sides, we have

Discussion and Future Directions

In this paper, we analyze the dynamics of gradient flow/descent of homogeneous neural networks under a minimal set of assumptions. The main technical contribution of our work is to prove rigorously that for gradient flow/descent, the normalized margin is increasing and converges to a KKT point of a natural max-margin problem. Our results leads to some natural further questions:

Can we generalize our results for gradient descent on smooth neural networks to non-smooth ones? In the smooth case, we can lower bound the decrement of training loss by the gradient norm squared, multiplied by a factor related to learning rate. However, in the non-smooth case, no such inequality is known in the optimization literature.

Can we make more structural assumptions on the neural network to prove stronger results? In this work, we use a minimal set of assumptions to show that the convergent direction of parameters is a KKT point. A potential research direction is to identify more key properties of modern neural networks and show that the normalized margin at convergence is locally or globally optimal (in terms of optimizing (P)).

Can we extend our results to neural networks with bias terms? In our experiments, the normalized margin of the CNN with bias also increases during training despite that its output is non-homogeneous. It is very interesting (and technically challenging) to provide a rigorous proof for this fact.

Acknowledgments

The research is supported in part by the National Natural Science Foundation of China Grant 61822203, 61772297, 61632016, 61761146003, and the Zhongguancun Haihua Institute for Frontier Information Technology and Turing AI Institute of Nanjing. We thank Liwei Wang for helpful suggestions on the connection between margin and robustness. We thank Sanjeev Arora, Tianle Cai, Simon Du, Jason D. Lee, Zhiyuan Li, Tengyu Ma, Ruosong Wang for helpful discussions.

References

Appendix A Results for General Loss

We first focus on gradient flow. We assume (A1), (A2) as we do for exponential loss. For (A3), (A4), we replace them with two weaker assumptions (B3), (B4). All the assumptions are listed below:

(Regularity). For any fixed x{\bm{x}}, Φ( ⋅ ;x)\Phi(\,\cdot\,;{\bm{x}}) is locally Lipschitz and admits a chain rule;

(Homogeneity). There exists L>0L>0 such that ∀α>0:Φ(αθ;x)=αLΦ(θ;x)\forall\alpha>0:\Phi(\alpha{\bm{\theta}};{\bm{x}})=\alpha^{L}\Phi({\bm{\theta}};{\bm{x}});

There exists bf≥0b_{f}\geq 0 such that f′(q)qf^{\prime}(q)q is non-decreasing for q∈(bf,+∞)q\in(b_{f},+\infty), and f′(q)q→+∞f^{\prime}(q)q\to+\infty as q→+∞q\to+\infty.

Let g:[f(bf),+∞)→[bf,+∞)g:[f(b_{f}),+\infty)\to[b_{f},+\infty) be the inverse function of ff on the domain [bf,+∞)[b_{f},+\infty). There exists bg≥max⁡{2f(bf),f(2bf)},K≥1b_{g}\geq\max\{2f(b_{f}),f(2b_{f})\},K\geq 1 such that g′(x)≤Kg′(θx)g^{\prime}(x)\leq Kg^{\prime}(\theta x) and f′(y)≤Kf′(θy)f^{\prime}(y)\leq Kf^{\prime}(\theta y) for all x∈(bg,+∞),y∈(g(bg),+∞)x\in(b_{g},+\infty),y\in(g(b_{g}),+\infty) and θ∈[1/2,1)\theta\in[1/2,1).

We summarize the corresponding f,gf,g and bfb_{f} for exponential loss and logistic loss below:

The proof for Remark A.1 is trivial. For Remark A.2, we give a proof below.

By simple calculations, the formulas for f(q),f′(q),g(q),g′(q)f(q),f^{\prime}(q),g(q),g^{\prime}(q) are correct. (B3.1) is trivial. f′(q)=e−q(1+e−q)log⁡(1+e−q)>0f^{\prime}(q)=\frac{e^{-q}}{(1+e^{-q})\log(1+e^{-q})}>0, so (B3.2) is satisfied. For (B3.3), note that f′(q)q=q(1+eq)log⁡(1+e−q)f^{\prime}(q)q=\frac{q}{(1+e^{q})\log(1+e^{-q})}. The denominator is a decreasing function since

A.2 Smoothed Normalized Margin

Assuming (B3)Indeed, (B3.4) is not needed for showing Lemma A.5 and Theorem A.7., we have the following properties about the margin:

f(qmin⁡)−log⁡N≤log⁡1L≤f(qmin⁡)f(q_{\min})-\log N\leq\log\frac{1}{\mathcal{L}}\leq f(q_{\min}).

If log⁡1L>f(bf)\log\frac{1}{\mathcal{L}}>f(b_{f}), then there exists ξ∈(f(qmin⁡)−log⁡N,f(qmin⁡))∩(bf,+∞)\xi\in(f(q_{\min})-\log N,f(q_{\min}))\cap(b_{f},+\infty) such that

(a) can be easily deduced from e−f(qmin⁡)≤L≤Ne−f(qmin⁡)e^{-f(q_{\min})}\leq\mathcal{L}\leq Ne^{-f(q_{\min})}. Combining (a) and the monotonicity of g(⋅)g(\cdot), we further have g(s)≤g(log⁡1L)≤qmin⁡g(s)\leq g(\log\frac{1}{\mathcal{L}})\leq q_{\min} for s:=max⁡{f(bf),f(qmin⁡)−log⁡N}s:=\max\{f(b_{f}),f(q_{\min})-\log N\}. By the mean value Theorem, there exists ξ∈(s,f(qmin⁡))\xi\in(s,f(q_{\min})) such that g(s)=g(f(qmin⁡))−g′(ξ)(f(qmin⁡)−s)≥qmin⁡−g′(ξ)log⁡Ng(s)=g(f(q_{\min}))-g^{\prime}(\xi)(f(q_{\min})-s)\geq q_{\min}-g^{\prime}(\xi)\log N. Dividing ρL\rho^{L} on each side of qmin⁡−g′(ξ)log⁡N≤g(log⁡1L)≤qmin⁡q_{\min}-g^{\prime}(\xi)\log N\leq g(\log\frac{1}{\mathcal{L}})\leq q_{\min} proves (b).

Now we prove (c). Without loss of generality, we assume log⁡1L(θm)>f(bf)\log\frac{1}{\mathcal{L}({\bm{\theta}}_{m})}>f(b_{f}) for all θm{\bm{\theta}}_{m}. It follows from (b) that for every θm{\bm{\theta}}_{m} there exists ξm∈(f(qmin⁡(θm))−log⁡N,f(qmin⁡(θm)))∩(bf,+∞)\xi_{m}\in(f(q_{\min}({\bm{\theta}}_{m}))-\log N,f(q_{\min}({\bm{\theta}}_{m})))\cap(b_{f},+\infty) such that

Note that ξm≥f(qmin⁡(θm))−log⁡N≥log⁡1L(θm)−log⁡N→+∞\xi_{m}\geq f(q_{\min}({\bm{\theta}}_{m}))-\log N\geq\log\frac{1}{\mathcal{L}({\bm{\theta}}_{m})}-\log N\to+\infty. So g(ξm)g′(ξm)=f′(g(ξm))g(ξm)→+∞\frac{g(\xi_{m})}{g^{\prime}(\xi_{m})}=f^{\prime}(g(\xi_{m}))g(\xi_{m})\to+\infty by (B3.3). Also note that there exists a constant B0B_{0} such that γˉ(θm)≤B0\bar{\gamma}({\bm{\theta}}_{m})\leq B_{0} for all mm since γˉ\bar{\gamma} is continuous on the unit sphere Sd−1\mathcal{S}^{d-1}. So we have

A.3 Theorems

Now we state our main theorems. For the monotonicity of the normalized margin, we have the following theorem. The proof is provided in Appendix B.

Under assumptions (A1), (A2), (B3), (B4), the following statements are true for gradient flow:

For the normalized margin at convergence, we have two theorems, one for infinite-time limiting case, and the other being a finite-time quantitative result. Their proofs can be found in Appendix C. As in the exponential loss case, we define the constrained optimization problem (P) as follows:

First, we show the directional convergence of θ(t){\bm{\theta}}(t) to a KKT point of (P).

Consider gradient flow under assumptions (A1), (A2), (B3), (B4). For every limit point θˉ\bar{{\bm{\theta}}} of {θ^(t):t≥0}\left\{\hat{{\bm{\theta}}}(t):t\geq 0\right\}, θˉ/qmin⁡(θˉ)1/L\bar{{\bm{\theta}}}/q_{\min}(\bar{{\bm{\theta}}})^{1/L} is a KKT point of (P).

Second, we show that after finite time, gradient flow can pass through an approximate KKT point.

Consider gradient flow under assumptions (A1), (A2), (B3), (B4). For any ϵ,δ>0\epsilon,\delta>0, there exists r:=Θ(log⁡δ−1)r:=\Theta(\log\delta^{-1}) and Δ:=Θ(ϵ−2)\Delta:=\Theta(\epsilon^{-2}) such that θ/qmin⁡(θ)1/L{\bm{\theta}}/q_{\min}({\bm{\theta}})^{1/L} is an (ϵ,δ)(\epsilon,\delta)-KKT point at some time t∗t_{*} satisfying log⁡∥θ(t∗)∥2∈(r,r+Δ)\log\|{\bm{\theta}}(t_{*})\|_{2}\in(r,r+\Delta).

For the definitions for KKT points and approximate KKT points, we refer the readers to Appendix C.1 for more details.

With a refined analysis, we can also provide tight rates for loss convergence and weight growth. The proof is given in Appendix D.

Under assumptions (A1), (A2), (B3), (B4), we have the following tight rates for loss convergence and weight growth:

Applying Theorem A.10 to exponential loss and logistic loss, in which g(x)=Θ(x)g(x)=\Theta(x), we have the following corollary:

Appendix B Margin Monotonicity for General Loss

In this section, we consider gradient flow and prove Theorem A.7. We assume (A1), (A2), (B3), (B4) as mentioned in Appendix A.

We follow the notations in Section 5 to define ρ:=∥θ∥2\rho:=\|{\bm{\theta}}\|_{2} and θ^:=θ∥θ∥2∈Sd−1\hat{{\bm{\theta}}}:=\frac{{\bm{\theta}}}{\|{\bm{\theta}}\|_{2}}\in\mathcal{S}^{d-1}, and sometimes we view the functions of θ{\bm{\theta}} as functions of tt.

To prove the first two propositions, we generalize our key lemma (Lemma 5.1) to general loss.

Before proving Lemma B.1, we review two important properties of homogeneous functions. Note that these two properties are usually shown for smooth functions. By considering Clarke’s subdifferential, we can generalize it to locally Lipschitz functions that admit chain rules:

That is, ∂∘F(αx)={αk−1h:h∈∂∘F(x)}\partial^{\circ}F(\alpha x)=\{\alpha^{k-1}{\bm{h}}:{\bm{h}}\in\partial^{\circ}F(x)\}.

That is, <x,h>=k⋅F(x)\left<{\bm{x}},{\bm{h}}\right>=k\cdot F({\bm{x}}) for all h∈∂∘F(x){\bm{h}}\in\partial^{\circ}F({\bm{x}}).

Let DD be the set of points x{\bm{x}} such that FF is differentiable at x{\bm{x}}. According to the definition of Clarke’s subdifferential, for proving (a), it is sufficient to show that

Taking limits y→xk{\bm{y}}\to{\bm{x}}_{k} on both sides, we know that the LHS converges to iff the RHS converges to . Then by definition of differetiability and gradient, FF is differentiable at αxk\alpha{\bm{x}}_{k} iff it is differentiable at xk{\bm{x}}_{k}, and ∇F(αxk)=αk−1h\nabla F(\alpha{\bm{x}}_{k})=\alpha^{k-1}{\bm{h}} iff ∇F(xk)=h\nabla F({\bm{x}}_{k})={\bm{h}}. This proves (10).

holds for a.e. α>0\alpha>0. Pick an arbitrary α>0\alpha>0 making (11) hold. Then by (a), (11) is equivalent to ∀h∈∂∘F(x):<x,αk−1h>=kαk−1F(x)\forall{\bm{h}}\in\partial^{\circ}F({\bm{x}}):\left<{\bm{x}},\alpha^{k-1}{\bm{h}}\right>=k\alpha^{k-1}F({\bm{x}}), which proves (b). ∎

Applying Theorem B.2 to homogeneous neural networks, we have the following corollary:

where Φx(θ)=Φ(θ;x)\Phi_{{\bm{x}}}({\bm{\theta}})=\Phi({\bm{\theta}};{\bm{x}}) is the network output for a fixed input x{\bm{x}}.

Corollary B.3 can be used to derive an exact formula for the weight growth during training.

The proof idea is to use Corollary B.3 and chain rules (See Appendix I for chain rules in Clarke’s sense). Applying the chain rule on t↦ρ2=∥θ∥22t\mapsto\rho^{2}=\left\|{\bm{\theta}}\right\|_{2}^{2} yields 12dρ2dt=−<θ,h>\frac{1}{2}\frac{d\rho^{2}}{dt}=-\left<{\bm{\theta}},{\bm{h}}\right> for all h∈∂∘L{\bm{h}}\in\partial^{\circ}\mathcal{L} and a.e. t>0~{}t>0. Then applying the chain rule on θ↦L{\bm{\theta}}\mapsto\mathcal{L}, we have

By Corollary B.3, <θ,hn>=Lqn\left<{\bm{\theta}},{\bm{h}}_{n}\right>=Lq_{n}, and thus 12dρ2dt=L∑n=1Ne−f(qn)f′(qn)qn\frac{1}{2}\frac{d\rho^{2}}{dt}=L\sum_{n=1}^{N}e^{-f(q_{n})}f^{\prime}(q_{n})q_{n}. ∎

For convenience, we define ν(t):=∑n=1Ne−f(qn)f′(qn)qn\nu(t):=\sum_{n=1}^{N}e^{-f(q_{n})}f^{\prime}(q_{n})q_{n} for all t≥0t\geq 0. Then Theorem B.4 can be rephrased as 12dρ2dt=Lν(t)\frac{1}{2}\frac{d\rho^{2}}{dt}=L\nu(t) for a.e. t≥0t\geq 0.

By Lemma A.5, qn≥g(log⁡1L)q_{n}\geq g(\log\frac{1}{\mathcal{L}}) for all n∈[N]n\in[N]. Then by Assumption (B3),

Combining this with the definitions of ν(t)\nu(t) and L\mathcal{L} gives

On the one hand, −dLdt=∥dθdt∥22-\frac{d\mathcal{L}}{dt}=\left\|\frac{d{\bm{\theta}}}{dt}\right\|_{2}^{2} for a.e. t>0t>0 by Lemma I.3; on the other hand, Lν(t)=<θ,dθdt>L\nu(t)=\left<{\bm{\theta}},\frac{d{\bm{\theta}}}{dt}\right> by Theorem B.4. Combining these together yields

By the chain rule, dθ^dt=1ρ(I−θ^θ^⊤)dθdt\frac{d\hat{{\bm{\theta}}}}{dt}=\frac{1}{\rho}({\bm{I}}-\hat{{\bm{\theta}}}\hat{{\bm{\theta}}}^{\top})\frac{d{\bm{\theta}}}{dt} for a.e. t>0t>0. So we have

B.2 Proof for Proposition 3

Therefore, L(t)→0\mathcal{L}(t)\to 0 and ρ(t)→+∞\rho(t)\to+\infty as t→∞t\to\infty.

Integrating on both sides from t0t_{0} to tt, we can conclude that

Note that 1/L1/\mathcal{L} is non-decreasing. If 1/L1/\mathcal{L} does not grow to +∞+\infty, then neither does G(1/L)G(1/\mathcal{L}). But the RHS grows to +∞+\infty, which leads to a contradiction. So L→0\mathcal{L}\to 0.

To make L→0\mathcal{L}\to 0, qmin⁡q_{\min} must converge to +∞+\infty. So ρ→+∞\rho\to+\infty. ∎

Appendix C Convergence to the Max-margin Solution

In this section, we analyze the convergent direction of θ{\bm{\theta}} and prove Theorem A.8 and A.9, assuming (A1), (A2), (B3), (B4) as mentioned in Section A.

We follow the notations in Section 5 to define ρ:=∥θ∥2\rho:=\|{\bm{\theta}}\|_{2} and θ^:=θ∥θ∥2∈Sd−1\hat{{\bm{\theta}}}:=\frac{{\bm{\theta}}}{\|{\bm{\theta}}\|_{2}}\in\mathcal{S}^{d-1}, and sometimes we view the functions of θ{\bm{\theta}} as functions of tt.

We first review the definition of Karush-Kuhn-Tucker (KKT) conditions for non-smooth optimization problems following from (Dutta et al., 2013).

A feasible point x{\bm{x}} of (P) is a KKT point if x{\bm{x}} satisfies KKT conditions: there exists λ1,…,λN≥0\lambda_{1},\dots,\lambda_{N}\geq 0 such that

0∈∂∘f(x)+∑n∈[N]λn∂∘gn(x)0\in\partial^{\circ}f({\bm{x}})+\sum_{n\in[N]}\lambda_{n}\partial^{\circ}g_{n}({\bm{x}});

∀n∈[N]:λngn(x)=0\forall n\in[N]:\lambda_{n}g_{n}({\bm{x}})=0.

It is important to note that a global minimum of (P) may not be a KKT point, but under some regularity assumptions, the KKT conditions become a necessary condition for global optimality. The regularity condition we shall use in this paper is the non-smooth version of Mangasarian-Fromovitz Constraint Qualification (MFCQ) (see, e.g., the constraint qualification (C.Q.5) in (Giorgi et al., 2004)):

Following from (Dutta et al., 2013), we define an approximate version of KKT point, as shown below. Note that this definition is essentially the modified ϵ\epsilon-KKT point defined in their paper, but these two definitions differ in the following two ways: (1) First, in their paper, the subdifferential is allowed to be evaluated in a neighborhood of x{\bm{x}}, so our definition is slightly stronger; (2) Second, their paper fixes δ=ϵ2\delta=\epsilon^{2}, but in our definition we make them independent.

For ϵ,δ>0\epsilon,\delta>0, a feasible point x{\bm{x}} of (P) is an (ϵ,δ)(\epsilon,\delta)-KKT point if there exists λn≥0,k∈∂∘f(x),hn∈∂∘gn(x)\lambda_{n}\geq 0,{\bm{k}}\in\partial^{\circ}f({\bm{x}}),{\bm{h}}_{n}\in\partial^{\circ}g_{n}({\bm{x}}) for all n∈[N]n\in[N] such that

∥k+∑n∈[N]λnhn(x)∥2≤ϵ\left\|{\bm{k}}+\sum_{n\in[N]}\lambda_{n}{\bm{h}}_{n}({\bm{x}})\right\|_{2}\leq\epsilon;

∀n∈[N]:λngn(x)≥−δ\forall n\in[N]:\lambda_{n}g_{n}({\bm{x}})\geq-\delta.

As shown in (Dutta et al., 2013), (ϵ,δ)(\epsilon,\delta)-KKT point is an approximate version of KKT point in the sense that a series of (ϵ,δ)(\epsilon,\delta)-KKT points can converge to a KKT point. We restate their theorem in our setting:

C.2 KKT Conditions for (P)

Recall that for a homogeneous neural network, the optimization problem (P) is defined as follows:

Using the terminologies and notations in Appendix C.1, the objective and constraints are f(x)=12∥x∥22f({\bm{x}})=\frac{1}{2}\|{\bm{x}}\|_{2}^{2} and gn(x)=1−qn(x)g_{n}({\bm{x}})=1-q_{n}({\bm{x}}). The KKT points and approximate KKT points for (P) are defined as follows:

A feasible point θ{\bm{\theta}} of (P) is a KKT point if there exist λ1,…,λN≥0\lambda_{1},\dots,\lambda_{N}\geq 0 such that

θ−∑n=1Nλnhn=0{\bm{\theta}}-\sum_{n=1}^{N}\lambda_{n}{\bm{h}}_{n}={\bm{0}} for some h1,…,hN{\bm{h}}_{1},\dots,{\bm{h}}_{N} satisfying hn∈∂∘qn(θ){\bm{h}}_{n}\in\partial^{\circ}q_{n}({\bm{\theta}});

∀n∈[N]:λn(qn(θ)−1)=0\forall n\in[N]:\lambda_{n}(q_{n}({\bm{\theta}})-1)=0.

A feasible point θ{\bm{\theta}} of (P) is an (ϵ,δ)(\epsilon,\delta)-KKT point of (P) if there exists λ1,…,λN≥0\lambda_{1},\dots,\lambda_{N}\geq 0 such that

∥θ−∑n=1Nλnhn∥2≤ϵ\left\|{\bm{\theta}}-\sum_{n=1}^{N}\lambda_{n}{\bm{h}}_{n}\right\|_{2}\leq\epsilon for some h1,…,hN{\bm{h}}_{1},\dots,{\bm{h}}_{N} satisfying hn∈∂∘qn(θ){\bm{h}}_{n}\in\partial^{\circ}q_{n}({\bm{\theta}});

∀n∈[N]:λn(qn(θ)−1)≤δ\forall n\in[N]:\lambda_{n}(q_{n}({\bm{\theta}})-1)\leq\delta.

By the homogeneity of qnq_{n}, it is easy to see that (P) satisfies MFCQ, and thus KKT conditions are first-order necessary condition for global optimality.

(P) satisfies MFCQ at every feasible point θ{\bm{\theta}}.

Take v:=θ{\bm{v}}:={\bm{\theta}}. For all n∈[N]n\in[N] satisfying qn=1q_{n}=1, by homogeneity of qnq_{n},

holds for any h∈−∂∘qn(θ)=∂∘(1−qn(θ)){\bm{h}}\in-\partial^{\circ}q_{n}({\bm{\theta}})=\partial^{\circ}(1-q_{n}({\bm{\theta}})). ∎

C.3 Key Lemmas

For showing Theorem A.8 and Theorem A.9, we first prove Lemma C.8. In light of this lemma, if we aim to show that θ{\bm{\theta}} is along the direction of an approximate KKT point, we only need to show β→1\beta\rightarrow 1 (which makes ϵ→0\epsilon\rightarrow 0) and L→0\mathcal{L}\rightarrow 0 (which makes δ→0\delta\rightarrow 0).

Let C1,C2C_{1},C_{2} be two constants defined as

Proof for (13).

Note that ∥h∥2≥<h,θ^>=Lν/ρ\left\|{\bm{h}}\right\|_{2}\geq\left<{\bm{h}},\hat{{\bm{\theta}}}\right>=L\nu/\rho. By Lemma B.5 and Lemma D.1, we have

By Theorem A.7, we have already known that L→0\mathcal{L}\to 0. So it remains to bound β(t)\beta(t). For this, we first prove the following lemma to bound the integral of β(t)\beta(t).

By Lemma B.4, ddtlog⁡ρ=12ρ2dρ2dt=Lνρ2\frac{d}{dt}\log\rho=\frac{1}{2\rho^{2}}\frac{d\rho^{2}}{dt}=\frac{L\nu}{\rho^{2}} for a.e. t>0t>0. By Lemma B.1, for a.e. t∈(t1,t2)t\in(t_{1},t_{2}),

By the chain rule, dθ^dt=1ρ(I−θ^θ^⊤)dθdt\frac{d\hat{{\bm{\theta}}}}{dt}=\frac{1}{\rho}({\bm{I}}-\hat{{\bm{\theta}}}\hat{{\bm{\theta}}}^{\top})\frac{d{\bm{\theta}}}{dt}. So we have

where the last equality follows from the definition of β\beta. Combining 14 and 15, we have

Integrating on both sides from t1t_{1} to t2t_{2} proves the lemma. ∎

A direct corollary of Lemma C.9 is the upper bound for the minimum β2−1\beta^{2}-1 within a time interval:

For all t2>t1≥t0t_{2}>t_{1}\geq t_{0}, then there exists t∗∈(t1,t2)t_{*}\in(t_{1},t_{2}) such that

Denote the RHS as CC. Assume to the contrary that β(τ)−2−1>C\beta(\tau)^{-2}-1>C for a.e. τ∈(t1,t2)\tau\in(t_{1},t_{2}). By Lemma B.1, log⁡ρ(τ)>0\log\rho(\tau)>0 for a.e. τ∈(t1,t2)\tau\in(t_{1},t_{2}). Then by Lemma C.9, we have

In the rest of this section, we present both asymptotic and non-asymptotic analyses for the directional convergence by using Corollary C.10 to bound β(t)\beta(t).

C.4 Asymptotic Analysis

We first prove an auxiliary lemma which gives an upper bound for the change of θ^\hat{{\bm{\theta}}}.

Note that every summand is positive. By Lemma A.5, qnq_{n} is lower-bounded by qn≥qmin⁡≥g(log⁡1L)q_{n}\geq q_{\min}\geq g(\log\frac{1}{\mathcal{L}}), so we can replace qnq_{n} with g(log⁡1L)g(\log\frac{1}{\mathcal{L}}) in the above inequality. Combining with the fact that ∑n∈[N]e−f(qn)f′(qn)qn\sum_{n\in[N]}e^{-f(q_{n})}f^{\prime}(q_{n})q_{n} is just ν\nu, we have

To prove Theorem A.8, we consider each limit point θˉ/qmin⁡(θˉ)1/L\bar{{\bm{\theta}}}/q_{\min}(\bar{{\bm{\theta}}})^{1/L}, and construct a series of approximate KKT points converging to it. Then θˉ/qmin⁡(θˉ)1/L\bar{{\bm{\theta}}}/q_{\min}(\bar{{\bm{\theta}}})^{1/L} can be shown to be a KKT point by Theorem C.4. The following lemma ensures that such construction exists.

Let sm′>sms^{\prime}_{m}>s_{m} be a time such that log⁡ρ(sm′)=log⁡ρ(sm)+ϵm\log\rho(s^{\prime}_{m})=\log\rho(s_{m})+\epsilon_{m}. According to Theorem A.7, log⁡ρ→+∞\log\rho\to+\infty, so sm′s^{\prime}_{m} must exist. We construct tm∈(sm,sm′)t_{m}\in(s_{m},s^{\prime}_{m}) to be a time that β(tm)−2−1≤ϵm2\beta(t_{m})^{-2}-1\leq\epsilon_{m}^{2}, where the existence can be shown by Corollary C.10.

Now we show that this construction meets our requirement. It follows from β(tm)−2−1≤ϵm2\beta(t_{m})^{-2}-1\leq\epsilon_{m}^{2} that β(tm)≥1/1+ϵm2→1\beta(t_{m})\geq 1/\sqrt{1+\epsilon_{m}^{2}}\to 1. By Lemma C.11, we also know that

C.5 Non-asymptotic Analysis

C.6 Proof for Corollary 4.5

By the homogeneity of qnq_{n}, we can characterize KKT points using kernel SVM.

If θ∗{\bm{\theta}}_{*} is KKT point of (P), then there exists hn∈∂∘Φxn(θ∗){\bm{h}}_{n}\in\partial^{\circ}\Phi_{{\bm{x}}_{n}}({\bm{\theta}}_{*}) for n∈[N]n\in[N] such that 1Lθ∗\frac{1}{L}{\bm{\theta}}_{*} is an optimal solution for the following constrained optimization problem (Q):

It is easy to see that (Q) is a convex optimization problem. For θ=2Lθ∗{\bm{\theta}}=\frac{2}{L}{\bm{\theta}}_{*}, from Theorem B.2, we can see that yn<θ,hn>=2qn(θ∗)≥2>1y_{n}\left<{\bm{\theta}},{\bm{h}}_{n}\right>=2q_{n}({\bm{\theta}}_{*})\geq 2>1, which implies Slater’s condition. Thus, we only need to show that 1Lθ∗\frac{1}{L}{\bm{\theta}}_{*} satisfies KKT conditions for (Q).

By the KKT conditions for (P), we can construct hn∈∂∘qn(θ∗){\bm{h}}_{n}\in\partial^{\circ}q_{n}({\bm{\theta}}_{*}) for n∈[N]n\in[N] such that θ∗−∑n=1Nλnynhn=0{\bm{\theta}}_{*}-\sum_{n=1}^{N}\lambda_{n}y_{n}{\bm{h}}_{n}={\bm{0}} for some λ1,…,λN≥0\lambda_{1},\dots,\lambda_{N}\geq 0 and λn(qn(θ∗)−1)=0\lambda_{n}(q_{n}({\bm{\theta}}_{*})-1)=0. Thus, 1Lθ∗\frac{1}{L}{\bm{\theta}}_{*} satisfies

1Lθ∗−∑n=1N1Lλnynhn=0\frac{1}{L}{\bm{\theta}}_{*}-\sum_{n=1}^{N}\frac{1}{L}\lambda_{n}y_{n}{\bm{h}}_{n}={\bm{0}};

1Lλn(yn<1Lθ∗,hn>−1)=1Lλn(qn(θ)−1)≥0\frac{1}{L}\lambda_{n}\left(y_{n}\left<\frac{1}{L}{\bm{\theta}}_{*},{\bm{h}}_{n}\right>-1\right)=\frac{1}{L}\lambda_{n}\left(q_{n}({\bm{\theta}})-1\right)\geq 0.

So 1Lθ∗\frac{1}{L}{\bm{\theta}}_{*} satisfies KKT conditions for (Q). ∎

Now we prove Corollary 4.5 in Section 4.3.

By Theorem A.8, every limit point θˉ\bar{{\bm{\theta}}} is along the direction of a KKT point of (P). Combining this with Lemma C.13, we know that every limit point θˉ\bar{{\bm{\theta}}} is also along the max-margin direction of (Q).

For smooth models, hn{\bm{h}}_{n} in (Q) is exactly the gradient ∇Φxn(θˉ)\nabla\Phi_{{\bm{x}}_{n}}(\bar{{\bm{\theta}}}). So, (Q) is the optimization problem for SVM with kernel Kθˉ(x,x′)=<∇Φx(θˉ),∇Φx′(θˉ)>K_{\bar{{\bm{\theta}}}}({\bm{x}},{\bm{x}}^{\prime})=\left<\nabla\Phi_{{\bm{x}}}(\bar{{\bm{\theta}}}),\nabla\Phi_{{\bm{x}}^{\prime}}(\bar{{\bm{\theta}}})\right>. For non-smooth models, we can construct an arbitrary function h(x)∈∂∘Φx(θˉ){\bm{h}}({\bm{x}})\in\partial^{\circ}\Phi_{{\bm{x}}}(\bar{{\bm{\theta}}}) that ensures h(xn)=hn{\bm{h}}({\bm{x}}_{n})={\bm{h}}_{n}. Then, (Q) is the optimization problem for SVM with kernel Kθˉ(x,x′)=<h(x),h(x′)>K_{\bar{{\bm{\theta}}}}({\bm{x}},{\bm{x}}^{\prime})=\left<{\bm{h}}({\bm{x}}),{\bm{h}}({\bm{x}}^{\prime})\right>. ∎

Appendix D Tight Bounds for Loss Convergence and Weight Growth

In this section, we give proof for Theorem A.10, which gives tight bounds for loss convergence and weight growth under Assumption (A1), (A2), (B3), (B4).

Before proving Theorem A.10, we show some consequences of (B3.4).

For all x∈[bg,+∞)x\in[b_{g},+\infty), g(x)g′(x)∈[12Kx,2Kx]\frac{g(x)}{g^{\prime}(x)}\in[\frac{1}{2K}x,2Kx];

For all y∈[g(bg),+∞)y\in[g(b_{g}),+\infty), f(y)f′(y)∈[12Ky,2Ky]\frac{f(y)}{f^{\prime}(y)}\in[\frac{1}{2K}y,2Ky].

Thus, g(x)=Θ(xg′(x)),f(y)=Θ(yf′(y))g(x)=\Theta(xg^{\prime}(x)),f(y)=\Theta(yf^{\prime}(y)).

To prove Item 1, it is sufficient to show that

To prove Item 2, we only need to notice that Item 1 implies yf′(y)=g(f(y))g′(f(y))∈[12Kf(y),2Kf(y)]yf^{\prime}(y)=\frac{g(f(y))}{g^{\prime}(f(y))}\in[\frac{1}{2K}f(y),2Kf(y)] for all y∈[g(bg),+∞)y\in[g(b_{g}),+\infty). ∎

Recall that (B3.4) directly implies that f′(Θ(x))=Θ(f′(x))f^{\prime}(\Theta(x))=\Theta(f^{\prime}(x)) and g′(Θ(x))=Θ(g′(x))g^{\prime}(\Theta(x))=\Theta(g^{\prime}(x)). Combining this with Lemma D.1, we have the following corollary:

f(Θ(x))=Θ(f(x))f(\Theta(x))=\Theta(f(x)) and g(Θ(x))=Θ(g(x))g(\Theta(x))=\Theta(g(x)).

Also, note that Lemma D.1 essentially shows that (log⁡f(x))′=Θ(1/x)(\log f(x))^{\prime}=\Theta(1/x) and (log⁡g(x))′=Θ(1/x)(\log g(x))^{\prime}=\Theta(1/x). So log⁡f(x)=Θ(log⁡x)\log f(x)=\Theta(\log x) and log⁡g(x)=Θ(log⁡x)\log g(x)=\Theta(\log x), which means that ff and gg grow at most polynomially.

f(x)=xΘ(1)f(x)=x^{\Theta(1)} and g(x)=xΘ(1)g(x)=x^{\Theta(1)}.

D.2 Proof for Theorem A.10

We follow the notations in Section 5 to define ρ:=∥θ∥2\rho:=\|{\bm{\theta}}\|_{2} and θ^:=θ∥θ∥2∈Sd−1\hat{{\bm{\theta}}}:=\frac{{\bm{\theta}}}{\|{\bm{\theta}}\|_{2}}\in\mathcal{S}^{d-1}, and sometimes we view the functions of θ{\bm{\theta}} as functions of tt. And we use the notations B0,B1B_{0},B_{1} from Appendix C.3.

The key idea to prove Theorem A.10 is to utilize Lemma B.6, in which L(t)\mathcal{L}(t) is bounded from above by 1G−1(Ω(t))\frac{1}{G^{-1}(\Omega(t))}. So upper bounding L(t)\mathcal{L}(t) reduces to lower bounding G−1G^{-1}. In the following lemma, we obtain tight asymptotic bounds for G(⋅)G(\cdot) and G−1(⋅)G^{-1}(\cdot):

For function G(⋅)G(\cdot) defined in Lemma B.6 and its inverse function G−1(⋅)G^{-1}(\cdot), we have the following bounds:

We first prove the bounds for G(x)G(x), and then prove the bounds for G−1(y)G^{-1}(y).

Let CG=∫1/L(t0)exp⁡(bg)g′(log⁡u)2g(log⁡u)2−2/LduC_{G}=\int_{1/\mathcal{L}(t_{0})}^{\exp(b_{g})}\frac{g^{\prime}(\log u)^{2}}{g(\log u)^{2-2/L}}du. For x≥exp⁡(bg)x\geq\exp(b_{g}),

On the other hand, for x≥exp⁡(2bg)x\geq\exp(2b_{g}), we have

Let x=G−1(y)x=G^{-1}(y) for y≥0y\geq 0. G(x)G(x) always has a finite value whenever xx is finite. So x→+∞x\to+\infty when y→+∞y\to+\infty. According to the first part of the proof, we know that y=Θ(g(log⁡x)2/L(log⁡x)2x)y=\Theta\left(\frac{g(\log x)^{2/L}}{(\log x)^{2}}x\right). Taking logarithm on both sides and using Corollary D.3, we have log⁡y=Θ(log⁡x)\log y=\Theta(\log x). By Corollary D.2, g(log⁡y)=g(Θ(log⁡x))=Θ(g(log⁡x))g(\log y)=g(\Theta(\log x))=\Theta(g(\log x)). Therefore,

This implies that x=Θ((log⁡y)2g(log⁡y)2/Ly)x=\Theta\left(\frac{(\log y)^{2}}{g(\log y)^{2/L}}y\right). ∎

For other bounds, we derive them as follows. We first show that g(log⁡1L)=Θ(ρL)g(\log\frac{1}{\mathcal{L}})=\Theta(\rho^{L}). With this equivalence, we derive an upper bound for the gradient at each time tt in terms of L\mathcal{L}, and take an integration to bound L(t)\mathcal{L}(t) from below. Now we have both lower and upper bounds for L(t)\mathcal{L}(t). Plugging these two bounds to g(log⁡1L)=Θ(ρL)g(\log\frac{1}{\mathcal{L}})=\Theta(\rho^{L}) gives the lower and upper bounds for ρ(t)\rho(t).

We first prove the upper bound for L\mathcal{L}. Then we derive lower and upper bounds for ρ\rho in terms of L\mathcal{L}, and use these bounds to give a lower bound for L\mathcal{L}. Finally, we plug in the tight bounds for L\mathcal{L} to obtain the lower and upper bounds for ρ\rho in terms of tt.

Upper Bounding ℒℒ\mathcal{L}.

By Lemma B.6, we have 1L≥G−1(Ω(t))\frac{1}{\mathcal{L}}\geq G^{-1}\left(\Omega(t)\right). Using Lemma D.4, we have 1L=Ω((log⁡t)2g(log⁡t)2/Lt)\frac{1}{\mathcal{L}}=\Omega\left(\frac{(\log t)^{2}}{g(\log t)^{2/L}}t\right), which completes the proof.

Bounding ρ𝜌\rho in Terms of ℒℒ\mathcal{L}.

Lower Bounding ℒℒ\mathcal{L}.

Let h1,…,hN{\bm{h}}_{1},\dots,{\bm{h}}_{N} be a set of vectors such that hn∈∂qn∂θ{\bm{h}}_{n}\in\frac{\partial q_{n}}{\partial{\bm{\theta}}} and

By (17) and Corollary D.2, f′(qn)=f′(O(ρL))=f′(O(g(log⁡1L)))=O(f′(g(log⁡1L)))=O(1/g′(log⁡1L))f^{\prime}(q_{n})=f^{\prime}(O(\rho^{L}))=f^{\prime}(O(g(\log\frac{1}{\mathcal{L}})))=O(f^{\prime}(g(\log\frac{1}{\mathcal{L}})))=O(1/g^{\prime}(\log\frac{1}{\mathcal{L}})). Again by (17), we have ∥hn∥2≤B1ρL−1=O(g(log⁡1L)1−1/L)\left\|{\bm{h}}_{n}\right\|_{2}\leq B_{1}\rho^{L-1}=O(g(\log\frac{1}{\mathcal{L}})^{1-1/L}). Combining these two bounds together, it follows from Corollary D.2 that

By definition of G(⋅)G(\cdot), this implies that there exists a constant cc such that ddtG(1L)≤c\frac{d}{dt}G(\frac{1}{\mathcal{L}})\leq c for any L\mathcal{L} that is small enough. We can complete our proof by applying Lemma D.4.

Bounding ρ𝜌\rho in Terms of t𝑡t.

By (17) and the tight bound for L(t)\mathcal{L}(t), ρL=Θ(g(log⁡1L))=Θ(g(Θ(log⁡t)))\rho^{L}=\Theta(g(\log\frac{1}{\mathcal{L}}))=\Theta(g(\Theta(\log t))). Using Corollary D.2, we can conclude that ρL=Θ(g(log⁡t))\rho^{L}=\Theta(g(\log t)). ∎

Appendix E Gradient Descent: Smooth Homogeneous Models with Exponential Loss

In this section, we discretize our proof to prove similar results for gradient descent on smooth homogeneous models. As usual, the update rule of gradient descent is defined as

Here η(t)\eta(t) is the learning rate, and ∇L(t):=∇L(θ(t))\nabla\mathcal{L}(t):=\nabla\mathcal{L}({\bm{\theta}}(t)) is the gradient of L\mathcal{L} at θ(t){\bm{\theta}}(t).

We first focus on the exponential loss. At the end of this section (Appendix F), we discuss how to extend the proof to general loss functions with a similar assumption as (B3).

Technically, recall that dLdt=−∥∇L∥22\frac{d\mathcal{L}}{dt}=-\|\nabla\mathcal{L}\|_{2}^{2} does not hold exactly for gradient descent. However, if the smoothness can be bounded by s(t)s(t), then it is well-known that

As stated in Section 4.1, we assume (A2), (A3), (A4) similarly as for gradient flow, and two additional assumptions (S1) and (S5).

(Homogeneity). There exists L>0L>0 such that ∀α>0:Φ(αθ;x)=αLΦ(θ;x)\forall\alpha>0:\Phi(\alpha{\bm{\theta}};{\bm{x}})=\alpha^{L}\Phi({\bm{\theta}};{\bm{x}});

(Separability). There exists a time t0t_{0} such that L(θ(t0))<1\mathcal{L}({\bm{\theta}}(t_{0}))<1.

(Learing rate condition). ∑t≥0η(t)=+∞\sum_{t\geq 0}\eta(t)=+\infty and η(t)≤H(L(θ(t)))\eta(t)\leq H(\mathcal{L}({\bm{\theta}}(t))).

Here H(L)H(\mathcal{L}) is a function of the current training loss. The explicit formula of H(L)H(\mathcal{L}) is given below:

where CηC_{\eta} is a constant, and κ(x),μ(x)\kappa(x),\mu(x) are two non-decreasing functions. For constant learning rate η(t)=η0\eta(t)=\eta_{0}, (S5) is satisfied when η0\eta_{0} if sufficiently small.

Roughly speaking, Cηκ(x)C_{\eta}\kappa(x) is an upper bound for the smoothness of L\mathcal{L} in a neighborhood of θ{\bm{\theta}} when x=L(θ)x=\mathcal{L}({\bm{\theta}}). And we set the learning rate η(t)\eta(t) to be the inverse of the smoothness multiplied by a factor μ(x)=o(1)\mu(x)=o(1). In our analysis, μ(x)\mu(x) can be any non-decreasing function that maps (0,L(t0)](0,\mathcal{L}(t_{0})] to (0,1/2](0,1/2] and makes the integral ∫01/2μ(x)dx\int_{0}^{1/2}\mu(x)dx exist. But for simplicity, we define μ(x)\mu(x) as

The value of CηC_{\eta} will be specified later. The definition of κ(x)\kappa(x) depends on LL. For 0<L≤10<L\leq 1, we define κ(x)\kappa(x) as

where κmax⁡:=e(2−2/L)(ln⁡(2−2/L)−1)\kappa_{\max}:=e^{(2-2/L)(\ln(2-2/L)-1)}. The specific meaning of Cη,κ(x)C_{\eta},\kappa(x) and μ(x)\mu(x) will become clear in our analysis.

E.2 Smoothed Normalized Margin

Here ϕ:(0,L(t0)]→(0,+∞)\phi:(0,\mathcal{L}(t_{0})]\to(0,+\infty) is constructed as follows. Construct the first-order derivative of ϕ(x)\phi(x) as

where λ(x):=(log⁡1x)−1\lambda(x):=(\log\frac{1}{x})^{-1}. And then we set ϕ(x)\phi(x) to be

γ^(θ)\hat{\gamma}({\bm{\theta}}) is well-defined for L(θ)≤L(t0)\mathcal{L}({\bm{\theta}})\leq\mathcal{L}(t_{0}) and has the following properties:

First we verify that γ^\hat{\gamma} is well-defined. To see this, we only need to verify that

exists for all x∈(0,L(t0)]x\in(0,\mathcal{L}(t_{0})], then it is trivial to see that ϕ′(w)\phi^{\prime}(w) is indeed the derivative of ϕ(w)\phi(w) by I′(x)=ϕ′(x)+1xlog⁡1xI^{\prime}(x)=\phi^{\prime}(x)+\frac{1}{x\log\frac{1}{x}}.

Note that I(x)I(x) exists for all x∈(0,L(t0)]x\in(0,\mathcal{L}(t_{0})] as long as I(x)I(x) exists for a small enough x>0x>0. By definition, it is easy to verify that r(w):=1+2(1+λ(w)/L)μ(w)wlog⁡1wr(w):=\frac{1+2(1+\lambda(w)/L)\mu(w)}{w\log\frac{1}{w}} is decreasing when ww is small enough. Thus, for a small enough w>0w>0, we have

So we have the following for small enough xx:

To prove (b), we combine (19) and (20), then for small enough L(θm)\mathcal{L}({\bm{\theta}}_{m}), we have

So γ^(θ)γˉ(θ)=1−O((log⁡1L(θm))−1)→1\frac{\hat{\gamma}({\bm{\theta}})}{\bar{\gamma}({\bm{\theta}})}=1-O\left((\log\frac{1}{\mathcal{L}({\bm{\theta}}_{m})})^{-1}\right)\to 1. ∎

Now we specify the value of CηC_{\eta}. By (S1) and (S2), we can define B0,B1,B2B_{0},B_{1},B_{2} as follows:

Then we set Cη:=12(B12+ρ(t0)−LB2)min⁡{γ^(t0)−2+2/L,B0−2+2/L}C_{\eta}:=\frac{1}{2}\left(B_{1}^{2}+\rho(t_{0})^{-L}B_{2}\right)\min\left\{\hat{\gamma}(t_{0})^{-2+2/L},B_{0}^{-2+2/L}\right\}.

E.3 Theorems

Now we state our main theorems for the monotonicity of the normalized margin and the convergence to KKT points. We will prove Theorem E.2 in Appendix E.4, and prove Theorem E.3 and E.4 in Appendix E.5.

Under assumptions (S1), (A2) - (A4), (S5), the following are true for gradient descent:

For all t≥t0t\geq t_{0}, γ^(t+1)≥γ^(t)\hat{\gamma}(t+1)\geq\hat{\gamma}(t);

For all t≥t0t\geq t_{0}, either γ^(t+1)>γ^(t)\hat{\gamma}(t+1)>\hat{\gamma}(t) or θ^(t+1)=θ^(t)\hat{{\bm{\theta}}}(t+1)=\hat{{\bm{\theta}}}(t);

Consider gradient flow under assumptions (S1), (A2) - (A4), (S5). For every limit point θˉ\bar{{\bm{\theta}}} of {θ^(t):t≥0}\left\{\hat{{\bm{\theta}}}(t):t\geq 0\right\}, θˉ/qmin⁡(θˉ)1/L\bar{{\bm{\theta}}}/q_{\min}(\bar{{\bm{\theta}}})^{1/L} is a KKT point of (P).

Consider gradient descent under assumptions (S1), (A2) - (A4), (S5). For any ϵ,δ>0\epsilon,\delta>0, there exists r:=Θ(log⁡δ−1)r:=\Theta(\log\delta^{-1}) and Δ:=Θ(ϵ−2)\Delta:=\Theta(\epsilon^{-2}) such that θ/qmin⁡(θ)1/L{\bm{\theta}}/q_{\min}({\bm{\theta}})^{1/L} is an (ϵ,δ)(\epsilon,\delta)-KKT point at some time t∗t_{*} satisfying log⁡ρ(t∗)∈(r,r+Δ)\log\rho(t_{*})\in(r,r+\Delta).

With a refined analysis, we can also derive tight rates for loss convergence and weight growth. We defer the proof to Appendix E.6.

Under assumptions (S1), (A2) - (A4), (S5), we have the following tight rates for training loss and weight norm:

where T=∑τ=t0t−1η(τ)T=\sum_{\tau=t_{0}}^{t-1}\eta(\tau).

E.4 Proof for Theorem E.2

We define ν(t):=∑n=1Ne−qn(t)qn(t)\nu(t):=\sum_{n=1}^{N}e^{-q_{n}(t)}q_{n}(t) as we do for gradient flow. Then we can get a closed form for <θ(t),−∇L(t)>\left<{\bm{\theta}}(t),-\nabla\mathcal{L}(t)\right> easily from Corollary B.3. Also, we can get a lower bound for ν(t)\nu(t) using Lemma B.5 for exponential loss directly.

<θ(t),−∇L(t)>=Lν(t)\left<{\bm{\theta}}(t),-\nabla\mathcal{L}(t)\right>=L\nu(t). If L(t)<1\mathcal{L}(t)<1, then ν(t)≥L(t)λ(L(t))\nu(t)\geq\frac{\mathcal{L}(t)}{\lambda(\mathcal{L}(t))}.

By the chain rule and the definitions of B1,B2B_{1},B_{2}, we have

For all t=t0,t0+1,…t=t_{0},t_{0}+1,\dots, we interpolate between θ(t){\bm{\theta}}(t) and θ(t+1){\bm{\theta}}(t+1) by defining θ(t+α)=θ(t)−αη(t)∇L(t){\bm{\theta}}(t+\alpha)={\bm{\theta}}(t)-\alpha\eta(t)\nabla\mathcal{L}(t) for α∈(0,1)\alpha\in(0,1). Then for all integer t≥t0t\geq t_{0}, ν(t)>0\nu(t)>0, and the following holds for all α∈\alpha\in:

2Lαη(t)ν(t)≤ρ(t+α)2−ρ(t)2≤2Lαη(t)ν(t)(1+λ(L(t))μ(L(t))L)2L\alpha\eta(t)\nu(t)\leq\rho(t+\alpha)^{2}-\rho(t)^{2}\leq 2L\alpha\eta(t)\nu(t)\left(1+\frac{\lambda(\mathcal{L}(t))\mu(\mathcal{L}(t))}{L}\right).

L(t+α)−L(t)≤−αη(t)(1−μ(L(t)))∥∇L(t)∥22\mathcal{L}(t+\alpha)-\mathcal{L}(t)\leq-\alpha\eta(t)(1-\mu(\mathcal{L}(t)))\left\|\nabla\mathcal{L}(t)\right\|_{2}^{2}.

log⁡γ^(t+α)−log⁡γ^(t)≥ρ(t)2Lν(t)2∥(I−θ^(t)θ^(t)⊤)∇L(t)∥22⋅log⁡ρ(t+α)ρ(t)\log\hat{\gamma}(t+\alpha)-\log\hat{\gamma}(t)\geq\frac{\rho(t)^{2}}{L\nu(t)^{2}}\left\|\left({\bm{I}}-\hat{{\bm{\theta}}}(t)\hat{{\bm{\theta}}}(t)^{\top}\right)\nabla\mathcal{L}(t)\right\|_{2}^{2}\cdot\log\frac{\rho(t+\alpha)}{\rho(t)}.

To prove Lemma E.8, we only need to prove the following lemma and then use an induction:

Fix an integer T≥t0T\geq t_{0}. Suppose that (P1), (P2), (P3), (P4) hold for any t+α≤Tt+\alpha\leq T. Then if (P1) holds for (t,α)∈{T}×[0,A)(t,\alpha)\in\{T\}\times[0,A) for some A∈(0,1]A\in(0,1], then all of (P1), (P2), (P3), (P4) hold for (t,α)∈{T}×[0,A](t,\alpha)\in\{T\}\times[0,A].

We prove this lemma by induction. For t=t0,α=0t=t_{0},\alpha=0, ν(t)>0\nu(t)>0 by (S4) and Corollary E.6. (P2), (P3), (P4) hold trivially since log⁡γ^(t+α)=log⁡γ^(t)\log\hat{\gamma}(t+\alpha)=\log\hat{\gamma}(t), L(t+α)=L(t)\mathcal{L}(t+\alpha)=\mathcal{L}(t) and log⁡γ^(t+α)=log⁡γ^(t)\log\hat{\gamma}(t+\alpha)=\log\hat{\gamma}(t). By Lemma E.1, (P1) also holds trivially.

Now we fix an integer T≥t0T\geq t_{0} and assume that (P1), (P2), (P3), (P4) hold for any t+α≤Tt+\alpha\leq T (where t≥t0t\geq t_{0} is an integer and α∈\alpha\in). By (P3), L(t)≤L(t0)<1\mathcal{L}(t)\leq\mathcal{L}(t_{0})<1, so ν(t)>0\nu(t)>0. We only need to show that (P1), (P2), (P3), (P4) hold for t=Tt=T and α∈\alpha\in.

Applying (P3) on (t,α)∈{t0,…,T−1}×1(t,\alpha)\in\{t_{0},\dots,T-1\}\times{1}, we have L(t)≤L(t0)<1\mathcal{L}(t)\leq\mathcal{L}(t_{0})<1. Then by Corollary E.6, we have ν(t)>0\nu(t)>0. Applying (P2) on (t,α)∈{t0,…,T−1}×1(t,\alpha)\in\{t_{0},\dots,T-1\}\times{1}, we can get ρ(t)≥ρ(t0)\rho(t)\geq\rho(t_{0}).

By definition, ρ(t+α)2=∥θ(t)−αη(t)∇L(t)∥22=ρ(t)2+α2η(t)2∥∇L(t)∥22−2αη(t)<θ(t),∇L(t)>\rho(t+\alpha)^{2}=\left\|{\bm{\theta}}(t)-\alpha\eta(t)\nabla\mathcal{L}(t)\right\|_{2}^{2}=\rho(t)^{2}+\alpha^{2}\eta(t)^{2}\left\|\nabla\mathcal{L}(t)\right\|_{2}^{2}-2\alpha\eta(t)\left<{\bm{\theta}}(t),\nabla\mathcal{L}(t)\right>. By Corollary E.6, we have

So ρ(t+α)2−ρ(t)2≥2Lαη(t)ν(t)\rho(t+\alpha)^{2}-\rho(t)^{2}\geq 2L\alpha\eta(t)\nu(t). For the other direction, we have the following using Corollary E.6 and Lemma E.7,

Proof for (P3).

(P3) holds trivially for α=0\alpha=0 or ∇L(t)=0\nabla\mathcal{L}(t)={\bm{0}}. So now we assume that α≠0\alpha\neq 0 and ∇L(t)≠0\nabla\mathcal{L}(t)\neq{\bm{0}}. By the update rule (18) and Taylor expansion, there exists ξ∈(0,α)\xi\in(0,\alpha) such that

By Lemma E.7, ∥∇2L(t+ξ)∥2≤2Cη⋅κ(L(t+ξ))\left\|\nabla^{2}\mathcal{L}(t+\xi)\right\|_{2}\leq 2C_{\eta}\cdot\kappa(\mathcal{L}(t+\xi)), so we have

Now we only need to show that L(t+α)<L(t)\mathcal{L}(t+\alpha)<\mathcal{L}(t) for all α∈(0,A]\alpha\in(0,A]. Assuming this, we can have κ(L(t+ξ))≤κ(L(t))\kappa(\mathcal{L}(t+\xi))\leq\kappa(\mathcal{L}(t)) by the monotonicity of κ\kappa, and thus

Proof for (P4).

We define v(t):=θ^(t)θ^(t)⊤(−∇L(t)){\bm{v}}(t):=\hat{{\bm{\theta}}}(t)\hat{{\bm{\theta}}}(t)^{\top}(-\nabla\mathcal{L}(t)) and u(t):=(I−θ^(t)θ^(t)⊤)(−∇L(t)){\bm{u}}(t):=\left({\bm{I}}-\hat{{\bm{\theta}}}(t)\hat{{\bm{\theta}}}(t)^{\top}\right)(-\nabla\mathcal{L}(t)) similarly as in the analysis for gradient flow. For v(t){\bm{v}}(t), we have

Decompose ∥∇L(t)∥22=∥v(t)∥22+∥u(t)∥22\left\|\nabla\mathcal{L}(t)\right\|_{2}^{2}=\left\|{\bm{v}}(t)\right\|_{2}^{2}+\left\|{\bm{u}}(t)\right\|_{2}^{2}. Then by (P3), we have

Multiplying 1+λ(L(t))μ(L(t))/L(1−μ(L(t)))ν(t)\frac{1+\lambda(\mathcal{L}(t))\mu(\mathcal{L}(t))/L}{(1-\mu(\mathcal{L}(t)))\nu(t)} on both sides, we have

By Corollary E.6, we can bound ν(t)\nu(t) by ν(t)≥L(t)/λ(L(t))\nu(t)\geq\mathcal{L}(t)/\lambda(\mathcal{L}(t)). By (P2), we have the inequality αη(t)ν(t)(1+λ(L(t))μ(L(t))L)≥ρ(t+α)2−ρ(t)22L\alpha\eta(t)\nu(t)\left(1+\frac{\lambda(\mathcal{L}(t))\mu(\mathcal{L}(t))}{L}\right)\geq\frac{\rho(t+\alpha)^{2}-\rho(t)^{2}}{2L}. So we further have

From the definition ϕ\phi, it is easy to see that −ϕ′(L(t))≥1+λ(L(t))μ(L(t))/L(1−μ(L(t)))L(t)/λ(L(t))-\phi^{\prime}(\mathcal{L}(t))\geq\frac{1+\lambda(\mathcal{L}(t))\mu(\mathcal{L}(t))/L}{(1-\mu(\mathcal{L}(t)))\mathcal{L}(t)/\lambda(\mathcal{L}(t))}. Let ψ(x)=−log⁡x\psi(x)=-\log x, then ψ′(x)=−1x\psi^{\prime}(x)=-\frac{1}{x}. Combining these together gives

Then by convexity of ϕ\phi and ψ\psi, we have

And by definition of γ^\hat{\gamma}, this can be re-written as

Proof for (P1).

By (P4), log⁡γ^(t+α)≥log⁡γ^(t)≥log⁡γ^(t0)\log\hat{\gamma}(t+\alpha)\geq\log\hat{\gamma}(t)\geq\log\hat{\gamma}(t_{0}). Note that ϕ(x)≥log⁡log⁡1x\phi(x)\geq\log\log\frac{1}{x}. So we have

For showing the third proposition in Theorem E.2, we use (P1) to give a lower bound for ∥∇L(t)∥2\|\nabla\mathcal{L}(t)\|_{2}, and use (P3) to show the speed of loss decreasing. Then it can be seen that L(t)→0\mathcal{L}(t)\to 0 and ρ(t)→+∞\rho(t)\to+\infty. By Lemma E.1, we then have ∣γˉ−γ^∣→0\lvert\bar{\gamma}-\hat{\gamma}\rvert\to 0.

Let E0:=L(t0)2(log⁡1L(t0))2−2/LE_{0}:=\mathcal{L}(t_{0})^{2}(\log\frac{1}{\mathcal{L}(t_{0})})^{2-2/L}. Then for all t>t0t>t_{0},

Therefore, L(t)→0\mathcal{L}(t)\to 0 and ρ(t)→+∞\rho(t)\to+\infty as t→∞t\to\infty.

For any integer t≥t0t\geq t_{0}, μ(L(t))≤12\mu(\mathcal{L}(t))\leq\frac{1}{2} and ∥∇L(t)∥2≥∥v(t)∥2\left\|\nabla\mathcal{L}(t)\right\|_{2}\geq\left\|{\bm{v}}(t)\right\|_{2}. Combining these with (P3), we have

By (P1), ρ(t)−2≤γ^(t0)2/L(log⁡1L(t))−2/L\rho(t)^{-2}\leq\hat{\gamma}(t_{0})^{2/L}\left(\log\frac{1}{\mathcal{L}(t)}\right)^{-2/L}. By Corollary E.6, ν(t)2≥L(t)2(log⁡1L(t))2\nu(t)^{2}\geq\mathcal{L}(t)^{2}\left(\log\frac{1}{\mathcal{L}(t)}\right)^{2}. Thus we have

It is easy to see that 1u2(log⁡1u)2−2/L\frac{1}{u^{2}(\log\frac{1}{u})^{2-2/L}} is unimodal in (0,1)(0,1), so E′(x)E^{\prime}(x) is non-decreasing and E(x)E(x) is convex. So we have

which proves E(L(t))≥12L2γ^(t0)2/L∑τ=t0t−1η(τ)E(\mathcal{L}(t))\geq\frac{1}{2}L^{2}\hat{\gamma}(t_{0})^{2/L}\sum_{\tau=t_{0}}^{t-1}\eta(\tau). Note that L\mathcal{L} is non-decreasing. If L\mathcal{L} does not decreases to , then neither does E(L)E(\mathcal{L}). But the RHS grows to +∞+\infty, which leads to a contradiction. So L→0\mathcal{L}\to 0. To make L→0\mathcal{L}\to 0, qmin⁡q_{\min} must converge to +∞+\infty. So ρ→+∞\rho\to+\infty. ∎

E.5 Proof for Theorem E.3 and E.4

The proofs for Theorem E.3 and E.4 are similar as those for Theorem A.8 and A.9 in Appendix C.

Dividing ρ(t)2\rho(t)^{2} on the leftmost and rightmost sides, we have

which implies that log⁡ρ(t+1)−log⁡ρ(t)=o(1)\log\rho(t+1)-\log\rho(t)=o(1). Therefore, for any RR, we can always find the minimum time tt such that log⁡ρ(t)≥R\log\rho(t)\geq R, and it holds for sure that log⁡ρ(t)−R→0\log\rho(t)-R\to 0 as R→+∞R\to+\infty. ∎

For proving Theorem E.3, we also need the following lemma as a variant of Lemma C.11.

where the last inequality uses the inequality a−ba≤log⁡(a/b)\frac{a-b}{a}\leq\log(a/b). Using this inequality again, we can bound the second term by

We only need to change the choices of sm,sm′,tms_{m},s^{\prime}_{m},t_{m} in the proof for Lemma C.12. We choose sm>tm−1s_{m}>t_{m-1} to be a time such that

Then we let sm′>sms^{\prime}_{m}>s_{m} be the minimum time such that log⁡ρ(sm′)≥log⁡ρ(sm)+ϵm\log\rho(s^{\prime}_{m})\geq\log\rho(s_{m})+\epsilon_{m}. According to Theorem E.2, sms_{m} and sm′s^{\prime}_{m} must exist. Finally, we construct tm∈{sm,…,sm′−1}t_{m}\in\{s_{m},\dots,s^{\prime}_{m}-1\} to be a time that β(tm)−2−1≤ϵm2\beta(t_{m})^{-2}-1\leq\epsilon_{m}^{2}, where the existence can be shown by (22).

To see that this construction meets our requirement, note that β(tm)−2−1≤ϵm2→0\beta(t_{m})^{-2}-1\leq\epsilon_{m}^{2}\to 0 and

where the last inequality is by Lemma E.11. ∎

E.6 Proof for Theorem E.5

By a similar analysis as Lemma D.4, we have

We can also bound the inverse function E−1(y)E^{-1}(y) by Θ(1y(log⁡y)2−2/L)\Theta\left(\frac{1}{y(\log y)^{2-2/L}}\right). With these, we can use a similar analysis as Theorem A.10 to prove Theorem E.5.

First, using a similar proof as for (17), we have ρL=Θ(log⁡1L)\rho^{L}=\Theta(\log\frac{1}{\mathcal{L}}). So we only need to show L(t)=Θ(1T(log⁡T)2−2/L)\mathcal{L}(t)=\Theta(\frac{1}{T(\log T)^{2-2/L}}). With a similar analysis as for (P3) in Lemma E.9, we have the following bound for L(τ+1)−L(τ)\mathcal{L}(\tau+1)-\mathcal{L}(\tau):

Using the fact that μ≤1/2\mu\leq 1/2, we have L(τ+1)−L(τ)≥−32η(τ)∥∇L(τ)∥22\mathcal{L}(\tau+1)-\mathcal{L}(\tau)\geq-\frac{3}{2}\eta(\tau)\left\|\nabla\mathcal{L}(\tau)\right\|_{2}^{2}. By Lemma E.7, ∥∇L(τ)∥2≤2Cηκ(L(τ))L(τ)\left\|\nabla\mathcal{L}(\tau)\right\|_{2}\leq 2C_{\eta}\kappa(\mathcal{L}(\tau))\mathcal{L}(\tau). Using a similar proof as for Lemma E.10, we can show that E(L(t))≤O(T)E(\mathcal{L}(t))\leq O(T). Combining this with Lemma E.10, we have E(L(t))=Θ(T)E(\mathcal{L}(t))=\Theta(T). Therefore, L(t)=Θ(1T(log⁡T)2−2/L)\mathcal{L}(t)=\Theta(\frac{1}{T(\log T)^{2-2/L}}). ∎

Appendix F Gradient Descent: General Loss Functions

It is worth to note that the above analysis can be extended to other loss functions. For this, we need to replace (B3) with a strong assumption (S3), which takes into account the second-order derivatives of ff.

There exists bf≥0b_{f}\geq 0 such that f′(q)qf^{\prime}(q)q is non-decreasing for q∈(bf,+∞)q\in(b_{f},+\infty), and f′(q)q→+∞f^{\prime}(q)q\to+\infty as q→+∞q\to+\infty.

Let g:[f(bf),+∞)→[bf,+∞)g:[f(b_{f}),+\infty)\to[b_{f},+\infty) be the inverse function of ff on the domain [bf,+∞)[b_{f},+\infty). There exists p≥0p\geq 0 such that for all x>f(bf),y>bfx>f(b_{f}),y>b_{f},

It can be verified that (S3) is satisfied by exponential loss and logistic loss. Now we explain each of the assumptions in (S3). (S3.2) and (S3.3) are essentially the same as (B3.2) and (B3.3). (S3.1) and (B3.1) are the same except that (S3.1) assumes ff is C2\mathcal{C}^{2}-smooth rather than C1\mathcal{C}^{1}-smooth.

(S3.4) can also be written in the following form:

That is, log⁡g′(x)\log g^{\prime}(x) and log⁡f′(y)\log f^{\prime}(y) grow no faster than O(log⁡x)O(\log x) and O(log⁡y)O(\log y), respectively. In fact, (B3.4) can be deduced from (S3.4). Recall that (B3.4) ensures that Θ(g′(x))=g′(Θ(x))\Theta(g^{\prime}(x))=g^{\prime}(\Theta(x)) and Θ(f′(y))=f′(Θ(y))\Theta(f^{\prime}(y))=f^{\prime}(\Theta(y)). Thus, (S3.4) also gives us the interchangeability between f′,g′f^{\prime},g^{\prime} and Θ\Theta.

(S3.4) implies (B3.4) with bg=max⁡{2f(bf),f(2bf)}b_{g}=\max\{2f(b_{f}),f(2b_{f})\} and K=2pK=2^{p}.

Fix x∈(bg,+∞),y∈(g(bg),+∞)x\in(b_{g},+\infty),y\in(g(b_{g}),+\infty) and θ∈[1/2,1)\theta\in[1/2,1). Integrating (23) on both sides of the inequalities from θx\theta x to xx and θy\theta y to yy, we have

Therefore, we have g′(x)≤θ−pg′(θx)≤Kg′(θx)g^{\prime}(x)\leq\theta^{-p}g^{\prime}(\theta x)\leq Kg^{\prime}(\theta x) and f′(y)≤θ−pf′(θy)≤Kf′(θx)f^{\prime}(y)\leq\theta^{-p}f^{\prime}(\theta y)\leq Kf^{\prime}(\theta x). ∎

To extend our results to general loss functions, we need to redefine κ(x),λ(x),ϕ(x),Cη,H(x)\kappa(x),\lambda(x),\phi(x),C_{\eta},H(x) in order. For κ(x)\kappa(x) and λ(x)\lambda(x), we redefine them as follows:

By Lemma D.1, w(log⁡1w)2−2/Lg′(log⁡1w)2=O(w(log⁡1w)4−2/L/g(log⁡1w)2)→0\frac{w(\log\frac{1}{w})^{2-2/L}}{g^{\prime}(\log\frac{1}{w})^{2}}=O\left(w(\log\frac{1}{w})^{4-2/L}/g(\log\frac{1}{w})^{2}\right)\to 0. So κ(x)\kappa(x) is well-defined. Using λ(x)\lambda(x), we can define ϕ(x)\phi(x) and γ^(θ)\hat{\gamma}({\bm{\theta}}) as follows.

For CηC_{\eta}, we define it to be the following.

Finally, the definitions for μ(x):=(log⁡1L(t0))/(2log⁡1x)\mu(x):=(\log\frac{1}{\mathcal{L}(t_{0})})/(2\log\frac{1}{x}) and H(x):=μ(x)/(Cηκ(x))H(x):=\mu(x)/(C_{\eta}\kappa(x)) in (S5) remain unchanged except that κ(x)\kappa(x) and CηC_{\eta} now use the new definitions.

Similar as gradient flow, we define ν(t):=∑n=1Ne−f(qn(t))f′(qn(t))qn(t)\nu(t):=\sum_{n=1}^{N}e^{-f(q_{n}(t))}f^{\prime}(q_{n}(t))q_{n}(t). The key idea behind the above definitions is that we can prove similar bounds for ν(t),∥∇L∥2,∥∇2L∥2\nu(t),\|\nabla\mathcal{L}\|_{2},\|\nabla^{2}\mathcal{L}\|_{2} as Corollary E.6 and Lemma E.7.

<θ(t),−∇L(t)>=Lν(t)\left<{\bm{\theta}}(t),-\nabla\mathcal{L}(t)\right>=L\nu(t). If L(t)<e−f(bf)\mathcal{L}(t)<e^{-f(b_{f})}, then ν(t)≥L(t)λ(L(t))\nu(t)\geq\frac{\mathcal{L}(t)}{\lambda(\mathcal{L}(t))} and λ(L(t))\lambda(\mathcal{L}(t)) has the lower bound λ(L(t))≤2p+1(log⁡1L(t))−1\lambda(\mathcal{L}(t))\leq 2^{p+1}\left(\log\frac{1}{\mathcal{L}(t)}\right)^{-1}.

It can be easily proved by combining Theorem B.4, Lemma B.5 and Lemma D.1 together. ∎

Note that a direct corollary of (23) is that f′(x1)≤f′(x2)(x1/x2)pf^{\prime}(x_{1})\leq f^{\prime}(x_{2})(x_{1}/x_{2})^{p} for x1≥x2>bfx_{1}\geq x_{2}>b_{f}. So we have

where R:=(B0/γ^(t0))pR:=(B_{0}/\hat{\gamma}(t_{0}))^{p}. Applying (S3.4), we can also deduce that

Now we bound ∥∇L∥2\left\|\nabla\mathcal{L}\right\|_{2} and ∥∇2L∥2\left\|\nabla^{2}\mathcal{L}\right\|_{2}. By the chain rule, we have

With Corollary E.6 and Lemma E.7, we can prove Lemma E.8 with exactly the same argument. Then Theorem E.2, E.3, E.4 can also be proved similarly. For Theorem E.5, we can follow the argument for gradient flow to show that it holds with slightly different tight bounds:

Under assumptions (S1), (A2), (S3), (A4), (S5), we have the following tight rates for training loss and weight norm:

where T=∑τ=t0t−1η(τ)T=\sum_{\tau=t_{0}}^{t-1}\eta(\tau).

Appendix G Extension: Multi-class Classification

In this section, we generalize our results to multi-class classification with cross-entropy loss. This part of analysis is inspired by Theorem 1 in (Zhang et al., 2019), which gives a lower bound for the gradient in terms of the loss L\mathcal{L}.

The margin for a single data point (xn,yn)({\bm{x}}_{n},y_{n}) is defined to be qn(θ):=Φyn(θ;xn)−max⁡j≠yn{Φj(θ;xn)}q_{n}({\bm{\theta}}):=\Phi_{y_{n}}({\bm{\theta}};{\bm{x}}_{n})-\max_{j\neq y_{n}}\{\Phi_{j}({\bm{\theta}};{\bm{x}}_{n})\}, and the margin for the entire dataset is defined to be qmin⁡(θ)=min⁡n∈[N]qn(θ)q_{\min}({\bm{\theta}})=\min_{n\in[N]}q_{n}({\bm{\theta}}). We define the normalized margin to be γˉ(θ):=qmin⁡(θ^)=qmin⁡(θ)/ρL\bar{\gamma}({\bm{\theta}}):=q_{\min}(\hat{{\bm{\theta}}})=q_{\min}({\bm{\theta}})/\rho^{L}, where ρ:=∥θ∥2\rho:=\left\|{\bm{\theta}}\right\|_{2} and θ^:=θ/ρ∈Sd−1\hat{{\bm{\theta}}}:={\bm{\theta}}/\rho\in\mathcal{S}^{d-1} as usual.

For gradient flow, we assume the following:

(Regularity). For any fixed x{\bm{x}} and j∈[C]j\in[C], Φj( ⋅ ;x)\Phi_{j}(\,\cdot\,;{\bm{x}}) is locally Lipschitz and admits a chain rule;

(Homogeneity). There exists L>0L>0 such that ∀j∈[C],∀α>0:Φj(αθ;x)=αLΦj(θ;x)\forall j\in[C],\forall\alpha>0:\Phi_{j}(\alpha{\bm{\theta}};{\bm{x}})=\alpha^{L}\Phi_{j}({\bm{\theta}};{\bm{x}});

(Cross-entropy Loss). L(θ)\mathcal{L}({\bm{\theta}}) is defined as the cross-entropy loss on the training set;

(Separability). There exists a time t0t_{0} such that L(t0)<log⁡2\mathcal{L}(t_{0})<\log 2.

If L<log⁡2\mathcal{L}<\log 2, then ∑j≠yne−snj<1\sum_{j\neq y_{n}}e^{-s_{nj}}<1 for all n∈[N]n\in[N], and thus snj>0s_{nj}>0 for all n∈[N],j∈[C]n\in[N],j\in[C]. So (M4) ensures the separability of training data.

Theorem 4.1 and 4.4 still hold. Here we redefine the optimization problem (P) to be

Most of our proofs are very similar as before. Here we only show the proof for the generalized version of Lemma 5.1.

Define ν(t)\nu(t) by the following formula:

Using a similar argument as in Theorem B.4, it can be proved that 12dρ2dt=Lν(t)\frac{1}{2}\frac{d\rho^{2}}{dt}=L\nu(t) for a.e. t>0t>0.

The rest of the proof for this lemma is exactly the same as that for Lemma 5.1. ∎

Gradient Descent.

For gradient descent, we only need to replace (M1) with (S1) and make the assumption (S5) on the learning rate.

(Smoothness). For any fixed x{\bm{x}} and j∈[C]j\in[C], Φj( ⋅ ;x)\Phi_{j}(\,\cdot\,;{\bm{x}}) is C2\mathcal{C}^{2}-smooth;

(Learing rate condition). ∑t≥0η(t)=+∞\sum_{t\geq 0}\eta(t)=+\infty and η(t)≤H(L(θ(t)))\eta(t)\leq H(\mathcal{L}({\bm{\theta}}(t))).

We only need to show that Lemma F.2 and Lemma F.3 continue to hold. Using the same argument as we do for gradient flow, we can show that γ(t)\gamma(t) and λ(x)\lambda(x) do satisfy the propositions in Lemma F.2. For Lemma F.3, we first note the original definition of CηC_{\eta} involves B0,B1,B2B_{0},B_{1},B_{2}, which are undefined in the multi-class setting. So now we redefine them as

Using these bounds, we can prove with the constant CηC_{\eta} defined as follows:

where M:=min⁡{γ^(t0)−2+2/L,B0−2+2/L}M:=\min\left\{\hat{\gamma}(t_{0})^{-2+2/L},B_{0}^{-2+2/L}\right\}.

Appendix H Extension: Multi-homogeneous Models

In this section, we extend our results to multi-homogeneous models. For this, the main difference from the proof for homogeneous models is that now we have to separate the norm of each homogeneous parts of the parameter, rather than consider them as a whole. So only a small part to proof needs to be changed. We focus on gradient flow, but it is worth to note that following the same argument, it is not hard to extend the results to gradient descent.

Let Φ(w1,…,wm;x)\Phi({\bm{w}}_{1},\dots,{\bm{w}}_{m};{\bm{x}}) be (k1,…,km)(k_{1},\dots,k_{m})-homogeneous. Let ρi=∥wi∥2\rho_{i}=\left\|{\bm{w}}_{i}\right\|_{2} and w^i=wi∥wi∥2\hat{{\bm{w}}}_{i}=\frac{{\bm{w}}_{i}}{\left\|{\bm{w}}_{i}\right\|_{2}}. The smoothed normalized margin defined in (5) can be rewritten as follows:

We only prove the generalized version of Lemma 5.1 here. The other proofs are almost the same.

On the one hand, −dLdt=∑i=1m∥dwidt∥22-\frac{d\mathcal{L}}{dt}=\sum_{i=1}^{m}\left\|\frac{d{\bm{w}}_{i}}{dt}\right\|_{2}^{2} for a.e. t>0t>0 by Lemma I.3; on the other hand, kiν(t)=<wi,dwidt>k_{i}\nu(t)=\left<{\bm{w}}_{i},\frac{d{\bm{w}}_{i}}{dt}\right> by Theorem B.4. Combining these together yields

By the chain rule, dwi^dt=1ρi(I−wi^wi^⊤)dwidt\frac{d\hat{{\bm{w}}_{i}}}{dt}=\frac{1}{\rho_{i}}({\bm{I}}-\hat{{\bm{w}}_{i}}\hat{{\bm{w}}_{i}}^{\top})\frac{d{\bm{w}}_{i}}{dt} for a.e. t>0t>0. So we have

For cross-entropy loss, we can combine the proofs in Appendix G to show that Lemma H.2 holds if we use the following definition of the smoothed normalized margin:

The only place we need to change in the proof for Lemma H.2 is that instead of using Lemma B.5, we need to prove ν(t)≥g(log⁡1L)g′(log⁡1L)L\nu(t)\geq\frac{g(\log\frac{1}{\mathcal{L}})}{g^{\prime}(\log\frac{1}{\mathcal{L}})}\mathcal{L} in a similar way as in Lemma G.2. The other parts of the proof are exactly the same as before.

Appendix I Chain Rules for Non-differentiable Functions

In this section, we provide some background on the chain rule for non-differentiable functions. The ordinary chain rule for differentiable functions is a very useful formula for computing derivatives in calculus. However, for non-differentiable functions, it is difficult to find a natural definition of subdifferential so that the chain rule equation holds exactly. To solve this issue, Clarke proposed Clarke’s subdifferential (Clarke, 1975; 1990; Clarke et al., 2008) for locally Lipschitz functions, for which the chain rule holds as an inclusion rather than an equation:

For analyzing gradient flow, the chain rule is crucial. For a differentiable loss function L(θ)\mathcal{L}({\bm{\theta}}), we can see from the chain rule that the function value keeps decreasing along the gradient flow dθ(t)dt=−∇L(θ(t))\frac{d{\bm{\theta}}(t)}{dt}=-\nabla\mathcal{L}({\bm{\theta}}(t)) :

But for locally Lipschitz functions which could be non-differentiable, (25) may not hold in general since Theorem I.1 only holds for an inclusion.

Following (Davis et al., 2020; Drusvyatskiy et al., 2015), we consider the functions that admit a chain rule for any arc.

It is shown in (Davis et al., 2020; Drusvyatskiy et al., 2015) that a generalized version of (25) holds for such functions:

We can see that C1\mathcal{C}^{1}-smooth functions admit chain rules. As shown in (Davis et al., 2020), if a locally Lipschitz function is subdifferentiablly regular or Whitney C1\mathcal{C}^{1}-stratifiable, then it admits a chain rule. The latter one includes a large family of functions, e.g., semi-algebraic functions, semi-analytic functions, and definable functions in an o-minimal structure (Coste, 2002; van den Dries & Miller, 1996).

It is worth noting that the class of functions that admits chain rules is closed under composition. This is indeed a simple corollary of Theorem I.1.

Since ff and z{\bm{z}} admit chain rules on arcs z∘x{\bm{z}}\circ{\bm{x}} and x{\bm{x}} respectively, the following holds for a.e. t>0t>0,

Combining these we obtain that for a.e. t>0t>0,

for all α∈∂∘f(z(x(t))){\bm{\alpha}}\in\partial^{\circ}{f}({\bm{z}}({\bm{x}}(t))) and for all hi∈∂∘zi(x(t)){\bm{h}}_{i}\in\partial^{\circ}{z_{i}}({\bm{x}}(t)). The RHS can be rewritten as <∑i=1nαihi,x′(t)>\left<\sum_{i=1}^{n}\alpha_{i}{\bm{h}}_{i},{\bm{x}}^{\prime}(t)\right>. By Theorem I.1, every k∈∂∘(f∘z)(x(t)){\bm{k}}\in\partial^{\circ}(f\circ{\bm{z}})({\bm{x}}(t)) can be written as a convex combination of a finite set of points in the form of ∑i=1nαihi\sum_{i=1}^{n}\alpha_{i}{\bm{h}}_{i}. So (f∘z∘x)′(t)=<k,x′(t)>(f\circ{\bm{z}}\circ{\bm{x}})^{\prime}(t)=\left<{\bm{k}},{\bm{x}}^{\prime}(t)\right> holds for a.e. t>0t>0. ∎

Appendix J Mexican Hat

In this section, we give an example to illustrate that gradient flow does not necessarily converge in direction, even for C∞C^{\infty}-smooth homogeneous models.

It is known that gradient flow (or gradient descent) may not converge to any point even when optimizing an C∞C^{\infty} function (Curry, 1944; Zoutendijk, 1976; Palis & De Melo, 2012; Absil et al., 2005). One famous counterexample is the “Mexican Hat” function described in (Absil et al., 2005):

However, the Maxican Hat function is not homogeneous, and Absil et al. (2005) did not consider the directional convergence, either. To make it homogeneous, we introduce an extra variable zz, and normalize the parameter before evaluate ff. In particular, we fix L>0L>0 and define

Consider gradient flow on L(θ)=∑n=1Ne−qn(θ)\mathcal{L}({\bm{\theta}})=\sum_{n=1}^{N}e^{-q_{n}({\bm{\theta}})}, where qn(θ)=h(θ)q_{n}({\bm{\theta}})=h({\bm{\theta}}) for all n∈[N]n\in[N]. Suppose the polar representation of (u,v)(u,v) is (rcos⁡φ,rsin⁡φ)(r\cos\varphi,r\sin\varphi). If 0<r<10<r<1 and φ=11−r2\varphi=\frac{1}{1-r^{2}} holds at time t=0t=0, then θ(t)∥θ(t)∥2\frac{{\bm{\theta}}(t)}{\|{\bm{\theta}}(t)\|_{2}} does not converge to any point, and the limit points of {θ(t)∥θ(t)∥2:t>0}\{\frac{{\bm{\theta}}(t)}{\|{\bm{\theta}}(t)\|_{2}}:t>0\} form a circle {(x,y,z)∈S2:x2+y2=1,z=0}\{(x,y,z)\in\mathcal{S}^{2}:x^{2}+y^{2}=1,z=0\}.

Define ψ=φ−11−r2\psi=\varphi-\frac{1}{1-r^{2}}. Our proof consists of two parts, following from the idea in (Absil et al., 2005). First, we show that dψdt=0\frac{d\psi}{dt}=0 as long as ψ=0\psi=0. Then we can infer that ψ=0\psi=0 for all t≥0t\geq 0. Next, we show that r→1r\to 1 as t→+∞t\to+\infty. Using ψ=0\psi=0, we know that the polar angle φ→+∞\varphi\to+\infty as t→+∞t\to+\infty. Therefore, (u,v)(u,v) circles around {(u,v):u2+v2=1}\{(u,v):u^{2}+v^{2}=1\}, and thus it does not converge.

Proof for dψdt=0\frac{d\psi}{dt}=0. For convenience, we use ww to denote z/ρz/\rho. By simple calculation, we have the following formulas for partial derivatives:

By writing down the movement of (u,v)(u,v) in the polar coordinate system, we have

For ψ=0\psi=0, the partial derivatives of ff with respect to rr and φ\varphi can be evaluated as follows:

So if ψ=0\psi=0, then dψdt=0\frac{d\psi}{dt}=0 by the direct calculation below:

Appendix K Experiments

To validate our theoretical results, we conduct several experiments. We mainly focus on MNIST dataset. We trained two models with Tensorflow. The first one (called the CNN with bias) is a standard 4-layer CNN with exactly the same architecture as that used in MNIST Adversarial Examples Challengehttps://github.com/MadryLab/mnist_challenge. The layers of this model can be described as conv-32 with filter size 5×55\times 5, max-pool, conv-64 with filter size 3×33\times 3, max-pool, fc-1024, fc-10 in order. Notice that this model has bias terms in each layer, and thus does not satisfy homogeneity. To make its outputs homogeneous to its parameters, we also trained this model after removing all the bias terms except those in the first layer (the modified model is called the CNN without bias). Note that keeping the bias terms in the first layer prevents the model to be homogeneous in the input data while retains the homogeneity in parameters. We initialize all layer weights by He normal initializer (He et al., 2015) and all bias terms by zero. In training the models, we use SGD with batch size 100100 without momentum. We normalize all the images to 32×32^{32\times 32} by dividing 255255 for each pixel.

In the first part of our experiments, we evaluate the normalized margin every few epochs to see how it changes over time. From now on, we view the bias term in the first layer as a part of the weight in the first layer for convenience. Observe that the CNN without bias is multi-homogeneous in layer weights (see (4) in Section 4.4). So for the CNN without bias, we define the normalized margin γˉ\bar{\gamma} as the margin divided by the product of the L2L^{2}-norm of all layer weights. Here we compute the L2L^{2}-norm of a layer weight parameter after flattening it into a one-dimensional vector. For the CNN with bias, we still compute the smoothed normalized margin in this way. When computing the L2L^{2}-norm of every layer weight, we simply ignore the bias terms if they are not in the first layer. For completeness, we include the plots for the normalized margin using the original definition (2) in Figure 3 and 4.

SGD with Constant Learning Rate. We first train the CNNs using SGD with constant learning rate 0.010.01. After about 100100 epochs, both CNNs have fitted the training set. After that, we can see that the normalized margins of both CNNs increase. However, the growth rate of the normalized margin is rather slow. The results are shown in Figure 1 in Section 1. We also tried other learning rates other than 0.010.01, and similar phenomena can be observed.

SGD with Loss-based Learning Rate. Indeed, we can speed up the training by using a proper scheduling of learning rates for SGD. We propose a heuristic learning rate scheduling method, called the loss-based learning rate scheduling. The basic idea is to find the maximum possible learning rate at each epoch based on the current training loss (in a similar way as the line search method). See Appendix L.1 for the details. As shown in Figure 1, SGD with loss-based learning rate scheduling decreases the training loss exponentially faster than SGD with constant learning rate. Also, a rapid growth of normalized margin is observed for both CNNs. Note that with this scheduling the training loss can be as small as 10−80010^{-800}, which may lead to numerical issues. To address such issues, we applied some re-parameterization tricks and numerical tricks in our implementation. See Appendix L.2 for the details.

Experiments on CIFAR-10. To verify whether the normalized margin is increasing in practice, we also conduct experiments on CIFAR-10. We use a modified version of VGGNet-16. The layers of this model can be described as conv-64 ×2\times 2, max-pool, conv-128 ×2\times 2, max-pool, conv-256 ×3\times 3, max-pool, conv-512 ×3\times 3, max-pool, conv-512 ×3\times 3, max-pool, fc-10 in order, where each conv has filter size 3×33\times 3. We train two networks: one is exactly the same as the VGGNet we described, and the other one is the VGGNet without any bias terms except those in the first layer (similar as in the experiments on MNIST). The experiment results are shown in Figure 5 and 6. We can see that the normalize margin is increasing over time.

Test Accuracy. Previous works on margin-based generalization bounds (Neyshabur et al., 2018; Bartlett et al., 2017; Golowich et al., 2018; Li et al., 2018a; Wei et al., 2019; Banburski et al., 2019) usually suggest that a larger margin implies a better generalization bound. To see whether the generalization error also gets smaller in practice, we plot train and test accuracy for both MNIST and CIFAR-10. As shown in Figure 7, the test accuracy changes only slightly after training with loss-based learning rate scheduling for 1000010000 epochs, although the normalized margin does increase a lot. We leave it as a future work to study this interesting gap between margin-based generalization bound and generalization error. Concurrent to this work, Wei & Ma (2020) proposed a generalization bound based on a new notion of margin called all-layer margin, and showed via experiments that enlarging all-layer margin can indeed improve generalization. It would be an interesting research direction to study how different definitions of margin may lead to different generalization abilities.

K.2 Evaluation for Robustness

Recently, robustness of deep learning has received considerable attention (Szegedy et al., 2013; Biggio et al., 2013; Athalye et al., 2018), since most state-of-the-arts deep neural networks are found to be very vulnerable against small but adversarial perturbations of the input points. In our experiments, we found that enlarging the normalized margin can improve the robustness. In particular, by simply training the neural network for a longer time with our loss-based learning rate, we observe noticeable improvements of L2L^{2}-robustness on both the training set and test set.

We first elaborate the relationship between the normalized margin and the robustness from a theoretical perspective. For a data point z=(x,y){\bm{z}}=({\bm{x}},y), we can define the robustness (with respect to some norm ∥⋅∥\|\cdot\|) of a neural network Φ\Phi for z{\bm{z}} to be

This observation does match with our experiment results. In the experiments, we measure the L2L^{2}-robustness of the CNN without bias for the first time its loss decreases below 10−1010^{-10}, 10−1510^{-15}, 10−2010^{-20}, 10−12010^{-120} (labelled as model-1 to model-4 respectively). We also measure the L2L^{2}-robustness for the final model after training for 1000010000 epochs (labelled as model-5), whose training loss is about 10−88210^{-882}. The normalized margin of each model is monotone increasing with respect to the number of epochs, as shown in Table 1.

We use the standard method for evaluating L2L^{2}-robustness in (Carlini & Wagner, 2017) and the source code from the authors with default hyperparametershttps://github.com/carlini/nn_robust_attacks. We plot the robust accuracy (the percentage of data with robustness >ϵ>\epsilon) for the training set in the figures on the first row of Figure 8. It can be seen from the figures that for small ϵ\epsilon (e.g., ϵ<0.3\epsilon<0.3), the relative order of robust accuracy is just the order of model-1 to model-5. For relatively large ϵ\epsilon (e.g., ϵ>0.3\epsilon>0.3), the improvement of model-5 upon model-2 to model-4 becomes marginal or nonexistent in certain intervals of ϵ\epsilon, but model-1 to model-4 still have an increasing order of robust accuracy and the improvement of model-5 upon model-1 is always significant. This shows that training longer can help to improve the L2L^{2}-robust accuracy on the training set.

We also evaluate the robustness on the test set, in which a misclassified test sample is considered to have robustness , and plot the robust accuracy in the figures on the second row of Figure 8. It can be seen from the figures that for small ϵ\epsilon (e.g., ϵ<0.2\epsilon<0.2), the curves of the robust accuracy of model-1 to model-5 are almost indistinguishable. However, for relatively large ϵ\epsilon (e.g., ϵ>0.2\epsilon>0.2), again, model-1 to model-4 have an increasing order of robust accuracy and the improvement of model-5 upon model-1 is always significant. This shows that training longer can also help to improve the L2L^{2}-robust accuracy on the test set.

We tried various different settings of hyperparameters for the evaluation method (including different learning rates, different binary search steps, etc.) and we observed that the shapes and relative positions of the curves in Figure 8 are stable across different hyperparameter settings.

It is worth to note that the normalized margin and robustness do not grow in the same speed in our experiments, although the theory suggests Rθ(z)≥qθ^(z)/βR_{{\bm{\theta}}}({\bm{z}})\geq q_{\hat{{\bm{\theta}}}}({\bm{z}})/\beta. This may be because the Lipschitz constant β\beta (if defined locally) is also changing during training. Combining training longer with existing techniques for constraining Lipschitz number (Anil et al., 2019; Cisse et al., 2017) could potentially alleviate this issue, and we leave it as a future work.

Appendix L Additional Experimental Details

In this section, we provide additional details of our experiments.

where Lˉ(t−1)\bar{\mathcal{L}}(t-1) is the average training loss at epoch t−1t-1, and α(t)\alpha(t) is a relative learning rate to be tuned (Similar parameterization has been considiered in (Nacson et al., 2019b) for linear model). The loss-based learning rate scheduling is indeed a variant of line search. In particular, we initialize α(0)\alpha(0) by some value, and do the following at each epoch tt:

Initially α(t)←α(t−1)\alpha(t)\leftarrow\alpha(t-1); Let Lˉ(t−1)\bar{\mathcal{L}}(t-1) be the training loss at the end of the last epoch;

Run SGD through the whole training set with learning rate η(t):=α(t)/L(t−1)\eta(t):=\alpha(t)/\mathcal{L}(t-1);

Evaluate the training loss Lˉ(t)\bar{\mathcal{L}}(t) on the whole training set;

If Lˉ(t)<Lˉ(t−1)\bar{\mathcal{L}}(t)<\bar{\mathcal{L}}(t-1), α(t)←α(t)⋅ru\alpha(t)\leftarrow\alpha(t)\cdot r_{u} and end this epoch; otherwise, α(t)←α(t)/rd\alpha(t)\leftarrow\alpha(t)/r_{d} and go to Step 2.

In all our experiments, we set α(0):=0.1,ru:=21/5≈1.149,rd:=21/10≈1.072\alpha(0):=0.1,r_{u}:=2^{1/5}\approx 1.149,r_{d}:=2^{1/10}\approx 1.072. This specific choice of those hyperparameters is not important; other choices can only affact the computational efficiency, but not the overall tendency of normalized margin.

L.2 Addressing Numerical Issues

Forward Pass. Suppose we have a good estimate F~\widetilde{\mathcal{F}} for log⁡LˉB(θ)\log\bar{\mathcal{L}}_{B}({\bm{\theta}}) in the sense that

is in the range of float64. RB(θ)\mathcal{R}_{B}({\bm{\theta}}) can be thought of a relative training loss with respect to F~\widetilde{\mathcal{F}}. Instead of evaluating the training loss LˉB(θ)\bar{\mathcal{L}}_{B}({\bm{\theta}}) directly, we turn to evaluate this relative training loss in a numerically stable way:

Perform forward pass to compute the values of snjs_{nj} with float32, and convert them into float64;

Let Q:=30Q:=30. If qn(θ)>Qq_{n}({\bm{\theta}})>Q for all n∈Bn\in B, then we compute

This algorithm can be explained as follows. Step 1 is numerically stable because we observe from the experiments that the layer weights and layer outputs grow slowly. Now we consider Step 2. If qn(θ)≤Qq_{n}({\bm{\theta}})\leq Q for some n∈[B]n\in[B], then LˉB(θ)=Ω(e−Q)\bar{\mathcal{L}}_{B}({\bm{\theta}})=\Omega(e^{-Q}) is in the range of float64, so we can compute RB(θ)\mathcal{R}_{B}({\bm{\theta}}) by (28) directly except that we need to use a numerical stable implementation of log⁡(1+x)\log(1+x). For qn(θ)>Qq_{n}({\bm{\theta}})>Q, arithmetic underflow can occur. By Taylor expansion of log⁡(1+x)\log(1+x), we know that when xx is small enough log⁡(1+x)≈x\log(1+x)\approx x in the sense that the relative error ∣log⁡(1+x)−x∣log⁡(1+x)=O(x)\frac{\lvert\log(1+x)-x\rvert}{\log(1+x)}=O(x). Thus, we can do the following approximation

Backward Pass. To perform backward pass, we build a computation graph in Tensorflow for the above forward pass for the relative training loss and use the automatic differentiation. We parameterize the learning rate as η=η^⋅eF~\eta=\hat{\eta}\cdot e^{\widetilde{\mathcal{F}}}. Then it is easy to see that taking a step of gradient descent for LB(θ)\mathcal{L}_{B}({\bm{\theta}}) with learning rate η\eta is equivalent to taking a step for RB(θ)\mathcal{R}_{B}({\bm{\theta}}) with η^\hat{\eta}. Thus, as long as η^\hat{\eta} can fit into float64, we can perform gradient descent on RB(θ)\mathcal{R}_{B}({\bm{\theta}}) to ensure numerical stability.

The Choice of F~\widetilde{\mathcal{F}}. The only question remains is how to choose F~\widetilde{\mathcal{F}}. In our experiments, we set F~(t):=log⁡Lˉ(t−1)\widetilde{\mathcal{F}}(t):=\log\bar{\mathcal{L}}(t-1) to be the training loss at the end of the last epoch, since the training loss cannot change a lot within one single epoch. For this, we need to maintain log⁡Lˉ(t)\log\bar{\mathcal{L}}(t) during training. This can be done as follows: after evaluating the relative training loss R(t)\mathcal{R}(t) on the whole training set, we can obtain log⁡Lˉ(t)\log\bar{\mathcal{L}}(t) by adding F~(t)\widetilde{\mathcal{F}}(t) and log⁡R(t)\log\mathcal{R}(t) together.

It is worth noting that with this choice of F~\widetilde{\mathcal{F}}, η^(t)=α(t)\hat{\eta}(t)=\alpha(t) in the loss-based learning rate scheduling. As shown in the right figure of Figure 4, α(t)\alpha(t) is always between 10−910^{-9} and 10010^{0}, which ensures the numerical stability of backward pass.