Faster Eigenvector Computation via Shift-and-Invert Preconditioning
Dan Garber, Elad Hazan, Chi Jin, Sham M. Kakade, Cameron Musco, Praneeth Netrapalli, Aaron Sidford
Introduction
On a high-level, our algorithms are based on a robust analysis of the classic idea of shift-and-invert preconditioning [Saa92], which allows us to efficiently reduce eigenvector computation to approximately solving a short sequence of well-conditioned linear systems in for some shift parameter . We then apply state-of-the-art stochastic gradient methods to approximately solve these linear systems.
Typically, stochastic gradient methods are used to optimize convex functions that are given as the sum of many convex components. To solve a linear system we minimize the convex function with components where is the row of . Such an approach can be used to solve systems in , however solving systems in requires more care. We require an analysis of SVRG that guarantees convergence even when some of our components are non-convex. We give a simple analysis for this setting, generalizing recent work in the area [SS15, CR15].
2 Our Results
Overall, our robust shifted-and-inverted power method analysis gives new understanding of this classical technique. It gives a means of obtaining provably accurate results when each iteration is implemented using fast linear system solvers with weak accuracy guarantees. In practice, this reduction between approximate linear system solving and eigenvector computation shows that optimized regression libraries can be leveraged for faster eigenvector computation in many cases. Furthermore, in theory we believe that the reduction suggests computational limits inherent in eigenvector computation as seen by the often easier-to-analyze problem of linear system solving. Indeed, in Section 7, we provide evidence that in certain regimes our statistical results are optimal.
3 Previous Work
Due to its universal applicability, eigenvector computation in the offline case is extremely well studied. Classical methods, such as the QR algorithm, take roughly time to compute a full eigendecomposition. This can be accelerated to , where is the matrix multiplication constant [Wil12, LG14], however this is still prohibitively expensive for large matrices. Hence, faster iterative methods are often employed, especially when only the top eigenvector (or a few of the top eigenvectors) is desired.
The result in [Sha15c] makes an important contribution in separating input size and gap dependencies using stochastic optimization techniques. Unfortunately, the algorithm requires an approximation to the eigenvalue gap and a starting vector that has a constant dot product with the top eigenvector. In [Sha15b] the analysis is extended to a random initialization, however loses polynomial factors in . Furthermore, the dependencies on the stable rank and are suboptimal – we improve them to and respectively, obtaining true linear convergence.
Online Eigenvector Computation
While in the offline case the primary concern is computation time, in the online, or statistical setting, research also focuses on minimizing the number of samples that are drawn from in order to achieve a given accuracy. Especially sought after are results that achieve asymptotically optimal accuracy as the sample size grows large.
A large body of work focuses on improving this simple algorithm, under a variety of assumptions on . A common focus is on obtaining streaming algorithms, in which the storage space is just - proportional to the size of a single sample. In Table 2 we give a sampling of results in this area. All listed results rely on distributional assumptions at least as strong as those given above.
The bounds given for the simple matrix Bernstein based algorithm described above, Krasulina/Oja’s Algorithm [BDF13], and SGD [Sha15a] require no additional assumptions, aside from those given at the beginning of this section. The streaming results cited for [MCJ13] and [HP14] assume is generated from a Gaussian spike model, where and . We note that under this model, the matrix Bernstein results improve by a factor and so match our results in achieving asymptotically optimal convergence rate. The results of [MCJ13] and [HP14] sacrifice this optimality in order to operate under the streaming model. Our work gives the best of both works – a streaming algorithm giving asymptotically optimal results.
4 Paper Organization
Review problem definitions and parameters for our runtime and sample bounds.
Describe the shifted-and-inverted power method and show how it can be implemented using approximate system solvers.
Show how to apply SVRG to solve systems in our shifted matrix, giving our main runtime results for offline eigenvector computation.
Show how to use an online variant of SVRG to run the shifted-and-inverted power method, giving our main sampling complexity and runtime results in the statistical setting.
Show how to efficiently estimate the shift parameters required by our algorithms.
Give a lower bound in the statistical setting, showing that our results are asymptotically optimal for a wide parameter range.
Preliminaries
2 The Statistical Problem
3 Problem Parameters
We use the following additional parameters for the offline and statistical problems respectively:
Algorithmic Framework
Here we develop our robust shift-and-invert framework. In Section 3.1 we provide a basic overview of the framework and in Section 3.2 we introduce the potential function we use to measure progress of our algorithms. In Section 3.3 we show how to analyze the framework given access to an exact linear system solver and in Section 3.4 we strengthen this analysis to work with an inexact linear system solver. Finally, in Section 3.5 we discuss initializing the framework.
2 Potential Function
Our analysis of the power method focuses on the objective of maximizing the Rayleigh quotient, for a unit vector . Note that as the following lemma shows, this has a direct correspondence to the error in maximizing :
Among all unit vectors such that , a minimizer of has the form for some . We have
In order to track the progress of our algorithm we use a more complex potential function than just the Rayleigh quotient error, . Our potential function is defined for by
where and are the projections onto and the subspace orthogonal to respectively. Equivalently, we have that:
When the Rayleigh quotient error of is small, we can show a strong relation between and . We prove this in two parts. We first give a technical lemma, Lemma 2, that we will use several times for bounding the numerator of . We then prove the connection in Lemma 3.
Since and since is an eigenvector of with eigenvalue we have
Since is an eigenvector of , we can write . Lemmas 1 and 2 then give us:
3 Power Iteration
Here we show that the shifted-and-inverted power iteration in fact makes progress with respect to our objective function given an exact linear system solver for . Formally, we show that applying to a vector decreases the potential function geometrically.
Let be a unit vector with and let , i.e. the power method update of on . Then, under our assumption on , we have:
Note that may no longer be a unit vector. However, for any scaling parameter , so the theorem also holds for scaled to have unit norm.
Writing in the eigenbasis, we have and . Since , and by the equivalent formulation of given in (1):
The challenge in using the above theorem, and any traditional analysis of the shifted-and-inverted power method, is that we don’t actually have access to . In the next section we show that the shifted-and-inverted power method is robust – we still make progress on our objective function even if we only approximate using a fast linear system solver.
4 Approximate Power Iteration
We are now ready to prove our main result. We show that each iteration of the shifted-and-inverted power method makes constant factor expected progress on our potential function assuming we:
Start with a sufficiently good and an approximation of
Can apply approximately using a system solver such that the function error (i.e. distance to in the norm) is sufficiently small in expectation.
Can estimate Rayleigh quotients over well enough to only accept updates that do not hurt progress on the objective function too much.
This third assumption is necessary since the second assumption is quite weak. An expected progress bound on the linear system solver allows, for example, the solver to occasionally return a solution that is entirely orthogonal to , causing us to make unbounded backwards progress on our potential function. The third assumption allows us to reject possibly harmful updates and ensure that we still make progress in expectation. In the offline setting, we can access and are able to compute Rayleigh quotients exactly in time time. However, we only assume the ability to estimate quotients since in the online setting we only have access to through samples from .
Our general theorem for the approximate power iteration, Theorem 5, assumes that we can solve linear systems to some absolute accuracy in expectation. This is not completely standard. Typically, system solver analysis assumes an initial approximation to and then shows a relative progress bound – that the quality of the initial approximation is improved geometrically in each iteration of the algorithm. In Corollary 6 we show how to find a coarse initial approximation to , in fact just approximating with . Using this approximation, we show that Theorem 5 actually implies that traditional system solver relative progress bounds suffice.
Note that in both claims we measure error of the linear system solver using . This is a natural norm in which geometric convergence is shown for many linear system solvers and directly corresponds to the function error of minimizing to compute .
and
That is, not only do we decrease our potential function by a constant factor in expectation, but we are guaranteed that the potential function will never increase beyond .
The first claim follows directly from our choice of from and . If , it holds trivially by our assumption that . Otherwise, and we know that
and by Theorem 4 and the definition of we have
Taking expectations, using that , and combining these three inequalities yields
So, conditioning on making an update and changing (i.e. occurring), we see that our potential function changes exactly as in the exact case (Theorem 4) with additional additive error due to our inexact linear system solve.
which then implies by Markov inequality that
Let us now show that . Suppose is occurs. We can bound as follows:
where we use Lemmas 2 and 3 to conclude that . We now turn to showing the Rayleigh quotient condition required by . In order to do this, we first bound and then use Lemma 2. We have:
Combining (4) and (5) shows that there by proving (3).
Since is PSD we see that if we let , then the minimizer is . Furthermore note that and therefore
which with Theorem 5 then completes the proof. ∎
5 Initialization
Theorem 5 and Corollary 6 show that, given a good enough approximation to , we can rapidly refine this approximation by applying the shifted-and-inverted power method. In this section, we cover initialization. That is, how to obtain a good enough approximation to apply these results.
We first give a simple bound on the quality of a randomly chosen start vector .
Suppose , and we initialize as , then with probability greater than , we have:
where .
We now show that we can rapidly decrease our initial error to obtain the required bound for Theorem 5.
where . Then the following procedure,
after iterations satisfies:
with probability greater than .
As before, we first bound the numerator and denominator of more carefully as follows:
We now use the above estimates to bound .
By Lemma 7, we know with at least probability , we have .
Conditioned on high probability result of , we now use induction to prove . It trivially holds for . Suppose we now have , then by the condition in Theorem 8 and Markov inequality, we know with probability greater than we have:
The last inequality uses Corollary 6 with the fact that . Therefore, we have: We will have:
Finally, by union bound, we know with probability greater than in steps, we have:
Offline Eigenvector Computation
In this section we show how to instantiate the framework of Section 3 in order to compute an approximate top eigenvector in the offline setting. As discussed, in the offline setting we can trivially compute the Rayleigh quotient of a vector in time as we have explicit access to . Consequently the bulk of our work in this section is to show how we can solve linear systems in efficiently in expectation, allowing us to apply Corollary 6 of Theorem 5.
In Section 4.1 we first show how Stochastic Variance Reduced Gradient (SVRG) [JZ13] can be adapted to solve linear systems of the form . If we wanted, for example, to solve a linear system in a positive definite matrix like , we would optimize the objective function . This function can be written as the sum of convex components, . In each iteration of traditional gradient descent, one computes the full gradient of and takes a step in that direction. In stochastic gradient methods, at each iteration, a single component is sampled, and the step direction is based only on the gradient of the sampled component. Hence, we avoid a full gradient computation at each iteration, leading to runtime gains.
Unfortunately, while we have access to the rows of and so can solve systems in , it is less clear how to solve systems in . To do this, we will split our function into components of the form for some set of weights with .
Importantly, may not be positive semidefinite. That is, we are minimizing a sum of functions which is convex, but consists of non-convex components. While recent results for minimizing such functions could be applied directly [SS15, CR15] here we show how to obtain stronger results by using a more general form of SVRG and analyzing the specific properties of our function (i.e. the variance).
With our solvers in place, in Section 4.3 we pull our results together, showing how to use these solvers in the framework of Section 3 to give faster running times for offline eigenvector computation.
Here we provide a sampling based algorithm for solving linear systems in . In particular we provide an algorithm for solving the more general problem where we are given a strongly convex function that is a sum of possibly non-convex functions that obey smoothness properties. We provide a general result on bounding the progress of an algorithm that solves such a problem by non-uniform sampling in Theorem 9 and then in the remainder of this section we show how to bound the requisite quantities for solving linear systems in .
where is a variance parameter, then for all we have
Consequently, if we pick to be a sufficiently small multiple of then when we can decrease the error by a constant multiplicative factor in expectation.
We now apply the fact that to give:
And summing over all iterations and taking expectations we have:
Theorem 9 immediately yields a solver for . Finding the minimum norm solution to this system is equivalent to minimizing . If we take the common approach of applying a smoothness bound for each along with a strong convexity bound on we obtain:
so we have . Setting for all , we have
where the last step uses that so . ∎
(Improved Variance Bound for SVRG) For let
so we have . Setting for all , we have for all
Using the gradient computation in (8) we have
Plugging the bound in Lemma 11 into Theorem 9 we have:
The procedure requires time to initially compute , along with each and the step size which depend on and the row norms of . Each iteration then just requires time to compute and perform the necessary vector operations. Since there are at most iterations, our total runtime is
2 Accelerated Solver
Theorem 12 gives a linear solver for that makes progress in expectation and which we can plug into Theorems 5 and 8. However, we first show that the runtime in Theorem 12 can be accelerated in some cases. We apply a result of [FGKS15b], which shows that, given a solver for a regularized version of a convex function , we can produce a fast solver for itself. Specifically:
in time . Then given any , , , we can compute such that
in time
We first give a new variance bound on solving systems in when a regularizer is used. The proof of this bound is very close to the proof given for the unregularized problem in Lemma 11.
so we have . Setting for all , we have for all
For simplicity we now just use the fact that and apply our bound from equation (9) to obtain:
Now, is strongly convex, so
Following Theorem 12, the variance bound of Lemma 14 means that we can make constant progress in minimizing in time where . So, for we can make progress, as required by Lemma 13 in time time. Hence by Lemma 13 we can make constant factor expected progress in minimizing in time:
3 Shifted-and-Inverted Power Method
Finally, we are able to combine the solvers from Sections 4.1 and 4.2 with the framework of Section 3 to obtain faster algorithms for top eigenvector computation.
Online Eigenvector Computation
Here we show how to apply the shifted-and-inverted power method framework of Section 3 to the online setting. This setting is more difficult than the offline case. As there is no canonical matrix , and we only have access to the distribution through samples, in order to apply Theorem 5 we must show how to both estimate the Rayleigh quotient (Section 5.1) as well as solve the requisite linear systems in expectation (Section 5.2).
After laying this ground work, our main result is given in Section 5.3. Ultimately, the results in this section allow us to achieve more efficient algorithms for computing the top eigenvector in the statistical setting as well as improve upon the previous best known sample complexity for top eigenvector computation. As we show in Section 7 the bounds we provide in this section are in fact tight for general distributions.
Here we show how to estimate the Rayleigh quotient of a vector with respect to . Our analysis is standard – we first approximate the Rayleigh quotient by its empirical value on a batch of samples and prove using Chebyshev’s inequality that the error on this sample is small with constant probability. We then repeat this procedure times and output the median. By a Chernoff bound this yields a good estimate with probability . The formal statement of this result and its proof comprise the remainder of this subsection.
Given , , and unit vector set and . For all and let be drawn independently from and set and . If we let be median value of the then with probability we have .
The median satisfies as more than half of the satisfy . This happens with probability by Chernoff bound, our choice of and (12). ∎
2 Solving the Linear system
The performance of streaming SVRG [FGKS15a] is governed by three regularity parameters. As in the offline case, we use the fact that is -strongly convexity for and we require a smoothness parameter, denoted , that satisfies:
Furthermore, we require an upper bound the variance, denoted , that satisfies:
With the following two lemmas we bound these parameters.
Our proof is similar to the one for Lemma 10.
Furthermore, since we have
Combining these three equations yields the result. ∎
With the regularity parameters bounded we can apply the streaming SVRG algorithm of [FGKS15a] to solve systems in . We encapsulate the core iterative step of Algorithm of [FGKS15a] as follows:
and return as the output.
The accuracy of the above iterative step is proven in Theorem 4.1 of [FGKS15a], which we include, using our notation below:
Using Theorem 22 we can immediately obtain the following guarantee for solve system in :
Using the inequality we have that
Now the number of samples used to compute is clearly at most Now
3 Online Shifted-and-Inverted Power Method
We now apply the results in Section 5.1 and Section 5.2 to the shifted-and-inverted power method framework of Section 3 to give our main result in the online setting, an algorithm that quickly refines a coarse approximation to into a finer approximation.
Parameter Estimation for Offline Eigenvector Computation
In this section, for simplicity we initially assume that we have oracle access to compute for any given , and any . We will then show how to achieve the same results when we can only compute approximately. We use a result of [MM15] that gives gap free bounds for computing eigenvalues using the power method. The following is a specialization of Theorem 1 from [MM15]:
Throughout the proof, we assume is picked to be some large constant - e.g. . Theorem 26 implies:
Conditioning on the event that Theorem 26 holds for all iterates , then the iterates of Algorithm 1 satisfy:
The proof can be decomposed into two parts:
Part I (Lines 3-4): Theorem 26 tells us that . This means that we have
Part II (Lines 5-6): Consider now iteration . We now apply Theorem 26 to the matrix . The top eigenvalue of this matrix is . This means that we have , and hence we have,
Since is the second eigenvalue of the matrix , Theorem 26 tells us that
This immediately yields the first claim. For the second claim, we notice that
where follows from the first claim of this lemma, and follows from Lemma 27. ∎
We now state and prove the main result in this section:
This means that the exit condition on Line must be triggered in iteration, proving the first part of the lemma.
For upper bound, by Lemmas 27, 28 and exit condition we know:
Note that, although we proved the upper bound and lower bound in Theorem 29 with specific constants coefficient and , this analysis can easily be extended to any smaller constants by modifying the constant in the exit condition, and choosing larger. Also in the failure probability
Finally, we can also bound the runtime of algorithm 1, when we use SVRG based approximate linear system solvers for .
Lower Bounds
Here we show that our online eigenvector estimation algorithm (Theorem 25) is asymptotically optimal - as sample size grows large it achieves optimal accuracy as a function of sample size. We rely on the following lower bound for eigenvector estimation in the Gaussian spike model:
where , and . Let be some estimator of the top eigenvector . Then, there is some universal constant , so that for sufficiently large, we have:
Suppose the claim of theorem is not true, then there exist some estimator so that
holds for all distribution , and for any fixed constant when is sufficiently large.
Let distribution be the Gaussian Spike Model specified by Eq.(16), then by calculation, it’s not hard to verify that:
Gap-Free Bounds
Let be our error parameter and be the number of eigenvalues of that are . Choose . We have . For we have . .
Let have columns equal to all bottom eigenvectors with eigenvalues . Let have columns equal to the remaining top eigenvectors. We define a simple modified potential:
We have the following Lemma connecting this potential function to eigenvalue error:
For unit , if for sufficiently small constant then .
So if then and since , this gives . So we have for small enough , giving the lemma. ∎
We now follow the proof of Lemma 8, which is actually much simpler in the gap-free case.
after iterations satisfies:
with probability greater than .
By Lemma 7, we know with at least probability , we have . We want to show by induction that at iteration we have , which will give us the lemma if we set .
Initially, we have with high probability, by the argument in Lemma 7, so we have . This also holds by induction in each iteration.
Let . so we have
and since we have:
So over all iterations, we always have and so . Combining the above bounds:
Finally, we combine Theorem 34 with the SVRG based solvers of Theorem 12 and 15 to obtain:
Let for and let be a random initial vector. Running the inverted power method on initialized with , using the SVRG solver from Theorem 12 to approximately apply at each step, returns such that with probability , in time
Let for and let be a random initial vector. Running the inverted power method on initialized with , using the SVRG solver from Theorem 15 to approximately apply at each step, returns such that with probability , in total time
Acknowledgements
Sham Kakade acknowledges funding from the Washington Research Foundation for innovation in Data-intensive Discovery.
References
Appendix A Appendix
We can any unit vector as where is the component of orthogonal to and . We know that
We have .
We want to bound so . Since is the top eigenvector of we have:
This means we need have meaning as desired. ∎
Let be a unit vector with and let , i.e. the power method update of on . Then, we have both:
(17) was already shown in Lemma 4. We show (18) similarly.
Writing in the eigenbasis of , we have and . Since , and we have: