Provable Efficient Online Matrix Completion via Non-convex Stochastic Gradient Descent
Chi Jin, Sham M. Kakade, Praneeth Netrapalli
Introduction
Low rank matrix completion refers to the problem of recovering a low rank matrix by observing the values of only a tiny fraction of its entries. This problem arises in several applications such as video denoising , phase retrieval and most famously in movie recommendation engines . In the context of recommendation engines for instance, the matrix we wish to recover would be user-item rating matrix where each row corresponds to a user and each column corresponds to an item. Each entry of the matrix is the rating given by a user to an item. Low rank assumption on the matrix is inspired by the intuition that rating of an item by a user depends on only a few hidden factors, which are much fewer than the number of users or items. The goal is to estimate the ratings of all items by users given only partial ratings of items by users, which would then be helpful in recommending new items to users.
The seminal works of Candès and Recht first identified regularity conditions under which low rank matrix completion can be solved in polynomial time using convex relaxation – low rank matrix completion could be ill-posed and NP-hard in general without such regularity assumptions . Since then, a number of works have studied various algorithms under different settings for matrix completion: weighted and noisy matrix completion, fast convex solvers, fast iterative non-convex solvers, parallel and distributed algorithms and so on.
Most of this work however deals only with the offline setting where all the observed entries are revealed at once and the recovery procedure does computation using all these observations simultaneously. However in several applications , we encounter the online setting where observations are only revealed sequentially and at each step the recovery algorithm is required to maintain an estimate of the low rank matrix based on the observations so far. Consider for instance recommendation engines, where the low rank matrix we are interested in is the user-item rating matrix. While we make an observation only when a user rates an item, at any point of time, we should have an estimate of the user-item rating matrix based on all prior observations so as to be able to continuously recommend items to users. Moreover, this estimate should get better as we observe more ratings.
Algorithms for offline matrix completion can be used to solve the online version by rerunning the algorithm after every additional observation. However, performing so much computation for every observation seems wasteful and is also impractical. For instance, using alternating minimization, which is among the fastest known algorithms for the offline problem, would mean that we take several passes of the entire data for every additional observation. This is simply not feasible in most settings. Another natural approach is to group observations into batches and do an update only once for each batch. This however induces a lag between observations and estimates which is undesirable. To the best of our knowledge, there is no known provable, efficient, online algorithm for matrix completion.
On the other hand, in order to deal with the online matrix completion scenario in practical applications, several heuristics (with no convergence guarantees) have been proposed in literature . Most of these approaches are based on starting with an estimate of the matrix and doing fast updates of this estimate whenever a new observation is presented. One of the update procedures used in this context is that of stochastic gradient descent (SGD) applied to the following non-convex optimization problem
where is the unknown matrix of size , is the rank of and is a low rank factorization of we wish to obtain. The algorithm starts with some and , and given a new observation , SGD updates the -row and the -row of the current iterates and respectively by
where is an appropriately chosen stepsize, and denote the row of matrix . Note that each update modifies only one row of the factor matrices and , and the computation only involves one row of and the new observed entry and hence are extremely fast. These fast updates make SGD extremely appealing in practice. Moreover, SGD, in the context of matrix completion, is also useful for parallelization and distributed implementation .
In this work we present the first provable efficient algorithm for online matrix completion by showing that SGD (2) with a good initialization converges to a true factorization of at a geometric rate. Our main contributions are as follows.
We provide the first provable, efficient, online algorithm for matrix completion. Starting with a good initialization, after each observation, the algorithm makes quick updates each taking time and requires observations to reach accuracy, where is the incoherence parameter, , is the rank and is the condition number of .
Moreover, our result features both sample complexity and total runtime linear in , and is competitive to even the best existing offline results for matrix completion. (either improve over or is incomparable, i.e., better in some parameters and worse in others, to these results). See Table 1 for the comparison.
To obtain our results, we introduce a general framework to show SGD updates tend to stay away from saddle surfaces. In order to do so, we consider distances from saddle surfaces, show that they behave like sub-martingales under SGD updates and use martingale convergence techniques to conclude that the iterates stay away from saddle surfaces. While shows that SGD updates stay away from saddle surfaces, the stepsizes they can handle are quite small (scaling as ), leading to suboptimal computational complexity. Our framework makes it possible to establish the same statement for much larger step sizes, giving us near-optimal runtime. We believe these techniques may be applicable in other non-convex settings as well.
2 Related Work
In this section we will mention some more related work.
Offline matrix completion: There has been a lot of work on designing offline algorithms for matrix completion, we provide the detailed comparison with our algorithm in Table 1. The nuclear norm relaxation algorithm has near-optimal sample complexity for this problem but is computationally expensive. Motivated by the empirical success of non-convex heuristics, a long line of works, and so on, has obtained convergence guarantees for alternating minimization, gradient descent, projected gradient descent etc. Even the best of these are suboptimal in sample complexity by factors. Our sample complexity is better than that of and is incomparable to those of . To the best of our knowledge, the only provable online algorithm for this problem is that of Sun and Luo . However the stepsizes they suggest are quite small, leading to suboptimal computational complexity by factors of . The runtime of our algorithm is linear in , which makes improvements over it.
Other models for online matrix completion: Another variant of online matrix completion studied in the literature is where observations are made on a column by column basis e.g., . These models can give improved offline performance in terms of space and could potentially work under relaxed regularity conditions. However, they do not tackle the version where only entries (as opposed to columns) are observed.
Non-convex optimization: Over the last few years, there has also been a significant amount of work in designing other efficient algorithms for solving non-convex problems. Examples include eigenvector computation , sparse coding etc. For general non-convex optimization, an interesting line of recent work is that of , which proves gradient descent with noise can also escape saddle point, but they only provide polynomial rate without explicit dependence. Later show that without noise, the space of points from where gradient descent converges to a saddle point is a measure zero set. However, they do not provide a rate of convergence. Another related piece of work to ours is , proves global convergence along with rates of convergence, for the special case of computing matrix squareroot. During the preparation of this draft, the recent work was announced which proves the global convergence of SGD for matrix completion and can also be applied to the online setting. However, their result only deals with the case where is positive semidefinite (PSD) and their rate is still suboptimal by factors of .
3 Outline
The rest of the paper is organized as follows. In Section 2 we formally describe the problem and all relevant parameters. In Section 3, we present our algorithms, results and some of the key intuition behind our results. In Section 4 we give proof outline for our main results. We conclude in Section 5. All formal proofs are deferred to the Appendix.
Preliminaries
In this section, we introduce our notation, formally define the matrix completion problem and regularity assumptions that make the problem tractable.
2 Problem statement and assumptions
Low rank matrix completion is the task of recovering by only observing . This task is ill-posed and NP-hard in general . In order to make this tractable, we make by now standard assumptions about the structure of .
Main Results
In this section, we present our main result. We will first state result for a special case where is a symmetric positive semi-definite (PSD) matrix, where the algorithm and analysis are much simpler. We will then discuss the general case.
The algorithm uses an initial set of observations to produce a warm start iterate , then enters the online stage, where it performs SGD.
The sample complexity of the warm start phase is . The initialization consists of a top- SVD on a sparse matrix, whose runtime is .
For the online phase (SGD), if we choose , the number of observations required for the error to be smaller than is .
Since each SGD step modifies two rows of , its runtime is with a total runtime for online phase of .
Our proof approach is to essentially show that the objective function is well-behaved (i.e., is smooth and strongly convex) in a local neighborhood of the warm start region, and then use standard techniques to show that SGD obtains geometric convergence in this setting. The most challenging and novel part of our analysis comprises of showing that the iterate does not leave this local neighborhood while performing SGD updates. Refer Section 4 for more details on the proof outline.
2 General Case
Algorithm 2 and Algorithm 3 are equivalent in the sense that: given same observations from and other inputs, the outputs of Algorithm 2, and those of Algorithm 3, satisfy .
Since the output of both algorithms is the same, we can analyze Algorithm 2 (which is easier than that of Algorithm 3), while implementing Algorithm 3 in practice. The following theorem is the main result of our paper which presents guarantees on the performance of Algorithm 2.
Just as in the case of PSD matrix completion (Theorem 3.1), Algorithm 2 needs a an initial set of observations to provide a warm start and after which it performs SGD.
The sample complexity and runtime of the warm start phase are the same as in symmetric PSD case. The stepsize and the number of observations to achieve error in online phase (SGD) are also the same as in symmetric PSD case.
However, runtime of each update step in online phase is with total runtime for online phase .
The proof of this theorem again follows a similar line of reasoning as that of Theorem 3.1 by first showing that the local neighborhood of warm start iterate has good smoothness and strong convexity properties and then use them to show geometric convergence of SGD. Proof of the fact that iterates do not move away from this local neighborhood however is significantly more challenging due to renormalization steps in the algorithm. Please see Appendix C for the full proof.
Proof Sketch
In this section we will provide the intuition and proof sketch for our main results. For simplicity and highlighting the most essential ideas, we will mostly focus on the symmetric PSD case (Theorem 3.1). For the asymmetric case, though the high-level ideas are still valid, a lot of additional effort is required to address the renormalization step in Algorithm 2. This makes the proof more involved.
First, note that our algorithm for the PSD case consists of an initialization and then stochastic descent steps. The following lemma provides guarantees on the error achieved by the initial iterate .
By Lemma 4.1, we know the initialization algorithm already gives in the local region given by Eq.(3). Intuitively, stochastic descent steps should keep doing local search within this local region.
For function and any , we have:
For function and any , we have:
Lemma 4.2 tells function is smooth if spectral norm of is not very large. On the other hand, not too small requires both and are not too small, where is top-k eigenspace of . That is, Lemma 4.3 tells function has a property similar to strongly convex in standard optimization literature, if is rank k in a robust sense ( is not too small), and the angle between the top k eigenspace of and the top k eigenspace is not large.
Within the region , we have:
Lemma 4.4 tells inside region , matrix always has a good spectral property which gives preconditions for both Lemma 4.2 and 4.3, where is both smooth and has a property very similar to strongly convex.
With above three lemmas, we already been able to see the intuition behind linear convergence in Theorem 3.1. Denote stochastic gradient
where is a random matrix depends on the randomness of sample of matrix . Then, the stochastic update step in Algorithm 1 can be rewritten as:
Let’s suppose ideally, we always have inside region , this directly gives:
One interesting aspect of our main result is that we actually show linear convergence under the presence of noise in gradient. This is true because for the second-order () term above, we can roughly see from Eq.(4) that , where is a factor depends on and always bounded. That is, enjoys self-bounded property — will goes to zero, as objective function goes to zero. Therefore, by choosing learning rate appropriately small, we can have the first-order term always dominate the second-order term, which establish the linear convergence.
Now, the only remaining issue is to prove that “ always stay inside local region ”. In reality, we can only prove this statement with high probability due to the stochastic nature of the update. This is also the most challenging part in our proof, which makes our analysis different from standard convex analysis, and uniquely required due to non-convex setting.
Let and . Suppose initial satisfying:
Then, there exist some absolute constant such that for any learning rate , with at least probability, we will have for all that:
Note function indicates the incoherence of matrix . Theorem 4.5 guarantees if inital is in the local region which is incoherent and is close to , then with high probability for all steps , , will always stay in a slightly relaxed local region, and has linear convergence.
It is not hard to show that all saddle point of satisfies , and all local minima are global minima. Since automatically stay in region with high probability, we know also stay away from all saddle points. The claim that stays incoherent is essential to better control the variance and probability 1 bound of , so that we can have large step size and tight convergence rate.
The major challenging in proving Theorem 4.5 is to both prove stays in the local region, and achieve good sample complexity and running time (linear in ) in the same time. This also requires the learning rate in Algorithm 1 to be relatively large. Let the event denote the good event where satisfies Eq.(5). Theorem 4.5 is claiming that is large. The essential steps in the proof is contructing two supermartingles related to and (where denote indicator function), and use Bernstein inequalty to show the concentration of supermartingales. The term allow us the claim all previous have all desired properties inside local region.
Finally, we see Theorem 3.1 as a immediate corollary of Theorem 4.5.
Conclusion
In this paper, we presented the first provable, efficient online algorithm for matrix completion, based on nonconvex SGD. In addition to the online setting, our results are also competitive with state of the art results in the offline setting. We obtain our results by introducing a general framework that helps us show how SGD updates self-regulate to stay away from saddle points. We hope our paper and results help generate interest in online matrix completion, and our techniques and framework prompt tighter analysis for other nonconvex problems.
References
Appendix A Proof of Initialization
In this section, we will prove Lemma 4.1 and a corresponding lemma for asymmetric case as follows (which will be used to prove Theorem 3.3):
We will focus mostly on Lemma A.1, and prove Lemma 4.1 as a special case. Most of the argument of this section follows from . We include here for completeness. The remaining of this section can be viewed as proving both the Frobenius norm claim and incoherence claim of Lemma A.1 seperately.
In this section, We always denote . For simplicity, WLOG, we also assume in all proof. Also, when it’s clear from the context, we use to specifically to represent . Then . Also in the proof, we always denote , and , where and are diagonal matrix.
A finite sequence of independent, random matrices with dimension . Assume that each matrix satisfies:
Let , then there exists universal constant , for any , with probability at least , we have:
where are independence Bernoulli random variables. Let matrix
Then, by matrix Bernstein (Theorem A.2), we have:
That is, with probability at least , for some universal constant , we have:
For , we finishes the proof. ∎
Let be the top- SVD of , where then there exists universal constant , for any , with probability at least , we have:
Since is a rank matrix, we know , thus
Meanwhile, since , , we know: , and therefore:
by choosing for large enough constant and apply Lemma A.3, we finishes the proof. ∎
A.2 Incoherence of Initialization
Let be the top- SVD of , where . then there exists universal constant , for any , with probability at least , we have:
For the first term, since , we have:
The last step is due to sample , and theorem A.4.
Therefore, with , by matrix Bernstein, we have with probability at least , we know that for all , there exists some absolute constant so that:
Combine above two equations and choose for some large enough . We have:
Let be the top- SVD of , where . then there exists universal constant , for any , with probability at least , we have:
By Theorem A.5, we know for any :
By symmetry, we also know for any
Let be the top- SVD of , where . then there exists universal constant , for any , with probability at least , we have:
On the other hand, by Theorem A.4, we have:
Finally, Lemma A.1 can be easily concluded from Theorem A.4 and Theorem A.6, while Lemma 4.1 is also directly proved by Theorem A.4 and Corollary A.7.
Appendix B Proof of Symmetric PSD Case
In this section, we prove Theorem 3.1. WLOG, we continue to assume in all proof. Also, when it’s clear from the context, we use to specifically to represent . Then . Also in this section, we always denote , and .
The most essential part to prove Theorem 3.1 is proving following Theorem:
Let and . Suppose after initialization, we have:
Then, there exist some absolute constant such that for any learning rate , with at least probability, we will have for all that:
Theorem B.1 says once initialization algorithm provides in good local region, with high probability will always stay in this good region and is linear converging to 0. With this theorem, we can then immediately conclude Theorem 3.1 from Theorem B.1 and Lemma 4.1.
The rest of this section all focus on proving Theorem B.1. First, we prepare with a few lemmas about the property of objective function, and the spectral property of in a local Frobenius ball around optimal. Then, we prove Theorem B.1 by constructing two supermartingales related to each, and applying concentration argument.
For symmetric PSD case, we denote the stochastic gradient as:
The update in Algorithm 1 can be now written as:
First, we prove two lemmas w.r.t the smoothness and property similar to strongly convex for objective function:
(restatement of Lemma 4.2) Within the region , we have function satisfying for any :
where smoothness parameter .
(restatement of Lemma 4.3) Within the region , then we have function satisfying:
Inside region , recall we denote , thus we have:
Next, we show as long as we are in some Frobenious ball around optimum, then we have good spectral property over which guarantees the preconditions for Lemma B.2 and Lemma B.3.
(restatement of Lemma 4.4) Within the region , we have:
For spectral norm of , we have:
For the minimum singular value of , we have:
Let the principal angle between and to be . This gives . Thus . Therefore:
B.2 Proof of Theorem B.1
Now, we are ready for our key theorem. By Lemma B.2, Lemma B.3, and Lemma B.4, we already know the function has good property locally in the region which alludes linear convergence. Then, the work remains and also the most challenging part is to prove that once we initialize inside this region, our algorithm will guarantee never leave this region with high probability even with relatively large stepsize. The requirement for tight sample complexity and near optimal runtime makes it more challenging, and require us to further control the incoherence of over all iterates in addition to the distance .
Define event . Theorem B.1 is equivalent to prove event happens with high probability. The proof achieves this by contructing two supermartingales for and (where denote indicator function), applies concentration argument.
Their probability 1 bound and variance bound in order to apply Azuma-Bernstein inequality
Final combination of concentration results to conclude the proof
First, let filtration where denotes the sigma field. Note by definiton of , we have . Also , and thus . Note denotes the event which up to time , always stay in a local region which both close to and incoherent.
By Lemma B.4, we immediately know that conditioned on , we have , and . We will use this fact throughout the proof.
Since is a quadratic function, we know for any change , we have:
The last step is true by choosing constant in learning rate to be small enough.
Let . This gives:
Probability 1 bound for G𝐺G:
Since when sample entry of matrix , for any , we have:
Therefore, by Eq.(9), we have with probability 1:
Variance bound for G𝐺G:
Bernstein’s inequality for G𝐺G:
Since , let , we know
by and choosing to be small enough, we have:
Since initialization gives , therefore:
Construction of supermartingale F𝐹F:
Let , we know is also a supermartingale.
Probability 1 bound for F𝐹F:
where depends on .
First, recall we denote , and , and observe that:
Then, when sample entry of matrix , we have:
Therefore, by decomposition Eq.(13), we have with probability 1:
Variance bound for F𝐹F:
Therefore, by decomposition Eq.(13), we have:
Bernstein’s inequality for F𝐹F:
Let , this gives:
by and choosing to be small enough, we have:
Since , therefore:
Finally, combining the concentration result for martingale (Eq.(12)) and martingale (Eq.(16)), we conclude:
Appendix C Proof of General Asymmetric Case
In this section, we first prove Lemma 3.2, set up the equivalence between Algorithm 2 and Algorithm 3. Then we prove the main theorem for general asymmetric matrix (Theorem 3.3). WLOG, we continue to assume in all proof. Also, when it’s clear from the context, we use to specifically to represent . Then . Also in this section, we always use and denote , and .
Clearly with same initialization algorithm, we have , by induction, we finish the proof. ∎
Now we proceed to prove Theorem 3.3. Since Algorithm 2 and Algorithm 3 are equivalent, we will focus our analysis on Algorithm 2 which is more theoretical appealing. As for the symmetric PSD case, we first present the essential ingradient:
Let , , and , for and . Suppose after initialization, we have:
Then, there exist some absolute constant such that for any learning rate , with at least probability, we will have for all that:
Theorem 3.3 can easily be concluded from Theorem C.1 and Lemma A.1. Theorem C.1 also provides similar guarantees as Theorem B.1 in symmetric case. However, due to the additional invariance between and , Theorem C.1 need to keep track of more complicated potential function and to control the incoherence, which makes the proof more involved.
The rest of this section all focus on proving Theorem C.1. Similar to symmetric PSD case, we also first prepare with a few lemmas about the property of objective function, and the spectral property of in a local Frobenius ball around optimal. Then, we prove Theorem C.1 by constructing three supermartingales related to each, and applying concentration argument.
Also denote the stochastic gradient by (if we sampled entry of matrix )
Similar to symmetric PSD case, we first prove two lemmas w.r.t the smoothness and property similar to strongly convex for objective function:
Within the region , we have function satisfying:
where smoothness parameter .
The last step is by similar technics as in the proof of Lemma B.2, by expanding
Within the region , then we have function satisfying:
Let be the left singular vectors of . Inside region , we have:
Next, we show as long as we are in some Frobenious ball around optimum, then we have good spectral property over which guarantees the preconditions for Lemma C.2 and Lemma C.3.
Within the region , and for where , we have:
For spectral norm of , we have:
For the minimum singular value of , we have:
By symmetry, the same holds for . On the other hand, we have:
Let the principal angle between and to be . This gives . Thus . Therefore:
C.2 Proof of Theorem C.1
Now, we are ready for our key theorem. By Lemma C.2, Lemma C.3, and Lemma C.4, we already know the function has good property locally in the region which alludes linear convergence. Similar to the symmetric PSD case, the work remains is to prove that once we initialize inside this region, our algorithm will guarantee never leave this region with high probability even with relatively large stepsize. Again, we also need to control the incoherence of over all iterates additionally to achieve tight sample complexity and near optimal runtime.
For simplicity of notation, we assume , and do not distinguish and . However, it is easy to check our proof never use the property is square matrix. The proof easily extends to case by replacing in the proof with suitable .
Define event . Theorem C.1 is equivalent to prove event happens with high probability. The proof achieves this by contructing two supermartingales for , and (where denote indicator function), applies concentration argument.
The proofs also follow similar structure as symmetric PSD case:
Their probability 1 bound and variance bound in order to apply Azuma-Bernstein inequality
Final combination of concentration results to conclude the proof
Then let filtration where denotes the sigma field. Also let event , note . Also , and thus .
By Lemma C.4, we immediately know that conditioned on , we have , , , . We will use this fact throughout the proof.
For simplicity, when it’s clear from the context, we denote:
First, since potential function is forth-order polynomial, we can expand:
Where we denote as the sum of first order terms and higher order terms (all second/third/forth order terms), and as the sum of second order terms and higher order terms.
We now give a proposition about properties of and which involves a lot calculation, and postpone its proof in the end of this section.
With above notations, we have following inequalities hold true.
Then by taking conditional expectation, we have:
The first order term can be calculated as:
In second last inequality, we use key observation:
The last inequality is achieved by choosing small enough.
The right inequality is true since . This implies is supermartingale.
Probability 1 bound for G𝐺G:
By Proposition C.5, we know with probability 1 that . This gives with probability 1:
Variance bound for G𝐺G:
Bernstein’s inequality for G𝐺G:
by and choosing to be small enough, we have:
Since initialization gives , therefore:
Construction of supermartingale F:
Where we denote as the sum of first order terms and higher order terms (all second/third/forth order terms), and as the sum of second order terms and higher order terms.
We also now give a proposition about properties of and which involves a lot calculation, and postpone its proof in the end of this section.
With above notations, we have following inequalities hold true.
Probability 1 bound:
By Proposition C.6, we know with probability 1 that . This gives with probability 1:
Variance bound:
Bernstein’s inequality:
Let , this gives:
by and choosing to be small enough, we have:
Since , therefore:
Finally, combining the concentration result for martingale (Eq.(19)) and martingale (Eq.(22)), we conclude:
Finally we give proof for Proposition C.5 and Proposition C.6. The proof mostly consistsof expanding every term and careful calculations.
For simplicity of notation, we hide the term in all following equations. Reader should always think every term in this proof multiplied by . Recall that:
We first prove first three inequality. Recall that:
By expanding the polynomial, we can write out the first order term:
and recall we choose , where is some universal constant, then we have:
With equation (23), (24), (25), (26), now we are ready to prove Lemma.
This gives in sum that, with probability 1:
Similarly to the proof of Proposition C.5, we hide the term in all following equations. Reader should always think every term in this proof multiplied by . Recall that:
By expanding the polynomial, we can write out the first order term:
Again, in addition to equation (23), (23), (24), (25), we also need following inequality:
This gives in sum that, with probability 1: