The Implicit Bias of Gradient Descent on Separable Data
Daniel Soudry, Elad Hoffer, Mor Shpigel Nacson, Suriya Gunasekar, Nathan Srebro
Introduction
It is becoming increasingly clear that implicit biases introduced by the optimization algorithm play a crucial role in deep learning and in the generalization ability of the learned models (Neyshabur et al., 2014, 2015; Zhang et al., 2017; Keskar et al., 2017; Neyshabur et al., 2017; Wilson et al., 2017). In particular, minimizing the training error, without explicit regularization, over models with more parameters and capacity than the number of training examples, often yields good generalization. This is despite the fact that the empirical optimization problem being highly underdetermined. That is, there are many global minima of the training objective, most of which will not generalize well, but the optimization algorithm (e.g. gradient descent) biases us toward a particular minimum that does generalize well. Unfortunately, we still do not have a good understanding of the biases introduced by different optimization algorithms in different situations.
We do have an understanding of the implicit regularization introduced by early stopping of stochastic methods or, at an extreme, of one-pass (no repetition) stochastic gradient descent (Hardt et al., 2016). However, as discussed above, in deep learning we often benefit from implicit bias even when optimizing the training error to convergence (without early stopping) using stochastic or batch methods. For loss functions with attainable, finite minimizers, such as the squared loss, we have some understanding of this: in particular, when minimizing an underdetermined least squares problem using gradient descent starting from the origin, it can be shown that we will converge to the minimum Euclidean norm solution. However, the logistic loss, and its generalization the cross-entropy loss which is often used in deep learning, do not admit finite minimizers on separable problems. Instead, to drive the loss toward zero and thus minimize it, the norm of the predictor must diverge toward infinity.
Do we still benefit from implicit regularization when minimizing the logistic loss on separable data? Clearly the norm of the predictor itself is not minimized, since it grows to infinity. However, for prediction, only the direction of the predictor, i.e. the normalized , is important. How does behave as when we minimize the logistic (or similar) loss using gradient descent on separable data, i.e., when it is possible to get zero misclassification error and thus drive the loss to zero?
In this paper, we show that even without any explicit regularization, for all linearly separable datasets, when minimizing logistic regression problems using gradient descent, we have that converges to the maximum margin separator, i.e. to the solution of the hard margin SVM for homogeneous linear predictors. This happens even though neither the norm , nor the margin constraint, are part of the objective or explicitly introduced into optimization. More generally, we show the same behavior for generalized linear problems with any smooth, monotone strictly decreasing, lower bounded loss with an exponential tail. Furthermore, we characterize the rate of this convergence, and show that it is rather slow, wherein for almost all datasets, the distance to the max-margin predictor decreasing only as , and in some degenerate datasets, the rate further slows down to . This explains why the predictor continues to improve even when the training loss is already extremely small. We emphasize that this bias is specific to gradient descent, and changing the optimization algorithm, e.g. using adaptive learning rate methods such as ADAM (Kingma and Ba, 2015), changes this implicit bias.
Main Results
We are particularly interested in problems that are linearly separable, and the loss is smooth strictly decreasing and non-negative:
The dataset is linearly separable: such that .
Under these conditions, the infimum of the optimization problem is zero, but it is not attained at any finite . Furthermore, no finite critical point exists. We consider minimizing eq. 1 using Gradient Descent (GD) with a fixed learning rate , i.e., with steps of the form:
We do not require convexity. Under Assumptions 1 and 2, gradient descent converges to the global minimum (i.e. to zero loss) even without it:
Let be the iterates of gradient descent (eq. 2) with \eta<2\beta^{-1}\sigma_{\max}^{-2}\left(\text{\mathbf{X}}\right) and any starting point . Under Assumptions 1 and 1, we have: (1) , (2) , and (3) .
Proof Since the data is linearly separable, which linearly separates the data, and therefore
In order to analyze this limit, we will need to make a further assumption on the tail of the loss function:
A function has a “tight exponential tail”, if there exist positive constants and such that
We are now ready to state our main result: {thmR}[]
For any dataset which is linearly separable (Assumption 1), any -smooth decreasing loss function (Assumption 1) with an exponential tail (Assumption 3), any stepsize \eta<2\beta^{-1}\sigma_{\max}^{-2}\left(\text{\mathbf{X}}\right) and any starting point , the gradient descent iterates (as in eq. 2) will behave as:
where is the max margin vector (the solution to the hard margin SVM):
and the residual grows at most as , and so
Furthermore, for almost all data sets (all except measure zero), the residual is bounded.
These are precisely the KKT conditions for the SVM problem (eq. 4) and we can conclude that is indeed its solution and is thus proportional to it.
To prove Theorem 2 rigorously, we need to show that has a limit, , that , that , and to bound the effect of various residual errors, such as gradients of non-support vectors and the fact that the loss is only approximately exponential. To do so, we substitute eq. 3 into the gradient descent dynamics (eq. 2), with being the max margin vector and . We then show that, except when certain degeneracies occur, the increment in the norm of is bounded by for some and , which is a converging series. This happens because the increment in the max margin term, , cancels out the dominant term in the gradient (eq. 5 with and ).
An earlier conference version of this paper (Soudry et al., 2018) included a partial version of Theorem 2, which only applies to almost all data sets, in which case we can ensure the residual is bounded. This partial statement (for almost all data sets) is restated and proved as Theorem A in Appendix A. It applies, e.g. with probability one for data sampled from any absolutely continuous distribution. It does not apply in “degenerate” cases where some of the support vectors (for which ) are associated with dual variables that are zero () in the dual optimum of 4. As we show in Appendix B, this only happens on measure zero data sets. Here, we prove the more general result which applies for all data sets, including degenerate data sets. To do so, in Theorem 4 in Appendix C we provide a more complete characterization of the iterates that explicitly specifies all unbounded components even in the degenerate case. We then prove the Theorem by plugging in this more complete characterization and showing that the residual is bounded, thus also establishing Theorem 2.
Following the publication of our initial version, and while preparing this revised version for publication, we learned of parallel work by Ziwei Ji and Matus Telgarsky that also closes this gap. Ji and Telgarsky (2018) provide an analysis of the degenerate case, establishing converges to the max margin predictor by showing that . Our analysis provides a more precise characterization of the iterates, and also shows the convergence is actually quadratically faster (see Section 3). However, Ji and Telgarsky go even further and provide a characterization also when the data is non-separable but still goes to infinity.
Perhaps most similar to our study is the line of work on understanding AdaBoost in terms its implicit bias toward large -margin solutions, starting with the seminal work of Schapire et al. (1998). Since AdaBoost can be viewed as coordinate descent on the exponential loss of a linear model, these results can be interpreted as analyzing the bias of coordinate descent, rather then gradient descent, on a monotone decreasing loss with an exact exponential tail. Indeed, with small enough step sizes, such a coordinate descent procedure does converge precisely to the maximum -margin solution (Zhang et al., 2005; Telgarsky, 2013). In fact, Telgarsky (2013) also generalizes these results to other losses with tight exponential tails, similar to the class of losses we consider here.
Also related is the work of Rosset et al. (2004). They considered the regularization path for similar loss functions as we do, and showed that is proportional to the maximum margin solution. That is, they showed how adding infinitesimal (e.g. and ) regularization to logistic-type losses gives rise to the corresponding max-margin predictor.In contrast, with non-vanishing regularization (i.e., ), is generally not a max margin solution. However, Rosset et al. do not consider the effect of the optimization algorithm, and instead add explicit regularization. Here we are specifically interested in the bias implied by the algorithm not by adding (even infinitesimal) explicit regularization. We see that coordinate descent gives rise to the max margin predictor, while gradient descent gives rise to the max norm predictor. In Section 4.3 and in follow-up work (Gunasekar et al., 2018) we discuss also other optimization algorithms, and their implied biases.
In this paper we focused on homogeneous linear predictors of the form , similarly to previous works (e.g., Rosset et al. (2004); Telgarsky (2013)). Specifically, we did not have the common intercept term: . One may be tempted to introduce the intercept in the usual way, i.e., by extending all the input vectors with an additional component. In this extended input space, naturally, all our results hold. Therefore, we converge in direction to the max margin solution (eq. 4) in the extended space. However, if we translate this solution to the original space we obtain
which is not the max margin (SVM) solution
where we do not have a penalty in the objective.
Implications: Rates of convergence
The solution in eq. 3 implies that converges to the normalized max margin vector Moreover, this convergence is very slow— logarithmic in the number of iterations. Specifically, our results imply the following tight rates of convergence: {thmR}[] Under the conditions and notation of Theorem 2, for any linearly separable data set, the normalized weight vector converges to the normalized max margin vector in norm
with this rate improving to for almost every dataset; and in angle
with this rate improving to for almost every dataset; and the margin converges as
On the other hand, the loss itself decreases as
All the rates in the above Theorem are a direct consequence of Theorem 2, except for avoiding the factor for the degenerate cases in eq. 10 and eq. 11 (i.e., establishing that the rates and always hold)—this additional improvement is a consequence of the more complete characterization of Theorem 4. Full details are provided in Appendix D. In this appendix, we also provide a simple construction showing all the rates in Theorem 3 are tight (except possibly for the factors).
The sharp contrast between the tight logarithmic and rates in Theorem 3 implies that the convergence of to the max-margin can be logarithmic in the loss itself, and we might need to wait until the loss is exponentially small in order to be close to the max-margin solution. This can help explain why continuing to optimize the training loss, even after the training error is zero and the training loss is extremely small, still improves generalization performance—our results suggests that the margin could still be improving significantly in this regime.
A numerical illustration of the convergence is depicted in Figure 1. As predicted by the theory, the norm grows logarithmically (note the semi-log scaling), and converges to the max-margin separator, but only logarithmically, while the loss itself decreases very rapidly (note the log-log scaling).
That is, the population loss increases logarithmically while the margin and the population misclassification error improve. Roughly speaking, the improvement in misclassification does not out-weight the increase in the loss of those points still misclassified.
This behavior might cause us to think we are over-fitting or otherwise encourage us to stop the optimization. However, this increase does not actually represent the model getting worse, merely getting larger, and in fact the model might be getting better (increasing the margin and possibly decreasing the error rate).
Extensions
So far, we have discussed the problem of binary classification, but in many practical situations we have more then two classes. For multi-class problems, the labels are the class indices and we learn a predictor for each class . A common loss function in multi-class classification is the following cross-entropy loss with a softmax output, which is a generalization of the logistic loss:
What do the linear predictors converge to if we minimize the cross-entropy loss by gradient descent on the predictors? In Appendix E we analyze this problem for separable data, and show that again, the predictors diverge to infinity and the loss converges to zero. Furthermore, we prove the following Theorem: {thmR}[] For almost all multiclass datasets (i.e., except for a measure zero) which are linearly separable (i.e. the constraints in eq. 15 below are feasible), any starting point and any small enough stepsize, the iterates of gradient descent on 13 will behave as:
where the residual is bounded and is the solution of the K-class SVM:
2 Deep networks
So far we have only considered linear prediction. Naturally, it is desirable to generalize our results also to non-linear models and especially multi-layer neural networks.
Even without a formal extension and description of the precise bias, our results already shed light on how minimizing the cross-entropy loss with gradient descent can have a margin maximizing effect, how the margin might improve only logarithmically slow, and why it might continue to improve even as the validation loss increases. These effects are demonstrated in Figure 2 and Table 1 which portray typical training of a convolutional neural network using unregularized gradient descentCode available here: https://github.com/paper-submissions/MaxMargin. As can be seen, the norm of the weight increases, but the validation error continues decreasing, albeit very slowly (as predicted by the theory), even after the training error is zero and the training loss is extremely small. We can now understand how even though the loss is already extremely small, some sort of margin might be gradually improving as we continue optimizing. We can also observe how the validation loss increases despite the validation error decreasing, as discussed in Section 3.
As an initial advance toward tackling deep network, we can point out that for several special cases, our results may be directly applied to multi-layered networks. First, somewhat trivially, our results may be applied directly to the last weight layer of a neural network if the last hidden layer becomes fixed and linearly separable after a certain number of iterations. This can become true, either approximately, if the input to the last hidden layer is normalized (e.g., using batch norm), or exactly, if the last hidden layer is quantized (Hubara et al., 2018).
Second, as we show next, our results may be applied exactly on deep networks if only a single weight layer is being optimized, and, furthermore, after a sufficient number of iterations, the activation units stop switching and the training error goes to zero.
We examine a multilayer neural network with component-wise ReLU functions , and weights . Given input and target , the DNN produces a scalar output
Proof We examine the output of the network given a single input , for . Since the ReLU inputs do not switch signs, we can write , the output of layer , as
where we defined for as a diagonal 0-1 matrix, which diagonal is the ReLU slopes at layer , sample , and . Additionally, we define
Importantly, this case is non-convex, unless we are optimizing the last layer. Note we assumed ReLU functions for simplicity, but this proof can be easily generalized for any other piecewise linear constant activation functions (e.g., leaky ReLU, max-pooling).
Lastly, in a follow-up work (Gunasekar et al., 2018b), given a few additional assumptions, extended our results to linear predictors which can be written as a homogeneous polynomial in the parameters. These results seem to indicate that, in many cases, GD operating on exp-tailed loss with positively homogeneous predictors aims to a specific direction. This is the direction of the max margin predictor minimizing the norm in the parameter space. It is not yet clear how to generally translate such an implicit bias in the parameter space to the implicit bias in the predictor space — except in special cases, such as deep linear neural nets, as we have shown in (Gunasekar et al., 2018b). Moreover, in non-linear neural nets, there are many equivalent max-margin solutions which minimize the norm of the parameters. Therefore, it is natural to expect that GD would have additional implicit biases, which select a specific subset of these solutions.
3 Other optimization methods
In this paper we examined the implicit bias of gradient descent. Different optimization algorithms exhibit different biases, and understanding these biases and how they differ is crucial to understanding and constructing learning methods attuned to the inductive biases we expect. Can we characterize the implicit bias and convergence rate in other optimization methods?
In Figure 1 we see that adding momentum does not qualitatively affect the bias induced by gradient descent. In Figure 4 in Appendix F we also repeat the experiment using stochastic gradient descent, and observe a similar asymptotic bias (this was later proved in Nacson et al. (2018)). This is consistent with the fact that momentum, acceleration and stochasticity do not change the bias when using gradient descent to optimize an under determined least squares problem. It would be beneficial, though, to rigorously understand how much we can generalize our result to gradient descent variants, and how the convergence rates might change in these cases.
On the other hand, as an example of how changing the optimization algorithm does change the bias, consider adaptive methods, such as AdaGrad (Duchi et al., 2011) and ADAM (Kingma and Ba, 2015). In Figure 3 we show the predictors obtained by ADAM and by gradient descent on a simple data set. Both methods converge to zero training error solutions. But although gradient descent converges to the max margin predictor, as predicted by our theory, ADAM does not. The implicit bias of adaptive methods has in fact been a recent topic of interest, with Hoffer et al. (2017) and Wilson et al. (2017) suggesting they lead to worse generalization, and Wilson et al. (2017) providing examples of the differences in the bias for linear regression problems with the squared loss. Can we characterize the bias of adaptive methods for logistic regression problems? Can we characterize the bias of other optimization methods, providing a general understanding linking optimization algorithms with their biases?
In a follow-up paper (Gunasekar et al., 2018) provided initial answers to these questions. Gunasekar et al. (2018) derived a precise characterization of the limit direction of steepest descent for general norms when optimizing the exp-loss, and show that for adaptive methods such as Adagrad the limit direction can depend on the initial point and step size and is thus not as predictable and robust as with non-adaptive methods.
4 Other loss functions
In this work we focused on loss functions with exponential tail and observed a very slow, logarithmic convergence of the normalized weight vector to the max margin direction. A natural question that follows is how does this behavior change with types of loss function tails. Specifically, does the normalized weight vector always converge to the max margin solution? How is the convergence rate affected? Can we improve the convergence rate beyond the logarithmic rate found in this work?
5 Matrix Factorization
With multi-layered neural networks in mind, Gunasekar et al. (2017) recently embarked on a study of the implicit bias of under-determined matrix factorization problems, where the squared loss of the linear observation of a matrix is minimized by gradient descent on its factorization. Since a matrix factorization can be viewed as a two-layer network with linear activations, this is perhaps the simplest deep model one can study in full, and can thus provide insight and direction to studying more complex neural networks. Gunasekar et al. conjectured, and provided theoretical and empirical evidence, that gradient descent on the factorization for an under-determined problem converges to the minimum nuclear norm solution, but only if the initialization is infinitesimally close to zero and the step-sizes are infinitesimally small. With finite step-sizes or finite initialization, Gunasekar et al. could not characterize the bias.
The follow-up paper (Gunasekar et al., 2018) studied this same problem with exponential loss instead of squared loss. Under additional assumptions on the asymptotic convergence of update directions and gradient directions, they were able to relate the direction of gradient descent iterates on the factorized parameterization asymptotically to the maximum margin solution with unit nuclear norm. Unlike the case of squared loss, the result for exponential loss are independent of initialization and with only mild conditions on the step size. Here again, we see the asymptotic nature of exponential loss on separable data nullifying the initialization effects thereby making the analysis simpler compared to squared loss.
Summary
We characterized the implicit bias induced by gradient descent on homogeneous linear predictors when minimizing smooth monotone loss functions with an exponential tail. This is the type of loss commonly being minimized in deep learning. We can now rigorously understand:
How gradient descent, without early stopping, induces implicit regularization and converges to the maximum margin solution, when minimizing for binary classification with logistic loss, exp-loss, or other exponential tailed monotone decreasing loss, as well as for multi-class classification with cross-entropy loss. Notably, even though the logistic loss and the exp-loss behave very different on non-separable problems, they exhibit the same behaviour for separable problems. This implies that the non-tail part does not affect the bias. The bias is also independent of the step-size used (as long as it is small enough to ensure convergence) and is also independent on the initialization (unlike for least square problems).
The convergence of the direction of gradient descent updates to the maximum margin solution, however is very slow compared to the convergence of training loss, which explains why it is worthwhile continuing to optimize long after we have zero training error, and even when the loss itself is already extremely small.
We should not rely on plateauing of the training loss or on the loss (logistic or exp or cross-entropy) evaluated on a validation data, as measures to decide when to stop. Instead, we should look at the – error on the validation dataset. We might improve the validation and test errors even when when the decrease in the training loss is tiny and even when the validation loss itself increases.
Perhaps that gradient descent leads to a max margin solution is not a big surprise to those for whom the connection between regularization and gradient descent is natural. Nevertheless, we are not familiar with any prior study or mention of this fact, let alone a rigorous analysis and study of how this bias is exact and independent of the initial point and the step-size. Furthermore, we also analyze the rate at which this happens, leading to the novel observations discussed above. Even more importantly, we hope that our analysis can open the door to further analysis of different optimization methods or in different models, including deep networks, where implicit regularization is not well understood even for least square problems, or where we do not have such a natural guess as for gradient descent on linear problems. Analyzing gradient descent on logistic/cross-entropy loss is not only arguably more relevant than the least square loss, but might also be technically easier.
Acknowledgments
The authors are grateful to J. Lee, and C. Zeno for helpful comments on the manuscript. The research of DS was supported by the Israel Science Foundation (grant No. 31/1031), by the Taub foundation and of NS by the National Science Foundation.
Appendix
In the following sub-sections we first prove Theorem A below, which is a version of Theorem 2, specialized for almost every dataset. We then prove Theorem 2 (which is already stated for almost every dataset).
For almost every dataset which is linearly separable (Assumption 1), any -smooth decreasing loss function (Assumption 1) with an exponential tail (Assumption 3), any stepsize \eta<2\beta^{-1}\sigma_{\max}^{-2}\left(\text{\mathbf{X}}\right) and any starting point , the gradient descent iterates (as in eq. 2) will behave as:
where is the max margin vector
the residual is bounded, and so
In the following proofs, for any solution , we define
We furthermore denote the minimum margin to a non-support vector as:
The proof in this case is rather short and self-contained (i.e., does not rely on any previous results), and so it helps to clarify the main ideas of the general (more complicated) proof which we will give in the next sections.
Substituting eq. 23 and 24 into eq. 22 and integrating, we obtain, that such that
since (eq. 19). Thus, we showed that is bounded, which completes the proof for the special case.
A.2 Complete proof of Theorem A
Next, we give the proof for the general case (non-infinitesimal step size, and exponentially-tailed functions). Though it is based on a similar analysis as in the special case we examined in the previous section, it is somewhat more involved since we have to bound additional terms.
First, we state two auxiliary lemmata, that are proven below in appendix sections A.4 and A.5:
Let be a -smooth non-negative objective. If , then, for any , with the GD sequence
we have that and therefore
Additionally, , , such that , if
First, we note that first term in this equation can be upper-bounded by
where in we used eq. 20, in we used eq. 2, and in we used , and also that
Substituting eq. 32 into eq. 30, and recalling that a power series converges for any , we can find such that
Note that this equation also implies that
Next, we would like to bound the second term in eq. 29. From eq. 26 in Lemma A.2, we can find such that :
Thus, by combining eqs. 35 and 33 into eq. 29, we find
which is a bounded, since (eq. 19) and (Definition 2). Therefore, is bounded.
A.3 Proof of Theorem 2
By contradiction, we assume that the complementary set is not finite,
Additionally, the set is not finite: if it were finite, it would have had a finite maximal point , and then, combining eqs. 28, 29, and 33, we would find that
which is impossible since . Furthermore, eq. 33 implies that
where is a positive monotone function decreasing to zero. Let be any two points such that , , and . For all such and , we have
Also, recall that , so from eq. 34, we have that . Since (from definition), we conclude that . Moreover, since is an infinite set, we can choose as large as we want. This implies that we can find such that , since is a monotonically decreasing function. Therefore, from eq. 36, , such that
This implies that .
A.4 Proof of Lemma A.2
This proof is a slightly modified version of the proof of Theorem 2 in (Ganti, 2015). Recall a well-known property of -smooth functions:
From the -smoothness of
The right hand side is upper bounded by a finite constant, since and . This implies
and therefore .
A.5 Proof of Lemma A.2
where in last line we used eqs. 6 and 7 to obtain
We examine the three terms in eq. 40. The first term can be upper bounded by
where in we used that from eq. 6, and in we used that , since
where in the last line we used that , from Lemma A.2.
Next, we upper bound the second term in eq. 40. From eq. 38 , such that ,
Lastly, we will bound the sum in the third term in eq. 40
We examine each term in this sum, and divide into two cases, depending on the sign of .
First, if , then term in eq. 44 can be upper bounded , using eq. 38, by
If , then we can upper bound eq. 45 with
If , then we can find to upper bound eq. 45 :
where in we used the fact that for and in we defined so that the previous expression is negative — since decreases slower than .
This implies that we can upper bound eq. 45 by
Second, if , we again further divide into cases:
If , then, using eq. 39 we upper bound term in eq. 44 with
Furthermore, if such that , then
since , and . In this case last line is strictly larger than for sufficiently large . Therefore, after we substitute eqs. 51 and 52 into 50, we find that such that , term in eq. 44 is strictly negative
If , which is a special case of the previous case () then , either eq. 51 or 52 holds. Furthermore, in this case, and such that eq. 52 can be lower bounded by
Substituting this, together with eq. 51, into eq. 50, we can find such we can upper bound term in eq. 44 with
To conclude, we choose :
If (as in Eq. 27), we have that
This implies that and such that eq. 28 holds. This implies also that eq. 26 holds for .
Otherwise, if , we find that , each term in eq. 44 can be upper bounded by either zero (eqs. 47 and 53), or terms proportional to (eq. 46) or , (eq. 49). Combining this together with eqs. 41, 43 into eq. 40 we obtain (for some positive constants , , , and )
Therefore, and such that eq. 26 holds.
B Generic solutions of the KKT conditions in eq. 6
For almost all datasets there is a unique which satisfies the KKT conditions (eq. 6):
Furthermore, in this solution if , i.e., is a support vector (), and there are at most such support vectors.
For almost every set , no more than points can be on the same hyperplane. Therefore, since all support vectors must lie on the same hyperplane, there can be at most support vectors, for almost every .
Given the set of support vectors, , the KKT conditions of eq. 6 entail that if and
This implies that , is equal to a rational function in the components of , i.e., , where and are polynomials in the components of . Therefore, if , then , so the components of must be at a root of the polynomial . The roots of the polynomial have measure zero, unless . However, cannot be identically equal to zero, since, for example, if , then , and so in this case , , from eq. 57.
Therefore, for a given , the event that "eq. 56 has a solution with a zero component" has a zero measure. Moreover, the union of these events, for all possible , also has zero measure, as a finite union of zero measures sets (there are only finitely many possible sets ). This implies that, for almost all datasets , only if . Furthermore, for almost all datasets the solution is unique: for each dataset, is uniquely determined, and given , the solution eq. 56 is uniquely given by eq. 57.
C Completing the proof of Theorem 2 for zero measure cases
In the preceding Appendices, we established Theorem 2, which only applied when all support vectors are associated with non-zero coefficients. This characterizes almost all data sets, i.e. all except for measure zero. We now turn to presenting and proving a more complete characterization of the limit behaviour of gradient descent, which covers all data sets, including those degenerate data sets not covered by Theorem 2, thus establishing Theorem 2.
In order to do so, we first have to introduce additional notation and a recursive treatment of the data set. We will define a sequence of data sets obtained by considering only a subset of the points, and projecting them using the projection matrix . We start, for , with the full original data set, i.e. and . We then define as the max margin predictor for , i.e.:
In particular, is the max margin predictor for the original data set. We then denote the indices of non-support vectors for 58, the indices of support vector of 58 with non-zero coefficients for the dual variables corresponding to the margin constraints (for some dual solution), and the set of support vector with zero coefficients. That is:
The problematic degenerate case, not covered by the analysis of Theorem 2, is when there are support vectors with zero coefficients, i.e., when . In this case we recurse on these zero-coefficient support vectors (i.e., on ), but only consider their components orthogonal to the non-zero-coefficient support vectors (i.e., not spanned by points in ). That is, we project using:
where we denoted as the Moore-Penrose pseudo-inverse of . We also denote .
This recursive treatment continues as long as , defining a sequence of max margin predictors, for smaller and lower dimensional data sets . We stop when and denote the stopping stage —that is, is the minimal such that . Our characterization will be in terms of the sequence . As established in Lemma 3 of Appendix B, for almost all data sets we will not have support vectors with non-zero coefficients, and so we will have , and so the characterization only depends on the max margin predictor of the original data set. But, even for the measure zero of data sets in which , we provide the following more complete characterization:
For all datasets which are linearly separable (Assumption 1) and given a -smooth loss function (Assumption 1) with an exponential tail (Assumption 3), gradient descent (as in eq. 2) with step size \eta<2\beta^{-1}\sigma_{\max}^{-2}\left(\text{\mathbf{X}}\right) and any starting point , the iterates of gradient descent can be written as:
Lastly, we define, , as the solution of
The existence and uniqueness of the solution are proved in appendix section C.5.
Together, eqs. 62-65 entail the existence of a unique decomposition,
given the constraints in eqs. 63 and 65 hold.
C.2 Proof of Theorem 4
In the following proofs, for any solution , we define
First, we note that such that the first term in this equation can be upper bounded by
Substituting eq. 71 into eq. 69, and recalling that converges for any and any , and so
Also, in the next subsection we will prove that
Let and be functions in , then
Thus, by combining eqs. 73 and 72 into eq. 68, we find
On this result we apply the following lemma (with , , and ), which we prove in appendix C.6:
since we assumed that . This completes our proof.
C.3 Proof of Lemma C.2
Before we prove Lemma C.2, we prove the following auxilary Lemma: {lemR}[] Consider the function . If such that and for all ,, then .
Proof To prove Lemma C.3, we will show that the improper integeral for any is bounded, i.e., . Using the integeral test for convergence (or Maclaurin–Cauchy test) this in turn implies that , and thus .
First, if , then and for some . Using change of variables , we have
Additionally, we define so that
where in we used eq. 78 and in we used the definition of GD in eq. 2. We can bound the second term using Cauchy-Shwartz inequality and eq. 81:
Next, we examine the second term in eq. 85
where in recall from eq. C that are mutually exclusive and .
Next we upper bound the three terms in eq. 86.
To bound the first term in eq. 86 we use Cauchy-Shartz, and eq. 84.
where in we used eqs. 78 and 79, in we used that and , we used eq. 83 and in we denoted and the last line is integrable based on Lemma C.3.
Next, we bound the last term in eq. 86. For exponential tailed losses (Assumption 3), since , we have positive constants , and such that
From this result, we have the following set of inequalities:
where in we used eqs. 78 and 79, and in we used from eq. 65 (so if ) and in defined
Note such that , we can bound by
where follows from the bound in eq. 91.
, where we will determine later. We have the following for all
where we set such that the term in the square bracket is positive and
in we used that since , and also from using and in we use that we have that and from eq. 93.
We examine the second term in eq. 94 using the decomposition of from eq. 66
where in we used eq. 66, in we re-arranged the order of summation in the last term, and in we just use a change of variables.
Next, we examine for each and in eq. 96. Note that, such that we have
where in follows from the definition of , wherein
First, if , then .
We further divide into two cases. In the following are some constants independent of .
If , then we have the following
where in , we use from eq. 93 and using eq. 78, in we used bound on from eq. 83, in for some large enough , we have , and for the second term we used the inequality for , and holds asymptotically for for large enough as converges slower than to 0.
Thus, using eq. 98 in eq. 97, , we have
If , then we have the following: from eq. 93, as , and since , for large enough ,
This gives us, , and using this in eq. 97,
Second, if , then . We again divide into following special cases.
If then, from eq. 93
In this case, since , we also have , and hence . Thus, , in 97, , and we have
where follows from and the bound on from eq. 99.
Since, and from eq. 92, for large enough , we have , and . Let be an arbitrarily large constant. For all , if , then .
On the other hand, if there exists , such that , then for some constants we have the following
from eq. 93 and again using for all ,
where the last inequality follows as for large enough , we have .
Finally, using eq. 100 in eq. 97, we have for all
Collecting all the terms from the above special cases, and substituting back into eq. 85, we note that all terms are either negative, in , or of the form , where , thus proving the lemma.
C.4 Proof of the existence and uniqueness of the solution to eqs. 62-63
we have a unique solution. From eq. 103, we can modify eq. 102 to
In other words, is in the direction of , are in the space spanned by the columns of , and are orthogonal to the columns of .
Multiplying by from the left, we obtain
Since , we have that
We recall that . Given , we examine eq. 108 for ,
This equation always has the unique solution
given . Next, we similarly examine eq. 108 for as a function of
multiplying by we obtain
Therefore, any critical point of would be a solution of eq. 110 for , and substituting this solution into eq. 109 we obtain . Since , is a convex function, as positive linear combination of convex function (exponential). Therefore, any finite critical point is a global minimum. All that remains is to show that a finite minimum exists and that it is unique.
Therefore, we have that
Recall, from eq. 105 that , and that . Therefore, eq. 112 implies that such that and also such that .
Thus, in any direction we take a limit in which , we obtain that , since at least one exponent in the sum diverge. Since , is a continuous function, it implies it has a finite global minimum. This proves the existence of a finite solution. To prove uniqueness we will show the function is strictly convex, since the hessian is (strictly) positive definite, i.e., that the following expression is strictly positive:
C.5 Proof of the existence and uniqueness of the solution to eqs. 64-65
have a unique solution .
Proof For this proof we denote as the matrix which columns are , the orthogonal projection matrix where , , and
Next, we prove the existence and uniqueness of the solution for each separately. We multiply eq. 113 from the left by the identity matrix, decomposed to orthogonal projection matrices as in eq. 115. Since each matrix projects to an orthogonal subspace, we can solve each product separately.
The product with is equal to zero for both sides of the equation. The product with is equal to
Substituting eq. 116, and multiplying by from the right, we obtain
where in we used that is diagonal and non-zero, and in we used eq. 117. This implies that the matrix in eq. 119 is full rank, and so eq. 118 has a unique solution . Therefore, there exists a unique solution .
C.6 Proof of Lemma C.2
Proof We define , and start from eq. 74
we keep iterating eq. 74, until we obtain
Therefore, the Lemma holds with and .
D Calculation of convergence rates
In this section we calculate the various rates mentioned in section 3.
From Theorems 2 and 4, we can write , where has a bounded norm for almost all datasets, while in zero measure case contains additional components which are orthogonal to the support vectors in , and, asymptotically, have a positive angle with the other support vectors. In this section we first calculate the various convergence rates for the non-degenerate case of Theorem 2, and then write the correction in the zero measure cases, if there is such a correction.
First, we calculated of the normalized weight vector (eq. 8), for almost every dataset:
where to obtain eq. 120 we used , and in the last line we used the fact that has a bounded norm for almost every dataset. Thus, in this case
Next, we use eq. 120 to calculate the angle (eq. 9)
for almost every dataset. Thus, in this case
Repeating the same calculation for the measure zero case, we have instead
Calculation of the training loss (eq. 11):
Thus, for all datasets . Note that the zero measure case has the same behavior, since after a sufficient number of iterations, the correction has a non-negative angle with all the support vectors.
We can analytically integrate these equations to obtain
Using this example with , it is easy to see that the above upper bounds are strict in the non-degenerate case.
D.2 Validation error lower bound
Lastly, recall that is a set of indices for validation set samples. We calculate of the validation loss for logistic loss, if the error of the max margin vector has some classification errors on the validation, i.e., :
E Softmax output with cross-entropy loss
Consider the cross entropy loss with softmax output
Using our notation, this loss can be re-written as
If, again, we make the assumption that the data is linearly separable, i.e., in our notation
such that .
is strictly negative for any finite . However, from Lemma A.2, in gradient descent with an appropriately small learning rate, we have that . This implies that: , and , which implies . Examining the loss (eq. 123) we find that in this case. Thus, we arrive to an equivalent Lemma to Lemma 1, for this case:
Let be the iterates of gradient descent (eq. 2) with an appropriately small learning rate, for cross-entropy loss operating on a softmax output, under the assumption of strict linear separability (Assumption 4), then: (1) , (2) , and (3) .
Using Lemma A.2 and Lemma 7, we prove the following Theorem (equivalent to Theorem 2) in the next section: See 4.1
From the KKT optimality conditions, we have for some ,
where is the concatenation of which are the K-class SVM solution, so
This equation has a unique solution for almost every data set according to Lemma 3. For each of the K classes, we define as the orthogonal projection matrix to the subspace spanned by the support vector of the k’th class, and as the complementary projection. Finally, we define and as follows:
In the following section we will also use , the indicator function, which is if is satisfied and 0 otherwise.
E.2 Auxiliary Lemma
Additionally, , , such that , such that if
We prove the Lemma below, in appendix section E.4
E.3 Proof of Theorem 4.1
First, we note that first term in this equation can be upper-bounded by
where in (1) we used eq. 126, in (2) we used eq 2.2, and in (3) we used , and also that
since (we recall that is the K-class SVM solution). Also, from Lemma A.2 we know that
Substituting eq. 135 into eq. E.3, and recalling that a power series converges for any , we can find such that
Note that this equation also implies that
Next, we would like to bound the second term in eq. 132. From eq. 129 in Lemma E.2, we can find such that :
Thus, by combining eqs. 138 and 136 into eq. 132, we find:
which is bounded, since (eq. 127). Therefore, is bounded.
E.4 Proof of Lemma E.2
where in the last line we used eqs. 125 and 128 to obtain
where is the indicator function which is if is satisfied and 0 otherwise.
where in we used that , and in we used that , since
where in the last line we used that , from Lemma A.2. Next, we wish to upper bound the second term in eq. E.4:
where in (1) we used and in (2) we defined:
We use the fact that and therefore :
We divide into cases: 1. If then we examine the sum
2. If then we examine the sum
This implies that and such that eq. 131 holds. This implies also that eq. 129 holds for . 2. If , we obtain (for some positive constants ):
Therefore, and such that eq. 129 holds.