Gradient Descent for Deep Matrix Factorization: Dynamics and Implicit Bias towards Low Rank
Hung-Hsu Chou, Carsten Gieshoff, Johannes Maly, Holger Rauhut
Introduction
Deep learning has become the standard machine learning technology in recent years, celebrating breakthroughs in many areas ranging from face recognition over medical imaging to autonomous driving. Despite all its successes it is still mysterious why deep learning works so well. Often deep neural networks have significantly more parameters than the number of examples used in training. As studied systematically via numerical experiments, for instance in , (stochastic) gradient descent usually results in zero training error so that the resulting neural networks interpolate the training samples exactly. Nevertheless and somewhat surprisingly, the trained deep networks generalize very well, although classical statistics would suggest that one is in a regime of overfitting. It was remarked already in that the employed optimization algorithms induce an implicit bias towards certain solutions. Apparently, those solutions often behave very nicely in realistic situations. Providing an understanding of the nature of such implicit bias seems to be a key task for the development and understanding of deep learning in general. While a general theory for the implicit bias in deep learning seems presently out of reach, first theoretical works concentrate on linear networks and suggest that (stochastic) gradient descent converges to a linear network, i.e., a linear function described by a matrix, which is of low rank. Nevertheless, even for the linear case, the settings considered in these works are rather restrictive and many open questions remain.
The optimization problem (2) is normally solved via variants of (stochastic) gradient descent (using back propagation). As already described above, this often leads to decent solutions, even in the overparametrized setting and a recent research hypothesis claims an implicit bias of gradient descent towards low-complexity solutions – although no regularization term is added to (2). It was observed in that early stopping may produce beneficial solutions while omitting unfavorable local and global minima. Since (2) is hard to analyze in general due to the non-linear structure of (1), recent theoretical works concentrate on the simplified case of linear neural networks , where and , i.e., (1) becomes
Choosing to be the quadratic loss, equation (2) then takes the more accessible shape
Hence, we are interested in analyzing the discrete dynamics defined by
for , where
is the step-size, is some initialization matrix, and is assumed to be small. Note that the gradient of with respect to a single factor is given by
We derive a sharp upper bound on the step size ensuring convergence, for all choices of and .
We only assume symmetry of the ground-truth, which is considerably weaker than the often used assumption of positive semidefiniteness (PSD).
We prove that negative eigenvalues can only be recovered under a suitable perturbation of the initialization. This has not yet been discussed in the standard setting of identity initialization since the prior works only consider positive semi-definite ground-truths, cf. Table 2.
Our main results consist of three central observations (note that we always use explicit constants in the statements).
I. Recovery of positive eigenvalues: Initializing with , as done in in a matrix sensing framework, the dynamics in (6)-(7) can solely recover non-negative eigenvalues of . In addition, the following theorem provides a quantitative analysis that shows how fast eigenvalues of are approximated depending on their magnitude and other model parameters like , , and .
for all , where is defined in (24) below.
The proof of Theorem 1.1 is given in Section 2.1.
The exact form of involves some additional notation, which will be introduced later, see (24). Let us nevertheless give some simplified approximate expressions in the relevant case that , and , so that the initial matrix has small enough spectral norm compared to the -th eigenvalue of the ground truth, which in turn is larger than the desired accuracy . In this case and we assume that
for some so that (10) is satisfied. The quantity then takes the form (the interested reader is referred to the more detailed derivation and discussion in Appendix A)
where we ignore the additional term appearing in (24) since it is neglectable for small and large (and probably resembles a proof artefact). As (12) shows, consists of two main terms. One depends on the ratio between and and one on the desired accuracy . increases for smaller and .
II. Recovery of arbitrary eigenvalues: Perturbing the initialization slightly, i.e., setting
allows the dynamics in (6) to recover the whole spectrum of , cf. Figure 1(b). This suggests that the spectral cut-off observed in Theorem 1.1 is a pathological case and thus hardly observed in practice. As before, the following theorem also quantifies the approximation rates of eigenvalues of in terms of their magnitude, their sign, , , , and .
then converges to . Moreover, the error is a diagonal matrix, whose entries satisfy
for all , and
where is defined in (24).
The proof of Theorem 1.3 is given in Section 2.2.
such that . Consequently, we obtain for that
Let us finally mention that the condition is used to simplify parts of the argument. Numerical simulations suggest that it is an artifact of the proof ; is empirically sufficient.
III. Implicit bias towards low-rank: Theorems 1.1 and 1.3 suggest an implicit rank regularization of the gradient descent iterates if we stop at some appropriate finite , since dominant eigenvalues will be approximated faster than the rest of the spectrum. The discussion in Section 3 — in particular, Theorems 3.1 (gradient flow, ) and 3.5 (gradient descent, ) — makes this precise by showing that the effective rank (a generalized notion of rank) of the iterates first drops to one and then monotonously increases, plateauing on the effective rank levels of various low-rank approximations of , cf. Figure 3. Theorems 3.1 and 3.5 explicitly characterize the time intervals during which the effective rank of remains approximately constant.
In addition to those highlights, we provide numerical evidence supporting the theory and simulations in more general settings suggesting that our observations are not restricted to matrix factorization with symmetric ground truths. The organization of the paper is as follows: Section 2 contains the core analysis including a quantitative description of the dynamics in (6)-(7), both for the identical and the perturbed initialization. Building upon those results, Section 3 then deduces an implicit low-rank bias of gradient descent and compares theoretical predictions to actual numerical outcomes. Finally, we present in Section 4 additional numerical simulations in more general settings and discuss future work in Section 5.
2 Related Work
Linear multilayer neural networks and related optimization problems have been investigated in several works . In particular, it has been shown in (extending ) that the gradient flow minimizing , i.e., learning deep linear networks, converges to a global minimizer for almost all initializations.
In the authors consider the problem of recovering a symmetric, positive matrix of low rank from incomplete linear measurements . They are able to show that gradient descent on the factorized problem converges to the ground truth if a restricted isometry assumption holds for . While this seems to suggest a bias of gradient descent towards low-rank solutions, the conclusion is questionable because restricting the linear system to positive semidefinite matrices often means that is the unique solution if for a low rank matrix .
Early stopping of gradient descent in deep learning has been investigated in a number of contributions, see e.g. . It may be interpreted as bias-variance trade-off . In the context of neural tangent kernels, shows that when the width of network becomes infinite, the convergence rate of gradient flow is faster for eigenspaces with larger eigenvalues. Hence, early stopping may seem appealing for applications where only few major features are required. In fact, early stopping is intertwined with the idea of implicit bias, as we will discuss later in our paper.
3 Notation
We abbreviate . We denote matrices by uppercase letters and scalars by lowercase letters. Norms that frequently appear are the operator norm (spectral norm) , the Frobenius norm , and the nuclear norm , where are the singular values of . Throughout the paper, represents the initialization, the step size, and the depth of the matrix factorization. For a real number , we denote .
The Dynamics of Gradient Descent
The goal of this section is to derive precise bounds on the full trajectory of the gradient descent iterations defined in (6) for the quadratic loss function (8) where is assumed to be a symmetric ground truth matrix. We first choose a small positive multiple of the identity as initialization of all factor matrices. However, we will see that we cannot recover negative eigenvalues of with such initialization. To mend this, we will consider then a slightly modified initialization, which guarantees recovery of the ground truth in the limit as , and characterize also the dynamics in this case.
We start by observing that the dynamics of the different eigenvalues decouple when initializing with the same multiple of the identity matrix. A similar result and proof has already appeared for the underlying gradient flow in [9, Section E.1].
Let be the solution to the gradient descent (6) with identical initialization (7) and let be an eigenvalue decomposition of the symmetric ground truth matrix (where is orthogonal). Then the matrices are real, diagonal and identical, i.e., for all for some , and follow the dynamics
By orthogonality of this shows that so that the induction step is completed. ∎
Due to the previous decoupling lemma it suffices to analyze the dynamics of each diagonal entry of separately. Denoting by an eigenvalue of the ground truth matrix the corresponding diagonal element of evolves according to the equation
The following lemma describes the convergence of in (18). It extends [9, Lemma 1] to negative choices of and to the case . Note that the proof is fundamentally different from the one presented in .
If and , then converges to linearly, i.e.,
then . Moreover, the error is monotonically decreasing and, for all , one has that if , and if .
Note that the proof of Lemma 2.2 shows that the sequence is monotonically increasing for and monotonically decreasing for . We will repeatedly make use of this observation in the following.
For the computation is straight-forward and follows by induction. For we need to make a case distinction with four cases that depend on the sign and the magnitude of . This is due to the fact that the sign of determines the limit of , while the magnitude of determines whether is increasing or decreasing in time.
Let . Before diving into the case distinction, let us define, for , the function
and observe that . For , and its derivative satisfies
where we used that . By the assumption on it follows that for all and, hence, is monotonically increasing on that interval. We can now distinguish the four cases defined by / and /.
For and , we show by induction that remains in the interval and is monotonically decreasing in , which implies that the error is monotonically decreasing. For , the claim is trivially fulfilled. If , then so that . Moreover, if
since and by assumption on . If , then
since and by assumption on . Hence . Here we have a bounded decreasing sequence, and hence it must converges to the only fixed point in the domain, which is .
Finally, consider with . If , then . Moreover,
by the assumption on . Hence . This means that the error is monotonically decreasing. Here we have a bounded decreasing sequence, and hence it must converges to the only fixed point in the domain, which is . ∎
Lemma 2.2 shows that in the presence of matrix factorization, i.e., , gradient descent with identical initialization loses its ability to recover negative eigenvalues and the condition on the constant in the initialization becomes more restrictive. (The condition on becomes either more or less restrictive depending on .) Note that Lemma 2.2 only provides a sufficient condition on the stepsize for convergence. However, this condition is basically necessary up to the constant, see Lemma B.1 in Appendix B.
Having settled convergence, we will now analyze the number of iterations that are needed in order to reach an -neighborhood of . By Lemma 2.1, this forms the basis for analyzing the implicit bias of gradient descent (6) on the matrix factorized problem with . In order to state our theorem, we need to introduce a few quantities corresponding to certain numbers of iterations that are important in our subsequent analysis. For and we define
The quantity estimates the required number of gradient descent iterations to reach a certain accuracy when starting with identical initialization with parameter and using step size . In particular, it illustrates that fine approximation of positive eigenvalues dominating (fourth case) happens in two stages: to obtain a rough approximation a fixed number of iterations is necessary ( does not depend on ) while to obtain approximation of accuracy one needs an additional number of iterations depending on , cf. Figure 4. Note that Remark 1.2 already commented on the behaviour of in the most relevant fourth case, see also Lemma E.1.
With these definitions at hand we are ready to state the first core result. Note that the third case together with the general assumption implies that .
Further, let be the desired error and be the minimal number of iterations to achieve such error bound. Then
Moreover, in the case we have the lower bound
The proof of Theorem 2.4 uses the following two lemmas. The first analyzes the continuous analog of (18), namely the gradient flow following the differential equation obtained by letting the step size tend to zero, i.e.,
The gradient flow defined by (28) has the following solution. If then
If then the solution is given implicitly by
For and we can also give the solution of (28) in explicit form,
The solution for has been derived already in . Let us also mention that, for , the solution can be expressed in an alternative way avoiding the use of complex logarithms. For details, see Appendix C.
If , or and , it is easy to verify the stated solutions.
Let now and . The differential equation (28) is separable, hence its solution satisfies
the complex roots of . A partial fraction decomposition gives
Hence, for the solution satisfies
If then the roots , are real and the solution satisfies
By the definition of this completes the proof. ∎
The second lemma required for the proof of Theorem 2.4 links the continuous dynamics in (28) to the discrete dynamics in (18). Although a result of this form might exist already, we include the full proof for the reader’s convenience.
We first show by induction that for . The claim clearly holds for . Now assume that it holds for some such that . We aim at proving the claim for . Since for and for we have
Hence, is convex on and therefore, and so that by definition of
The definition of and the mean-value theorem together with (32) and for all imply that, for some between and ,
In the second inequality we have used the induction hypothesis that . This proves the first part of the lemma.
via induction. Note that is monotonously increasing on because and by assumption. Since (by the monotonicity of as well as the definition of and ), we have
Let us now assume the claim (33) holds for with and . If , the right hand inequality in (32) implies that
which implies . Hence, by the monotonicity of on we obtain
This completes the induction step and, hence, proves the inequality whenever .
We first consider the case that . By our assumption (25) on the stepsize the conditions in Lemma 2.2 are satisfied so that is monotonically decreasing and , for all . Let and define as
Note that for and it holds . Recalling that , we inductively conclude that , for all . Let be the continuous analog of , i.e., the solution of the differential equation
Define the discrete variable . We intend to apply Lemma 2.7 for , . Note that , and for . The assumption (25) on the stepsize implies that so that Lemma 2.7 yields , for all . Hence, for by the definition of and a short calculation using (34). We conclude that .
We now consider the case . By Lemma 2.2, is monotonically decreasing and , for all . For , the function satisfies and . By assumption (25), the stepsize satisfies . Hence, we can apply Lemma 2.7 which gives , for all , where is defined by (28). By Lemma 2.5 and the observation that is monotonically decreasing for and , we obtain that for all since and satisfies (28). Consequently, for all , which proves the claim for the case .
Finally, consider . The proof distinguishes two phases of the dynamics. In the first phase we use the associated continuous flow in (28) for the time where it is convex. For the following second phase, we directly work with the discrete dynamics. In order to make this distinction we use again the function so that and . Note that the function
satisfies for and for , where
This implies that is convex as long as and concave when . If then by the assumption and the desired accuracy is reached while the dynamics is still in the convex phase, i.e., . In this case, we define
Now assume . If then the dynamics starts in the convex phase, while it starts in the concave phase if . Accordingly, we define
We start with bounding . If , then and we are done. In the case , we intend to apply Lemma 2.7 for , and . Then for as already noted above and , for all , where the inequality follows similarly as in (21). By the assumption (25) on the stepsize we have . Hence, by Lemma 2.7 we have , where
Since is monotonically increasing for , Lemma 2.5 implies that is lower bounded by and upper bounded by .
Now we consider the second phase where and define to be the difference to the limit . If then . Therefore, we assume from now on. By Lemma 2.2, is increasing and remains inside the interval for all . A direct computation gives
The last equality follows from a straightforward calculation. Note that
In particular, is increasing on . Note that, since ,
Note that by the assumption on . Hence, if
so that is bounded from above by the right hand side. In the case that , we have and the inequality (37) can be improved to
For the lower bound, assume first that . Then . and since it follows that so that by the assumption (25) on the stepsize ,
Observe that by (35) and (36), for all ,
Hence, for all
This implies that is lower bounded by the right hand side above if if .
If then and Hence, for all
Hence, is bounded from below by the right hand side of the above inequality.
Noting that , collecting all the cases and comparing with the definition of and completes the proof. ∎
The statement is an immediate consequence of Lemma 2.1 and Theorem 2.4 in Section 2.1, also noting that . In particular, Theorem 2.4 yields that, for ,
The case in (11) follows from the mean-value theorem applied to the function . To be precise, there exists such that
2 Perturbed Identical Initialization
For , we have seen in the previous section that we cannot recover negative eigenvalues of the ground truth matrix with gradient descent when identically initializing all matrices as . As already mentioned before, this problem can be overcome by slightly perturbing the constant at one of the matrices. Instead of (7) we thus consider the mildly perturbed initialization
for some (where one could think of much smaller than ). We will call (13) perturbed identical initialization. The choice of for perturbing the constant to is generic. In light of the fact that slightly perturbing a single factor suffices to recover the full spectrum, the spectral cut-off phenomenon in Theorem 1.1 appears to be a pathological case.
We can now turn to the proof of Theorem 1.3. Before stating the formal argument, let us provide a rough intuition on why a slight perturbation like in (38) makes such a difference: all squared singular values of all factors converge to the -th root of the squares of the respective ground-truth eigenvalues, i.e., their limits coincide in absolute value. At the same time the gradient descent dynamics induce a repelling effect between the eigenvalues of differently initialized factors if the corresponding ground-truth eigenvalue is negative. The only way all factors can converge in this situation is that the perturbed factor converges to the negative -th root of the ground-truth eigenvalue while the eigenvalues of all remaining factors stay positive. We begin by stating a modified version of the decoupling in Lemma 2.1.
The proof of Lemma 2.8 follows the lines of Lemma 2.1 and is thus omitted. Similar to (but not quite the same as) the case of identical initialization, the system can be reduced to the scalar dynamics
To further analyze the perturbed setting, we concentrate on three quantities: the difference , the difference of squares , and the rate factor , defined as
Let , be defined by (40) with the perturbed identical initialization (41), and let , and be the quantities defined in (42). Then
and similarly This completes the proof. ∎
Due to the coupling of and , we are not able to derive limits as previously done in Lemma 2.2. However, we can show in Lemma 2.12 below that the product converges to regardless of its sign. In order to keep the presentation concise, parts of the proof (treating positive ) are deferred to Appendix D in form of Lemma D.2 and D.3.
For , which cannot be recovered with identical initialization, the key is the “phase transition” time , defined by
where we use the convention that .
Let and . Let be defined by (40) with the perturbed identical initialization (41) and define . If
then defined in (46) is finite.
Let the difference and the factor be defined as in (42). We define the two auxiliary sequences
whose behavior is well-understood by Section 2.1, and we make the auxiliary claim that
Assume that for the moment. By the definition of , we have . Furthermore, Lemma 2.2 implies that and . Note that due to and , as long as . Since , and it follows by induction from (45) in Lemma 2.9 that , and for all . Therefore, and are monotonically decreasing in for by (40). Hence, and , for . In order to fully prove (50), we will show next that and by induction.
By construction and . Assume that and for some . Define as in the proof of Lemma 2.2. By a direct computation as in (21), for because satisfies (47). Thus is monotonically increasing on and since
This completes the induction step and shows (50).
by assumption on . By Lemma 2.9, is monotonically increasing while is monotonically decreasing. Consequently, we have
Since and this gives
then .
Setting and , and interpreting as new initial conditions, the above system has the same form as (40) with replaced by . According to Lemmas D.2 and D.3,
if . It remains to verify the latter condition. Since and are positive, we have according to the dynamics in (53). Together with the fact that is monotonically decreasing before this time, we deduce that . Let the difference sequence and the factor be defined as in (42). Since , for , cf. Equation (51), Lemma 2.9 states that is monotonically increasing, for . In particular, and we obtain
Hence the condition is satisfied. ∎
From a less technical point of view, Lemma 2.12 and its proof show that if , the dynamics is similar to the case of identical initialization. If , the dynamics is only similar up to the point where one of the components changes sign. Then, they start to behave as if and follow a mirrored trajectory of the identical initialization setting. We have all tools at hand to finally prove Theorem 1.3.
The convergence of to directly follows from Lemma 2.8 and 2.12. For the rate of convergence, we will use Theorem 2.4 and Lemmas 2.9, 2.11, 2.12, D.2, D.3.
With , let be defined as in (40) and as in (48), (49) and (69). Note that by Lemma 2.8, . We distinguish the following cases.
Assume that . Let , and be defined as in (42) with . Let be the phase transition time defined in (46) at which becomes negative. We start with some useful observations.
For , the sequences are positive and decreasing by induction, i.e.,
Since , we have . Therefore
Note that together with Condition (14) on the stepsize implies that
for . By Lemma 2.9, is positive and increasing, while is positive and decreasing in . Thus and for .
At the phase transition point , since and , relation (56) yields
Now consider and recall from case (c) and the proof of Lemma 2.12, that the dynamics effectively becomes the one with replaced by by considering and with initializations and .
To show our claim, it remains to characterize a time for which and apply Theorem 2.4 as for the case (a) with as initial condition. This will give
Together with the lower bound in (58) this gives
Since it follows by induction that
Implicit Bias of Gradient Descent
The explicit characterization of gradient flow and gradient descent dynamics derived in Section 2 may be used to shed some light on the phenomenon of implicit bias resp. implicit regularization of gradient descent. In fact, different convergence rates for different eigenvalues (depending on their respective signs and magnitudes) result in matrix iterates of low effective rank and accurately explain the implicit regularization observed when applying gradient descent to matrix factorization of symmetric matrices. We expect that a similar reasoning to be valid in more general contexts beyond matrix estimation.
and may be chosen arbitrarily. Note, however, that influences Theorem 3.1 since it controls the trade-off between the size of and tightness of the bound.
for all .
where is defined in (60), we obtain, for , that
2 Gradient Descent
After the simpler analysis of gradient flow, we now deduce a corresponding statement for gradient descent from the results in Section 2. In contrast to Theorem 3.1, it holds for a general number of layers . As before, we remark that the statement can be extended in a straight-forward but tedious way to handle general symmetric ground truths and additive noise.
In order to obtain a simplified estimate, we can choose and depending on and some of the eigenvalues of such that all three terms in (64) are bounded by . Additionally, replacing by its upper bound and by its upper bound (so that and are not needed for the estimate), this gives the choices
Of course, we may additionally set for some desired accuracy to obtain
Note in particular that (65) gives an indication on how to choose (smaller values of may also be fine). In particular, we require small enough initialization in comparison with the spectral norm .
Let us also remark that the lower bound (time needed to approximate the leading eigenvalues) in (63) may become larger than the upper bound (time in which the remaining eigenvalues of stay small) for certain parameter choices, i.e., the time interval of values for which the theorem can make a statement becomes empty. This is to be expected if there is no gap between and since then never comes arbitrarily close to and the time interval is indeed empty, for small . Figure 3, however, shows that the theorem does provide non-empty time-intervals in relevant situations.
The estimate (63) in Theorem 3.5 for the time interval where the effective rank of is close to the one of is slightly weaker than the ones in Theorem 3.1 and depends in terms of quality on the step-size . Since gradient flow is at the core of the gradient descent analysis, the bounds on gradient descent are more accurate if gradient descent stays close to its continuous flow, which is rather the case for small choices of than for large ones. To make this more precise, for small, the gap between necessary and sufficient iteration bounds in Theorem 2.4 shrinks and the prediction accuracy improves. Figure 7(b) shows that Theorem 3.5 yields an accurate description of the effective rank behavior as long as the step-size is chosen sufficiently small and the eigenvalue gap between and is sufficiently large to guarantee that the feasible region in (63) is non-empty.
To prove Theorem 3.5, we need the following lemma which is a direct consequence of the considerations in Theorem 2.4. Recall appearing in the proof of Theorem 2.4 (inflection point of eigenvalue dynamics) and define as the discrete dynamic following (18), i.e.,
The proof mainly relies on Theorem 2.4 characterizing the evolution of eigenvalues of by in (66). As in the proof of Theorem 3.1, we decompose the difference as
Let us now consider . For Lemma 3.8 yields
3 Our work in light of [9]
Theorems 3.1 and 3.5 only make a non-trivial claim if , , and are chosen in a way such that (resp. the set of valid choices for in (63) is non-empty). In [9, Theorems 2 & 3] the authors characterize, for any pair of eigenvalues of a positive semi-definite with , the maximal choice of such that and are well-approximated at distinguishable times. Applying these results to and , we thus can get a priori a necessary condition on for the existence of the -th effective rank plateau. Note, however, that the result on gradient descent [9, Theorem 3] only holds for the case . Although there is a partial overlap of theory between and our work, the main difference of [9, Theorems 2 & 3] and our Theorems 3.1 & 3.5 is that the former answer the question whether a plateau exists, whereas the latter characterize the time at which the plateaus occur if they exist.
Numerical Simulations
We have already demonstrated numerical results for our exact setting in Fig. 1 (effects of perturbation), Fig. 2 (effects of number of layers), Fig. 4 (accuracy of the prediction of a single eigenvalue), Fig. 6 (accuracy of low rank approximation), and Fig. 7 (difference between gradient flow and gradient descent).
In this section, we would like to numerically explore whether our findings also hold in more general situations. We demonstrate the impact of implicit bias and the ”waterfall” behavior of gradient descent on de-noising of real data. It should be noted that this experiment does not fully lie in the scope of the theory presented in the paper since the setting is not symmetric and the initialization is random. It shall illustrate generalizability of our findings. We consider an example from the MNIST-dataset . MNIST consists of images of handwritten digits from one to nine. All images have a resolution of and each of the pixels takes values in . For our simulation, we take 100 pictures of ones from the MNIST-dataset and create a matrix
in which each row is a vectorized MNIST-one. We run gradient descent with factorization depth on a noisy version of the ground truth. We consider uniform noise, i.e., the matrix satisfies
Moreover, the factorizations are initialized by zero mean Gaussian random matrices
Figures 8-12 illustrate setting and outcome of the experiment. Selected rows of and (reshaped to -pixel images) are depicted in Figure 9(d). Figure 8 shows that the singular values of the end-to-end iterates show several properties derived in the theory of this paper. We observe that deeper factorization indeed provokes sharper transition. Here deeper factorization converges faster because the leading eigenvalues are very large.
The figures (a)-(c) illustrate different properties of the gradient descent iterates during optimization. Note that the properties for the case use a different axis than the cases . Sub-figure (b) includes two different de-noising approaches as benchmarks: the best rank-one and rank-two approximation of (under all best rank approximations of , the rank-two approximation proved to be closest to in Frobenius metric). Sub-figure (d) illustrates a MNIST-One and a noisy version.
Discussion
In this paper we approached in a simplified setting the self-regularizing effect of gradient descent in multi-layer matrix factorization problems. For symmetric ground-truths, we analyzed the dynamics of gradient descent and its underlying continuous flow, and explicitly characterized the effective rank of gradient descent/flow iterates in dependence of model parameters like the spectrum of the ground truth matrix and number of layers of the factorization. In particular, we proved that early stopping of gradient descent produces effectively low-rank solutions. Numerical simulations both on toy and real data validated our theory. Viewing matrix factorization as training of a linear neural network, we believe that our results yield valuable insights in the implicit low-rank regularization of gradient descent observed in recent deep learning research. Extending the theory to more general settings should help to enlighten the implicit bias phenomenon of gradient descent.
We envision several directions for potential future work. First, we expect similar results for non-symmetric and rectangular ground-truths by using the singular value instead of the eigenvalue decomposition. Extending the theory accordingly, however, requires additional work on a technical level.
Finally, it would be desirable to generalize our explicit effective rank analysis to low rank matrix sensing when we do not have full information of the ground truth. In this underdetermined setting additional ambiguities appear and regularization becomes even more meaningful. Nevertheless, the analysis is more challenging due to additional coupling between the variables.
Acknowledgements
HHC and HR acknowledge funding by the DAAD through the project Understanding stochastic gradient descent in deep learning (project no. 57417829). JM and HR acknowledges funding by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) through the project CoCoMIMO funded within the priority program SPP 1798 Compressed Sensing in Information Processing (COSIP). HR acknowledges funding by the Federal Ministry of Education and Research (BMBF) and the Ministry of Culture and Science of the German State of North Rhine-Westphalia (MKW) under the Excellence Strategy of the Federal Government and the Länder. We wish to sincerely thank our colleagues Le Thang Huynh, Hans Christian Jung, and Ulrich Terstiege for the numerous joint discussions on the topic.
References
Appendix A Supplement to Remark 1.2
In this section, we provide a detailed derivation of (12) in Remark 1.2. Recall that we restrict ourselves to the case , , and , so that the initial matrix has small enough spectral norm compared to the -th eigenvalue of the ground truth, which in turn is larger than the desired accuracy . As mentioned in Remark 1.2, we have to assume that
for some so that (10) is satisfied. The quantity then takes the form (see the fourth case in (24))
The proof of Theorem 2.4 reveals that is related to the time the corresponding -th eigenvalue of the continuous dynamics needs to reach its “inflection point”, refers to the number of iterations required to reach an -accuracy approximation of the -th eigenvalue starting from the “inflection” point and is a term arising from comparing the discrete with the continuous dynamics in the phase before it reaches the “inflection point”. This last term may be an artefact of the proof; a lower bound for the convergence time does not require , but it does (essentially) require the other two terms.
The additional time to reach accuracy once the “inflection point” is reached is very small. Indeed, an accuracy (meaning relative accuracy ) is reached for
by (11) and for this choice of the quantity is given by
(where and are defined in the next section). Ignoring the term for the moment (which may be a proof artefact) shows that the convergence time is basically determined by , i.e., the time to reach the “inflection point”.
An analysis of the exact expression for , see (23) and Lemma E.1, shows that, for ,
This means that the larger an eigenvalue is in relation to and , the smaller is and the faster it is approximated by gradient descent, see also Figure 1(a) for an illustration. Moreover, the exponent at in the approximate expression for leads to the fact that the differences of consecutive “relative inverse eigenvalues” , , are “stretched out” more with increasing . Since the dynamics of the eigenvalues stays close to zero for a long time before reaching the inflection point (for small ), this has the effect that different eigenvalues can be distinguished by their convergence time more easily for larger , see again Figure 1(a). In turn this leads to a dynamics for the matrix with low rank approximations in the initial phase and plateaulike increasing effective rank, see also Figure 3.
Let us finally discuss the third term in (68) given by
In order to judge on the influence of on the above discussion, let us compare it to by forming the fraction
This means that while there is a non-negligible contribution of to for eigenvalues close to (and in particular, for ), the contribution does become negligible for relatively small . Moreover, larger again helps. Also note, that a small constant can also reduce the influence of . In particular, in the situation where we would like to distinguish significantly different eigenvalues (i.e., different from ) from their dynamics, it is valid to ignore and the above discussion taking into account only and applies.
Appendix B Optimality of Lemma 2.2
The following lemma shows, that the condition on in Lemma 2.2 is necessary up to a constant, since the fixed point becomes unstable otherwise. We say that a fixed point of the iteration is unstable if and . In particular, this means that iterations move away from the fix point once they are in a small enough neighborhood of , but do not reach exactly.
Let so that . For we have so that , for all . It follows that the iterates defined by form a diverging sequence unless . For , , and , we obtain
Hence, is an unstable equilibrium of the dynamics . For , , the analysis is slightly more complicated because but . However, if
which implies that with ; in particular . Hence, diverges as . ∎
Appendix C On Solutions of the Continuous Dynamics
As claimed in Remark 2.6, the solution of (28) can, for , be expressed in an alternative way that avoids complex logarithms. Introduce the function
The formula can be deduced from (22) by splitting the complex logarithm into real and imaginary parts.
Appendix D Supplement to Section 2.2
We provide here Lemma D.2 and D.3, which show the claim of Lemma 2.12 for non-negative and non-negative , respectively. In the following we repeatedly use the two auxiliary sequences
already defined in Section 2.2 to control the trajectory of . We, furthermore, abbreviate
We observe that the product dynamics satisfies the following relation.
Moreover, for . If , then on , is convex and has a unique zero. If and , then is concave on .
For simplicity we write below. By the definition of the dynamics in (40), we have
It follows from (71) that if . If and , this zero of is unique. Moreover, in this case the last line in is clearly positive for , which implies that so that is convex on . For the last claim, note that under the assumptions on , , , , and , implying that ,
It follows that the the expression after the first equality sign in (72) is negative, that is, and is concave on . ∎
Let and . Let be defined by (40) with the perturbed identical initialization (41) for . Assume that . Let and be the maximal real solution to the polynomial equation . If
We first note that because is continuous and satisfies , and for .
Recall the sequences , , and defined in (48) and (69). We will prove the claim by inductively showing that
Note that for all by Lemma 2.2. Hence, will imply that , while together with Condition (73) will lead to
where and are positive for so that is convex on the with unique global minimizer . Let and be as in (42) and note that is negative, while by the induction hypothesis (74). Using the induction hypothesis another time, i.e., the last inequality in (74), together with (73) it holds
Lemma 2.9 implies that , so that . Since , the induction hypothesis gives . Because is increasing on ,
We now have all necessary tools to prove that . First, we show that . By (76),
Using the induction hypothesis and by (73) we obtain
and we arrive at the induction step .
As a next step, we show that . We distinguish two cases: either or . Suppose first . Using (76) another time together with , we obtain
if . Since and for , it holds
so that and (73) implies the required condition on . Now suppose . Using another time gives
Since by Taylor expansion, we obtain, using again the induction hypothesis that ,
since . Thus .
It remains to show that . Using the induction hypothesis and for all , it follows that
for all . Therefore, Lemma 2.9 together with implies that and for all . This gives
which contradicts as shown above. Hence .
Let and . Let be defined by (40) with the perturbed identical initialization (41). Assume that . If
Since and by (78), the only solution to the fixed-point equation is , which proves the claim for .
For , the proof strategy is essentially the same as in Lemma D.2. Recall the sequences defined in (49) and (69). If , then and the claim trivially holds. Hence it suffices to consider .
using also (78) in the last step. Hence, by (44)
Lemma 2.9 implies that so that inductively , i.e., . Further note that due to the induction hypothesis, which implies , and our assumption (78) on , we have
Since also , implies that . Using another time in combination with , Lemma D.1 implies that is concave on , and . Hence, is monotonically decreasing on . Together with the induction hypothesis this gives
We will use this to prove that . Equation (79) implies that
We further note that by Lemma 2.2 in combination with (78) (noting that by assumption on ) the sequence satisfies . By a similar calculation as in the proof of Lemma D.2, we obtain, using the induction hypothesis ,
since by (78). Hence .
Next we show that . Similarly to the proof of Lemma D.2, we distinguish two cases: either or . Suppose first that . Another application of (79) together with yields
since , where the latter is implied by (78) with the fact that for , which follows from an elementary analysis. Now suppose . Using we obtain
The inequalities and , valid for , then lead to
since and . Thus .
Appendix E Simplified expression for convergence time
Since especially the exact term for defined in (23) and appearing in the bounds for the convergence times is hard to interpret, we give a simplified approximate expression in the following lemma.
Let and such that . Assume that , and
for some (so that (10) is satisfied). Then
where is a function satisfying for and
Recalling the definition of in (23) we obtain
With this gives
For being odd a similar computation gives
Plugging the above computations into (80) and using the definition of gives