Randomized Block Krylov Methods for Stronger and Faster Approximate Singular Value Decomposition

Cameron Musco, Christopher Musco

Introduction

Among countless applications, the SVD is used for optimal low-rank approximation and principal component analysis (PCA)Typically after mean centering A\mathbf{A}’s columns or rows, depending on which principal components we want.. Specifically, for k<rk<r, a partial SVD can be used to construct a rank kk approximation Ak\mathbf{A}_{k} such that both ∥A−Ak∥F\|\mathbf{A}-\mathbf{A}_{k}\|_{F} and ∥A−Ak∥2\|\mathbf{A}-\mathbf{A}_{k}\|_{2} are as small as possible. We simply set Ak=UkUkTA\mathbf{A}_{k}=\mathbf{U}_{k}\mathbf{U}_{k}^{T}\mathbf{A}. That is, Ak\mathbf{A}_{k} is A\mathbf{A} projected onto the space spanned by its top kk singular vectors.

For principal component analysis, A\mathbf{A}’s top singular vector u1\mathbf{u}_{1} provides a top principal component, which describes the direction of greatest variance within A\mathbf{A}. The ithi^{\text{th}} singular vector ui\mathbf{u}_{i} provides the ithi^{\text{th}} principal component, which is the direction of greatest variance orthogonal to all higher principal components. Formally, denoting A\mathbf{A}’s ithi^{\text{th}} singular value as σi\sigma_{i},

Traditional SVD algorithms are expensive, typically running in O(nd2)O(nd^{2}) timeThis is somewhat of an oversimplicifcation. By the Abel-Ruffini Theorem, an exact SVD is incomputable even with exact arithmetic . Accordingly, all SVD algorithm are inherently iteratively. Nevertheless, traditional methods including the ubiquitous QR algorithm obtain superlinear convergence rates for the low-rank approximation problem. In any reasonable computing environment, they can be taken to run in O(nd2)O(nd^{2}) time.. Hence, there has been substantial research on randomized techniques that seek nearly optimal low-rank approximation and PCA . These methods are quickly becoming standard tools in practice and implementations are widely available , including in popular learning libraries like scikit-learn .

Recent work focuses on algorithms whose runtimes do not depend on properties of A\mathbf{A}. In contrast, classical literature typically gives runtime bounds that depend on the gaps between A\mathbf{A}’s singular values and become useless when these gaps are small (which is often the case in practice – see Section 8). This limitation is due to a focus on how quickly approximate singular vectors converge to the actual singular vectors of A\mathbf{A}. When two singular vectors have nearly identical values they are difficult to distinguish, so convergence inherently depends on singular value gaps.

Only recently has a shift in approximation goal, along with an improved understanding of randomization, allowed for algorithms that avoid gap dependence and thus run provably fast for any matrix. For low-rank approximation and PCA, we only need to find a subspace that captures nearly as much variance as A\mathbf{A}’s top singular vectors – distinguishing between two close singular values is overkill.

The fastest randomized SVD algorithms run in O(nnz⁡(A))O(\operatorname{nnz}(\mathbf{A})) timeHere nnz⁡(A)\operatorname{nnz}(\mathbf{A}) is the number of non-zero entries in A\mathbf{A} and this runtime hides lower order terms., are based on non-iterative sketching methods, and return a rank kk matrix Z\mathbf{Z} with orthonormal columns z1,…,zk\mathbf{z}_{1},\ldots,\mathbf{z}_{k} satisfying

Unfortunately, as emphasized in prior work , Frobenius norm error is often hopelessly insufficient, especially for data analysis and learning applications. When A\mathbf{A} has a “heavy-tail” of singular values, which is common for noisy data, ∥A−Ak∥F2=∑i>kσi2\|\mathbf{A}-\mathbf{A}_{k}\|_{F}^{2}=\sum_{i>k}\sigma_{i}^{2} can be huge, potentially much larger than A\mathbf{A}’s top singular value. This renders (1) meaningless since Z\mathbf{Z} does not need to align with any large singular vectors to obtain good multiplicative error.

To address this shortcoming, a number of papers suggest targeting spectral norm low-rank approximation error,

which is intuitively stronger. When looking for a rank kk approximation, A\mathbf{A}’s top kk singular vectors are often considered data and the remaining tail is considered noise. A spectral norm guarantee roughly ensures that ZZTA\mathbf{Z}\mathbf{Z}^{T}\mathbf{A} recovers A\mathbf{A} up to this noise threshold.

Our Results

Even though the algorithm has been discussed and tested for potential improvement over Simultaneous Iteration , theoretical bounds for Krylov subspace and Lanczos methods are much more limited. As highlighted in ,

“Despite decades of research on Lanczos methods, the theory for [randomized power iteration] is more complete and provides strong guarantees of excellent accuracy, whether or not there exist any gaps between the singular values.”

Our work addresses this issue, giving the first gap independent bound for a Krylov subspace method.

2 Stronger Guarantees

In addition to runtime improvements, we target a much stronger notion of approximate SVD that is needed for many applications, but for which no gap-independent analysis was known.

Specifically, as noted in , while intuitively stronger than Frobenius norm error, (1+ϵ)(1+\epsilon) spectral norm low-rank approximation error does not guarantee any accuracy in Z\mathbf{Z} for many matricesIn fact, it does not even imply (1+ϵ)(1+\epsilon) Frobenius norm error.. Consider A\mathbf{A} with its top k+1k+1 squared singular values all equal to 1010 followed by a tail of smaller singular values (e.g. 1000k1000k at 11). ∥A−Ak∥22=10\|\mathbf{A}-\mathbf{A}_{k}\|^{2}_{2}=10 but in fact ∥A−ZZTA∥22=10\|\mathbf{A}-\mathbf{Z}\mathbf{Z}^{T}\mathbf{A}\|^{2}_{2}=10 for any rank kk Z\mathbf{Z}, leaving the spectral norm bound useless. At the same time, ∥A−Ak∥F2\|\mathbf{A}-\mathbf{A}_{k}\|_{F}^{2} is large, so Frobenius error is meaningless as well. For example, any Z\mathbf{Z} obtains ∥A−ZZTA∥F2≤(1.01)∥A−Ak∥F2\|\mathbf{A}-\mathbf{Z}\mathbf{Z}^{T}\mathbf{A}\|_{F}^{2}\leq(1.01)\|\mathbf{A}-\mathbf{A}_{k}\|_{F}^{2}.

With this scenario in mind, it is unsurprising that low-rank approximation guarantees fail as an accuracy measure in practice. We ran a standard sketch-and-solve approximate SVD algorithm (see Section 3.1) on SNAP/amazon0302, an Amazon product co-purchasing dataset , and achieved very good low-rank approximation error in both norms for k=30k=30:

However, the approximate principal components given by Z\mathbf{Z} are of significantly lower quality than A\mathbf{A}’s true singular vectors (see Figure 1). We saw a similar phenomenon for the popular 20 Newsgroups dataset and several others. Additionally, the potential failure of low rank approximation measures was recently raised in .

We address this issue by introducing a per vector guarantee that requires each approximate singular vector z1,…,zk\mathbf{z}_{1},\ldots,\mathbf{z}_{k} to capture nearly as much variance as the corresponding true singular vector:

The error bound (3) is very strong in that it depends on ϵσk+12\epsilon\sigma^{2}_{k+1}, meaning that it is better then relative error, i.e. ∣uiTAATui−ziTAATzi∣≤ϵσi2\left|\mathbf{u}_{i}^{T}\mathbf{A}\mathbf{A}^{T}\mathbf{u}_{i}-\mathbf{z}_{i}^{T}\mathbf{A}\mathbf{A}^{T}\mathbf{z}_{i}\right|\leq\epsilon\sigma_{i}^{2}, for A\mathbf{A}’s large singular vectors. While it is reminiscent of the bounds sought in classical numerical analysis , we stress that it does not require each zi\mathbf{z}_{i} to converge to ui\mathbf{u}_{i} in the presence of small singular value gaps. In fact, we show that both randomized Block Krylov Iteration and our slightly modified Simultaneous Iteration algorithmFor guarantee (3) it is important that Algorithm 1 includes post-processing steps 4 and 5 rather than just returning a basis for K\mathbf{K}, which is sufficient for the low-rank approximation guarantees. achieve (3) in gap-independent runtimes.

3 Main Result

Our contributions are summarized in Theorem 1, whose proof appears in parts as Theorems 6 and 7 in Section 5 (runtime) and Theorems 10, 11, and 12 in Section 6 (accuracy).

With high probability, Algorithms 1 and 2 find approximate singular vectors Z=[z1,…,zk]\mathbf{Z}=\left[\mathbf{z}_{1},\ldots,\mathbf{z}_{k}\right] satisfying guarantees (1) and (2) for low-rank approximation and (3) for PCA. For error ϵ\epsilon, Algorithm 1 requires q=O(log⁡d/ϵ)q=O(\log d/\epsilon) iterations while Algorithm 2 requires q=O(log⁡d/ϵ)q=O(\log d/\sqrt{\epsilon}) iterations. Excluding lower order terms, both algorithms run in time O(nnz⁡(A)kq)O(\operatorname{nnz}(\mathbf{A})kq).

We note that, while Simultaneous Iteration was known to achieve (2) , surprisingly we are first to prove that it gives (1), a qualitatively weaker goal.

In Section 7 we use our results to give an alternative analysis of both algorithms that does depend on singular value gaps and can offer significantly faster convergence when A\mathbf{A} has decaying singular values. It is possible to take further advantage of this result by running Algorithms 1 and 2 with a Π\mathbf{\Pi} that has >k>k columns, a simple modification for accelerating either method.

Finally, Section 8 contains a number of experiments on large data problems. We justify the importance of gap independent bounds for predicting algorithm convergence and we show that Block Krylov Iteration in fact significantly outperforms the more popular Simultaneous Iteration.

4 Comparison to Classical Bounds

Decades of work has produced a variety of gap dependent bounds for power iteration and Krylov subspace methods. We refer the reader to Saad’s standard reference . Most relevant to our work are bounds for block Krylov methods with block size equal to kk . Roughly speaking, with randomized initialization, these results offer guarantees equivalent to our strong equation (3) for the top kk singular directions after:

This bound is recovered by our Section 7 results and, when the target accuracy ϵ\epsilon is smaller than the relative singular value gap (σk/σk+1−1)(\sigma_{k}/\sigma_{k+1}-1), it is tighter than our gap independent results. However, as discussed in Section 8, for high dimensional data problems where ϵ\epsilon is set far above machine precision, gap independent bounds more accurately predict required iteration count.

Less comparable to our results are attempts to analyze algorithms with block size smaller than kk . While “small block” or single vector algorithms offer runtime advantages, it is well understood that with bb duplicate singular values, it is impossible to recover the top kk singular directions with a block of size <b<b . More generally, large singular value clusters slow convergence, so any small block algorithm must have runtime dependence on the gaps between each adjacent pair of top kk singular values . We believe that obtaining simpler theoretical bounds for small block methods is an interesting direction for future work.

Background and Intuition

We will start by 1) providing background on algorithms for approximate singular value decomposition and 2) giving intuition for Simultaneous Power Iteration and Block Krylov methods and justifying why they can give strong gap-independent error guarantees.

Progress on algorithms for Frobenius norm error low-rank approximation (1) has been considerable. Work in this direction dates back to the strong rank-revealing QR factorizations of Gu and Eisenstat . They give deterministic algorithms that run in approximately O(ndk)O(ndk) time, vs. O(nd2)O(nd^{2}) for a full SVD, but only guarantee polynomial factor Frobenius norm error.

The sketch-and-solve method is very efficient – the computation of AΠ\mathbf{A\Pi} is easily parallelized and, regardless, pass-efficient in a single processor setting. Furthermore, once a small compression of A\mathbf{A} is obtained, it can be manipulated in fast memory to find Z\mathbf{Z}. This is not typically true of A\mathbf{A} itself, making it difficult to directly process the original matrix at all.

2 Spectral Norm Error via Simultaneous Iteration

Unfortunately, as discussed, Frobenius norm error is often insufficient when A\mathbf{A} has a heavy singular value tail. Moreover, it seems an inherent limitation of sketch-and-solve methods. The noise from A\mathbf{A}’s lower r−kr-k singular values corrupts AΠ\mathbf{A\Pi}, making it impossible to extract a good partial SVD if the sum of these singular values (equal to ∥A−Ak∥F2\|\mathbf{A}-\mathbf{A}_{k}\|_{F}^{2}) is too large. In other words, any error inherently depends on the size of this tail.

In order to achieve spectral norm error (2), Simultaneous Iteration must reduce this noise down to the scale of σk+1=∥A−Ak∥2\sigma_{k+1}=\|\mathbf{A}-\mathbf{A}_{k}\|_{2}. It does this by working with the powered matrix Aq\mathbf{A}^{q} .For nonsymmetric matrices we work with (AAT)qA\mathbf{A}\mathbf{A}^{T})^{q}\mathbf{A}, but present the symmetric case here for simplicity. By the spectral theorem, Aq\mathbf{A}^{q} has exactly the same singular vectors as A\mathbf{A}, but its singular values are equal to the singular values of A\mathbf{A} raised to the qthq^{\text{th}} power. Powering spreads the values apart and accordingly, Aq\mathbf{A}^{q}’s lower singular values are relatively much smaller than its top singular values (see Figure 2(a) for an example).

Computing Aq\mathbf{A}^{q} directly is costly, so AqΠ\mathbf{A}^{q}\mathbf{\Pi} is computed iteratively. We start with a random Π\mathbf{\Pi} and repeatedly multiply by A\mathbf{A} on the left. Since even a rough Frobenius norm approximation for Aq\mathbf{A}^{q} suffices, Π\mathbf{\Pi} is often chosen to have just kk columns. Each iteration thus takes O(nnz⁡(A)k)O(\operatorname{nnz}(\mathbf{A})k) time. After AqΠ\mathbf{A}^{q}\mathbf{\Pi} is computed, Z\mathbf{Z} can simply be set to a basis for its column span.

To the best of our knowledge, this approach to analyzing Simultaneous Iteration without dependence on singular value gaps began with . The technique was popularized in and its analysis improved in and . gives the first bound that directly achieves (2) with O(log⁡d/ϵ)O(\log d/\epsilon) power iterations. All of these papers rely on an improved understanding of the benefits of starting with a randomized Π\mathbf{\Pi}, which has developed from work on the sketch-and-solve paradigm.

3 Beating Simultaneous Iteration with Krylov Methods

As mentioned, numerous papers hint at the possibility of beating Simultaneous Iteration with block Krylov methods . In particular, , and suggest and experimentally confirm the potential of a randomized variant of the Block Lanczos algorithm, which we refer to as Block Krylov Iteration (Algorithm 2). However, none of these papers give theoretical bounds on the algorithm’s performance.

The intuition behind Block Krylov Iteration matches that of many accelerated iterative methods. Simply put, there are better polynomials than Aq\mathbf{A}^{q} for denoising tail singular values. In particular, we can use a lower degree polynomial, allowing us to compute fewer powers of A\mathbf{A} and thus leading to an algorithm with fewer iterations. For example, an appropriately shifted q=O(log⁡dϵ)q=O(\frac{\log d}{\sqrt{\epsilon}}) degree Chebyshev polynomial can push the tail of A\mathbf{A} nearly as close to zero as AO(log⁡d/ϵ)\mathbf{A}^{O(\log d/\epsilon)}, even if the long run growth of the polynomial is much lower (see Figure 2(b)).

Block Krylov Iteration takes advantage of such polynomials by working with the Krylov subspace,

from which we can construct pq(A)Πp_{q}(\mathbf{A})\mathbf{\Pi} for any polynomial pq(⋅)p_{q}(\cdot) of degree qq.Algorithm 2 in fact only constructs odd powered terms in K\mathbf{K}, which is sufficient for our choice of pq(x)p_{q}(x). Since an effective polynomial for denoising A\mathbf{A} must be scaled and shifted based on the value of σk+1\sigma_{k+1}, we cannot easily compute it directly. Instead, we argue that the very best kk rank approximation to A\mathbf{A} lying in the span of K\mathbf{K} at least matches the approximation achieved by projecting onto the span of pq(A)Πp_{q}(\mathbf{A})\mathbf{\Pi}. Finding this best approximation will therefore give a nearly optimal low-rank approximation to A\mathbf{A}.

Unfortunately, there’s a catch. Perhaps surprisingly, it is not clear how to efficiently compute the best spectral norm error low-rank approximation to A\mathbf{A} lying in a specific subspace (e.g. K\mathbf{K}’s span) . This challenge precludes an analysis of Krylov methods parallel to the recent work on Simultaneous Iteration. Nevertheless, we show that computing the best Frobenius error low-rank approximation in the span of K\mathbf{K}, exactly the post-processing step taken by classic Block Lanczos and our method, will give a good enough spectral norm approximation for achieving (1+ϵ)(1+\epsilon) error.

4 Stronger Per Vector Error Guarantees

Achieving the per vector guarantee of (3) requires a more nuanced understanding of how Simultaneous Iteration and Block Krylov Iteration denoise the spectrum of A\mathbf{A}. The analysis for spectral norm low-rank approximation relies on the fact that Aq\mathbf{A}^{q} (or pq(A)p_{q}(\mathbf{A}) for Block Krylov Iteration) blows up any singular value ≥(1+ϵ)σk+1\geq(1+\epsilon)\sigma_{k+1} to much larger than any singular value ≤σk+1\leq\sigma_{k+1}. This ensures that the Z\mathbf{Z} outputted by both algorithms aligns very well with the singular vectors corresponding to these large singular values.

If σk≥(1+ϵ)σk+1\sigma_{k}\geq(1+\epsilon)\sigma_{k+1}, then Z\mathbf{Z} aligns well with all top kk singular vectors of A\mathbf{A} and we get good Frobenius norm error and the per vector guarantee (3). Unfortunately, when there is a small gap between σk\sigma_{k} and σk+1\sigma_{k+1}, Z\mathbf{Z} could miss intermediate singular vectors whose values lie between σk+1\sigma_{k+1} and (1+ϵ)σk+1(1+\epsilon)\sigma_{k+1}. This is the case where gap dependent guarantees of classical analysis break down.

However, Aq\mathbf{A}^{q} or, for Block Krylov Iteration, some qq-degree polynomial in our Krylov subspace, also significantly separates singular values >σk+1>\sigma_{k+1} from those <(1−ϵ)σk+1<(1-\epsilon)\sigma_{k+1}. Thus, each column of Z\mathbf{Z} at least aligns with A\mathbf{A} nearly as well as uk+1\mathbf{u}_{k+1}. So, even if we miss singular values between σk+1\sigma_{k+1} and (1+ϵ)σk+1(1+\epsilon)\sigma_{k+1}, they will be replaced with approximate singular values >(1−ϵ)σk+1>(1-\epsilon)\sigma_{k+1}, enough for (3).

For Frobenius norm low-rank approximation, we prove that the degree to which Z\mathbf{Z} falls outside of the span of A\mathbf{A}’s top kk singular vectors depends on the number of singular values between σk+1\sigma_{k+1} and (1−ϵ)σk+1(1-\epsilon)\sigma_{k+1}. These are the values that could be ‘swapped in’ for the true top kk singular values. Since their weight counts towards A\mathbf{A}’s tail, our total loss compared to optimal is at worst ϵ∥A−Ak∥F2\epsilon\|\mathbf{A}-\mathbf{A}_{k}\|^{2}_{F}.

Preliminaries

Before proceeding to the full technical analysis, we overview required results from linear algebra, polynomial approximation, and randomized low-rank approximation.

Let Σk\mathbf{\Sigma}_{k} be Σ\mathbf{\Sigma} with all but its largest kk singular values zeroed out. Let Uk\mathbf{U}_{k} and Vk\mathbf{V}_{k} be U\mathbf{U} and V\mathbf{V} with all but their first kk columns zeroed out. For any kk, Ak=UΣkVT=UkΣkVkT\mathbf{A}_{k}=\mathbf{U}\mathbf{\Sigma}_{k}\mathbf{V^{T}}=\mathbf{U}_{k}\mathbf{\Sigma}_{k}\mathbf{V}_{k}^{T} is the closest rank kk approximation to A\mathbf{A} for any unitarily invariant norm, including the Frobenius norm and spectral norm . The squared Frobenius norm is given by ∥A∥F2=∑i,jAi,j2=tr⁡(AAT)=∑iσi2\|\mathbf{A}\|^{2}_{F}=\sum_{i,j}\mathbf{A}_{i,j}^{2}=\operatorname{tr}(\mathbf{AA^{T}})=\sum_{i}\sigma_{i}^{2}. The spectral norm is given by ∥A∥2=σ1\|\mathbf{A}\|_{2}=\sigma_{1}.

We often work with the remainder matrix A−Ak\mathbf{A}-\mathbf{A}_{k} and label it Ar∖k\mathbf{A}_{r\setminus k}. Its singular value decomposition is given by Ar∖k=Ur∖kΣr∖kVr∖kT\mathbf{A}_{r\setminus k}=\mathbf{U}_{r\setminus k}\mathbf{\Sigma}_{r\setminus k}\mathbf{V}_{r\setminus k}^{T} where Ur∖k\mathbf{U}_{r\setminus k}, Σr∖k\mathbf{\Sigma}_{r\setminus k}, and Vr∖kT\mathbf{V}_{r\setminus k}^{T} have their first kk columns zeroed.

While the SVD gives a globally optimal rank kk approximation for A\mathbf{A}, both Simultaneous Iteration and Block Krylov Iteration return the best kk rank approximation falling within some fixed subspace spanned by a basis Q\mathbf{Q} (with rank ≥k\geq k). For the Frobenius norm, this simply requires projecting A\mathbf{A} to Q\mathbf{Q} and taking the best rank kk approximation of the resulting matrix using an SVD.

This low-rank approximation can be obtained using an SVD (equivalently, eigendecomposition) of the m×mm\times m matrix M=QT(AAT)Q\mathbf{M}=\mathbf{Q}^{T}(\mathbf{AA}^{T})\mathbf{Q}. Specifically, letting M=UˉΣˉ2UˉT\mathbf{M}=\mathbf{\bar{U}}\mathbf{\bar{\Sigma}}^{2}\mathbf{\bar{U}}^{T}, then:

If the SVD of QTA\mathbf{Q}^{T}\mathbf{A} is given by QTA=UˉΣˉVˉT\mathbf{Q}^{T}\mathbf{A}=\mathbf{\bar{U}}\mathbf{\bar{\Sigma}}\mathbf{\bar{V}}^{T} then M=QT(AAT)Q=UˉΣˉ2UˉT\mathbf{M}=\mathbf{Q}^{T}(\mathbf{AA}^{T})\mathbf{Q}=\mathbf{\bar{U}}\mathbf{\bar{\Sigma}}^{2}\mathbf{\bar{U}}^{T}. So Q(QTA)k=QUˉkΣˉkVˉkT=Q(UˉkUˉkT)UˉΣˉVˉT=QUˉkUˉkTQTA\mathbf{Q}\left(\mathbf{Q}^{T}\mathbf{A}\right)_{k}=\mathbf{Q}\mathbf{\bar{U}}_{k}\mathbf{\bar{\Sigma}}_{k}\mathbf{\bar{V}}_{k}^{T}=\mathbf{Q}\left(\mathbf{\bar{U}}_{k}\mathbf{\bar{U}}_{k}^{T}\right)\mathbf{\bar{U}}\mathbf{\bar{\Sigma}}\mathbf{\bar{V}}^{T}=\mathbf{Q}\mathbf{\bar{U}}_{k}\mathbf{\bar{U}}_{k}^{T}\mathbf{Q}^{T}\mathbf{A}, giving the lower matrix equality. Note that QUˉk\mathbf{Q}\mathbf{\bar{U}}_{k} has orthonormal columns since UˉkTQTQUˉk=UˉkTIUˉk=Ik\mathbf{\bar{U}}_{k}^{T}\mathbf{Q}^{T}\mathbf{Q}\mathbf{\bar{U}}_{k}=\mathbf{\bar{U}}_{k}^{T}\mathbf{I}\mathbf{\bar{U}}_{k}=\mathbf{I}_{k}.

In general, this rank kk approximation does not give the best spectral norm approximation to A\mathbf{A} falling within Q\mathbf{Q} . A closed form solution can be obtained using the results of , which are related to Parrott’s theorem, but we do not know how to compute this solution without essentially performing an SVD of A\mathbf{A}. It is at least simple to show that the optimal spectral norm approximation for A\mathbf{A} spanned by a rank kk basis is obtained by projecting A\mathbf{A} to the basis:

2 Other Linear Algebra Tools

Throughout this paper we use span(M)span(\mathbf{M}) to denote the column span of the matrix M\mathbf{M}. We say that a matrix Q\mathbf{Q} is an orthonormal basis for the column span of M\mathbf{M} if Q\mathbf{Q} has orthonormal columns and QQTM=M\mathbf{Q}\mathbf{Q}^{T}\mathbf{M}=\mathbf{M}. That is, projecting the columns of M\mathbf{M} to Q\mathbf{Q} fully recovers those columns. QQT\mathbf{QQ}^{T} is the orthogonal projection matrix onto the span of Q\mathbf{Q}. (QQT)(QQT)=QIQT=QQT(\mathbf{QQ}^{T})(\mathbf{QQ}^{T})=\mathbf{QIQ}^{T}=\mathbf{QQ}^{T}.

If M\mathbf{M} and N\mathbf{N} have the same dimension and MNT=0\mathbf{MN^{T}}=\mathbf{0} then ∥M+N∥F2=∥M∥F2+∥N∥F2\|\mathbf{M}+\mathbf{N}\|^{2}_{F}=\|\mathbf{M}\|^{2}_{F}+\|\mathbf{N}\|^{2}_{F}. This matrix Pythagorean theorem follows from writing ∥M+N∥F2=tr⁡((M+N)(M+N)T)\|\mathbf{M+N}\|^{2}_{F}=\operatorname{tr}(\mathbf{(M+N)(M+N)^{T}}). As an example, for any orthogonal projection QQTA\mathbf{QQ}^{T}\mathbf{A}, AT(I−QQT)QQTA=0\mathbf{A}^{T}(\mathbf{I}-\mathbf{QQ}^{T})\mathbf{QQ}^{T}\mathbf{A}=\mathbf{0}, so ∥A−QQTA∥F2=∥A∥F2−∥QQTA∥F2.\|\mathbf{A}-\mathbf{QQ}^{T}\mathbf{A}\|_{F}^{2}=\|\mathbf{A}\|_{F}^{2}-\|\mathbf{QQ}^{T}\mathbf{A}\|_{F}^{2}. This implies that, since Ak=UkUkTA\mathbf{A}_{k}=\mathbf{U}_{k}\mathbf{U}_{k}^{T}\mathbf{A} minimizes ∥A−Ak∥F2\|\mathbf{A}-\mathbf{A}_{k}\|_{F}^{2} over all rank kk matrices, QQT=UkUk\mathbf{QQ}^{T}=\mathbf{U}_{k}\mathbf{U}_{k} maximizes ∥QQTA∥F2\|\mathbf{QQ}^{T}\mathbf{A}\|_{F}^{2} over all rank kk orthogonal projections.

3 Randomized Low-Rank Approximation

Our proofs build on well known sketch-based algorithms for low-rank approximation with Frobenius norm error. A short proof of the following Lemma is in Appendix A:

For analyzing block methods, results like Lemma 4 can effectively serve as a replacement for earlier random initialization analysis that applies to single vector power and Krylov methods .

4 Chebyshev Polynomials

As outlined in Section 3.3, our proof also requires polynomials to more effectively denoise the tail of A\mathbf{A}. As is standard for Krylov subspace methods, we use a variation on the Chebyshev polynomials. The proof of the following Lemma is relegated to Appendix A.

Given a specified value α>0\alpha>0, gap γ∈(0,1]\gamma\in(0,1], and q≥1q\geq 1, there exists a degree qq polynomial p(x)p(x) such that:

p((1+γ)α)=(1+γ)αp(\left(1+\gamma)\alpha\right)=(1+\gamma)\alpha

p(x)≥xp(x)\geq x for all x≥(1+γ)αx\geq(1+\gamma)\alpha

∣p(x)∣≤α2qγ−1|p(x)|\leq\frac{\alpha}{2^{q\sqrt{\gamma}-1}} for all x∈[0,α]x\in[0,\alpha]

Furthermore, when qq is odd, the polynomial only contains odd powered monomials.

Implementation and Runtimes

We first briefly discuss runtime and implementation considerations for Algorithms 1 and 2, our randomized implementations of Simultaneous Power Iteration and Block Krylov Iteration.

Algorithm 1 can be modified in a number of ways. Π\mathbf{\Pi} can be replaced by a random sign matrix, or any matrix achieving the guarantee of Lemma 4. Π\mathbf{\Pi} may also be chosen with p>kp>k columns. We will discuss in detail how this approach can give improved accuracy in Section 7.

In our implementation we set Z=QUˉk\mathbf{Z}=\mathbf{Q\mathbf{\bar{U}}_{k}}. This ensures that, for all l≤kl\leq k, Zl\mathbf{Z}_{l} gives the best rank ll Frobenius norm approximation to A\mathbf{A} within the span of K\mathbf{K} (See Lemma 2). This is necessary for achieving per vector guarantees for approximate PCA. However, if we are only interested in computing a near optimal low-rank approximation, we can simply set Z=Q\mathbf{Z}=\mathbf{Q}. Projecting A\mathbf{A} to QUˉk\mathbf{Q\mathbf{\bar{U}}_{k}} is equivalent to projecting to Q\mathbf{Q} as these two matrices have the same column spans.

Additionally, since powering A\mathbf{A} spreads its singular values, K=(AAT)qAΠ\mathbf{K}=(\mathbf{AA}^{T})^{q}\mathbf{A\Pi} could be poorly conditioned. As suggested in , to improve stability we can orthonormalize K\mathbf{K} after every iteration (or every few iterations). This does not change K\mathbf{K}’s column span, so it gives an equivalent algorithm in exact arithmetic, but improves conditioning significantly.

Computing K\mathbf{K} requires first multiplying A\mathbf{A} by Π\mathbf{\Pi}, which takes O(nnz⁡(A)k)O(\operatorname{nnz}(\mathbf{A})k) time. Computing (AAT)iAΠ\left(\mathbf{A}\mathbf{A}^{T}\right)^{i}\mathbf{A\Pi} given (AAT)i−1AΠ\left(\mathbf{A}\mathbf{A}^{T}\right)^{i-1}\mathbf{A\Pi} then takes O(nnz⁡(A)k)O(\operatorname{nnz}(\mathbf{A})k) time to first multiply our (n×k)(n\times k) matrix by AT\mathbf{A}^{T} and then by A\mathbf{A}. Reorthogonalizing after each iteration takes O(nk2)O(nk^{2}) time via Gram-Schmidt or Householder reflections. This gives a total runtime of O(nnz⁡(A)kq+nk2q)O(\operatorname{nnz}(\mathbf{A})kq+nk^{2}q) for computing K\mathbf{K}.

Finding Q\mathbf{Q} takes O(nk2)O(nk^{2}) time. Computing M\mathbf{M} by multiplying from left to right requires O(nnz(A)k+nk2)O(nnz(\mathbf{A})k+nk^{2}) time. M\mathbf{M}’s SVD then requires O(k3)O(k^{3}) time using classical techniques. Finally, multiplying Uˉk\mathbf{\bar{U}}_{k} by Q\mathbf{Q} takes time O(nk2)O(nk^{2}). Setting q=Θ(log⁡d/ϵ)q=\Theta(\log d/\epsilon) gives the claimed runtime. ∎

2 Block Krylov Iteration

As with Simultaneous Iteration, we can replace Π\mathbf{\Pi} with any matrix achieving the guarantee of Lemma 4 and can use p>kp>k columns to improve accuracy. Q\mathbf{Q} can also be computed in a number of ways. In the traditional Block Lanczos algorithm, one starts by computing an orthonormal basis for AΠ\mathbf{A\Pi}, the first block in the Krylov subspace. Bases for subsequent blocks are computed from previous blocks using a three term recurrence that ensures QTAATQ\mathbf{Q}^{T}\mathbf{AA}^{T}\mathbf{Q} is block tridiagonal, with k×kk\times k sized blocks . This technique can be useful if qkqk is large, since it is faster to compute the top singular vectors of a block tridiagonal matrix. However, computing Q\mathbf{Q} using a recurrence can introduce a number of stability issues, and additional steps may be required to ensure that the matrix remains orthogonal .

An alternative is to compute K\mathbf{K} explicitly and then compute Q\mathbf{Q} using a QR decomposition. This method is used in and . It does not guarantee that QTAATQ\mathbf{Q}^{T}\mathbf{AA}^{T}\mathbf{Q} is block tridiagonal, but helps avoid a number of stability issues. Furthermore, if qkqk is small, taking the SVD of QTAATQ\mathbf{Q}^{T}\mathbf{AA}^{T}\mathbf{Q} will still be fast and typically dominated by the cost of computing K\mathbf{K}.

As with Simultaneous Iteration, we can also orthonormalize each block of K\mathbf{K} after it is computed, avoiding poorly conditioned blocks and giving an equivalent algorithm in exact arithmetic.

Computing K\mathbf{K}, including block reorthogonalization, requires O(nnz⁡(A)kq+nk2q)O(\operatorname{nnz}(\mathbf{A})kq+nk^{2}q) time. The remaining steps are analogous to those in Simultaneous Iteration except somewhat more costly as we work an k⋅qk\cdot q dimensional rather than kk dimensional subspace. Finding Q\mathbf{Q} takes O(n(kq)2)O(n(kq)^{2}) time. Computing M\mathbf{M} take O(nnz(A)(kq)+n(kq)2)O(nnz(\mathbf{A})(kq)+n(kq)^{2}) time and its SVD then requires O((kq)3)O((kq)^{3}) time. Finally, multiplying Uˉk\mathbf{\bar{U}}_{k} by Q\mathbf{Q} takes time O(nk(kq))O(nk(kq)). Setting q=Θ(log⁡d/ϵ)q=\Theta(\log d/\sqrt{\epsilon}) gives the claimed runtime. ∎

Error Bounds

We next prove that both Algorithms 1 and 2 return a basis Z\mathbf{Z} that gives relative error Frobenius (1) and spectral norm (2) low-rank approximation error as well as the per vector guarantees (3).

We start with a general approximation lemma, which gives three guarantees formalizing the intuition given in Section 3. All other proofs follow nearly immediately from this lemma.

For simplicity we assume that k≤r=rank⁡(A)≤n,dk\leq r=\operatorname{rank}(\mathbf{A})\leq n,d. However, if k>rk>r it can be seen that both algorithms still return a basis satisfying the proven guarantees. We start with a definition:

Recall that Al\mathbf{A}_{l} is the best rank ll approximation to A\mathbf{A}. This error function measures how well ZlZlTA\mathbf{Z}_{l}\mathbf{Z}_{l}^{T}\mathbf{A} approximates A\mathbf{A} in comparison to the optimal.

Let mm be the number of singular values σi\sigma_{i} of A\mathbf{A} with σi≥(1+ϵ/2)σk+1\sigma_{i}\geq(1+\epsilon/2)\sigma_{k+1}. Let ww be the number of singular values with 11+ϵ/2σk≤σi<σk\frac{1}{1+\epsilon/2}\sigma_{k}\leq\sigma_{i}<\sigma_{k}. With probability 99/10099/100 Algorithms 1 and 2 return Z\mathbf{Z} satisfying:

∀l≤m\forall l\leq m, E(Zl,A)≤(ϵ/2)⋅σk+12,\mathcal{E}(\mathbf{Z}_{l},\mathbf{A})\leq(\epsilon/2)\cdot\sigma_{k+1}^{2},

∀l≤k\forall l\leq k, E(Zl,A)≤E(Zl−1,A)+3ϵ⋅σk+12,\mathcal{E}(\mathbf{Z}_{l},\mathbf{A})\leq\mathcal{E}(\mathbf{Z}_{l-1},\mathbf{A})+3\epsilon\cdot\sigma_{k+1}^{2},

∀l≤k\forall l\leq k, E(Zl,A)≤(w+1)⋅3ϵ⋅σk+12.\mathcal{E}(\mathbf{Z}_{l},\mathbf{A})\leq(w+1)\cdot 3\epsilon\cdot\sigma_{k+1}^{2}.

Property 1 captures the intuition given in Section 3.2. Both algorithms return Z\mathbf{Z} with Zl\mathbf{Z}_{l} equal to the best Frobenius norm low-rank approximation in span(K)span(\mathbf{K}). Since σ1≥…≥σm≥(1+ϵ/2)σk+1\sigma_{1}\geq\ldots\geq\sigma_{m}\geq(1+\epsilon/2)\sigma_{k+1} and our polynomials separate any values above this threshold from anything below σk+1\sigma_{k+1}, Z\mathbf{Z} must align very well with A\mathbf{A}’s top mm singular vectors. Thus E(Zl,A)\mathcal{E}(\mathbf{Z}_{l},\mathbf{A}) is very small for all l≤ml\leq m.

Property 2 captures the intuition of Section 3.4 – outside of the largest mm singular values, Z\mathbf{Z} still performs well. We may fail to distinguish between vectors with values between 11+ϵ/2σk\frac{1}{1+\epsilon/2}\sigma_{k} and (1+ϵ/2)σk+1(1+\epsilon/2)\sigma_{k+1}. However, aligning with the smaller vectors in this range rather than the larger vectors can incur a cost of at most O(ϵ)σk+12O(\epsilon)\sigma_{k+1}^{2}. Since every column of Z\mathbf{Z} outside of the first mm may incur such a cost, there is a linear accumulation as characterized by Property 2.

Finally, Property 3 captures the intuition that the total error in Z\mathbf{Z} is bounded by the number of singular values falling in the range 11+ϵ/2σk≤σi<σk\frac{1}{1+\epsilon/2}\sigma_{k}\leq\sigma_{i}<\sigma_{k}. This is the total number of singular vectors that aren’t necessarily separated from and can thus be ‘swapped in’ for any of the (k−m)(k-m) true top vectors with singular value <(1+ϵ/2)σk+1<(1+\epsilon/2)\sigma_{k+1}. Property 3 is critical in achieving near optimal Frobenius norm low-rank approximation.

Assume m≥1m\geq 1. If m=0m=0 then Property 1 trivially holds. We will prove the statement for Algorithm 2, since this is the more complex case, and then explain how the proof extends to Algorithm 1.

By Lemma 4 we have with probability 99/10099/100:

Furthermore, one possible rank kk approximation of p1(A)p_{1}(\mathbf{A}) is p1(Ak)p_{1}(\mathbf{A}_{k}). By the optimality of p1(A)kp_{1}(\mathbf{A})_{k},

The last inequalities follow from setting q=Θ(log⁡(d/ϵ)/ϵ)q=\Theta(\log(d/\epsilon)/\sqrt{\epsilon}) and from the fact that σi≤σk+1=α\sigma_{i}\leq\sigma_{k+1}=\alpha for all i≥k+1i\geq k+1 and thus by property 3 of Lemma 5, ∣p1(σi)∣≤σk+12qϵ/2−1|p_{1}(\sigma_{i})|\leq\frac{\sigma_{k+1}}{2^{q\sqrt{\epsilon/2}-1}}. Noting that k≤dk\leq d, we can plug this bound into (4) to get

Applying the Pythagorean theorem and the invariance of the Frobenius norm under rotation gives

Letting ci\mathbf{c}_{i} be the ithi^{\text{th}} row of C\mathbf{C}, expanding out these norms gives

Since C\mathbf{C}’s columns are orthonormal, its rows all have norms upper bounded by 11. So ∥ci∥22p1(σi)2≤p1(σi)2\|\mathbf{c}_{i}\|_{2}^{2}p_{1}(\sigma_{i})^{2}\leq p_{1}(\sigma_{i})^{2} for all ii. So for all l≤rl\leq r, (6) gives us

Recall that mm is the number of singular values with σi≥(1+ϵ/2)σk+1\sigma_{i}\geq(1+\epsilon/2)\sigma_{k+1}. By Property 2 of Lemma 5, for all i≤mi\leq m we have σi≤p1(σi)\sigma_{i}\leq p_{1}(\sigma_{i}). This gives, for all l≤ml\leq m:

Converting these sums back to norms yields ∥Σl∥F2−ϵσk+122≤∥CTΣl∥F2\|\mathbf{\Sigma}_{l}\|_{F}^{2}-\frac{\epsilon\sigma_{k+1}^{2}}{2}\leq\|\mathbf{C}^{T}\mathbf{\Sigma}_{l}\|_{F}^{2} and therefore ∥Al∥F2−ϵσk+122≤∥Y1Y1TAl∥F2\|\mathbf{A}_{l}\|_{F}^{2}-\frac{\epsilon\sigma_{k+1}^{2}}{2}\leq\|\mathbf{Y}_{1}\mathbf{Y}_{1}^{T}\mathbf{A}_{l}\|_{F}^{2} and

Now Y1Y1TAl\mathbf{Y}_{1}\mathbf{Y}_{1}^{T}\mathbf{A}_{l} is a rank ll approximation to A\mathbf{A} falling within the column span of Y\mathbf{Y} and hence within the column span of Q\mathbf{Q}. By Lemma 2, the best rank ll Frobenius approximation to A\mathbf{A} within Q\mathbf{Q} is given by QUˉl(QUˉl)TA\mathbf{Q}\mathbf{\bar{U}}_{l}(\mathbf{Q}\mathbf{\bar{U}}_{l})^{T}\mathbf{A}. So we have

For Algorithm 1, we instead choose p1(x)=(1+ϵ/2)σk+1⋅(x(1+ϵ/2)σk+1)2q+1p_{1}(x)=(1+\epsilon/2)\sigma_{k+1}\cdot\left(\frac{x}{(1+\epsilon/2)\sigma_{k+1}}\right)^{2q+1}. For q=Θ(log⁡d/ϵ)q=\Theta(\log d/\epsilon), this polynomial satisfies the necessary properties: for all i≥k+1i\geq k+1, p1(σi)≤O(ϵ2d2σk+12)p_{1}(\sigma_{i})\leq O\left(\frac{\epsilon}{2d^{2}}\sigma_{k+1}^{2}\right) and for all i≤mi\leq m, σi≤p1(σi)\sigma_{i}\leq p_{1}(\sigma_{i}). Further, up to a rescaling, p1(A)Π=Kp_{1}(\mathbf{A})\mathbf{\Pi}=\mathbf{K} so Y1\mathbf{Y}_{1} spans the same space as K\mathbf{K}. Therefore since Algorithm 1 returns Z\mathbf{Z} with Zl\mathbf{Z}_{l} equal to the best rank ll Frobenius norm approximation to A\mathbf{A} within the span of K\mathbf{K}, for all ll we have:

Proof of Property 2

Property 1 and the fact that E(Zl,A)\mathcal{E}(\mathbf{Z}_{l},\mathbf{A}) is always positive immediately gives Property 2 for l≤ml\leq m. So we need to show that it holds for m<l≤km<l\leq k. Note that if ww, the number of singular values with 11+ϵ/2σk≤σi<σk\frac{1}{1+\epsilon/2}\sigma_{k}\leq\sigma_{i}<\sigma_{k} is equal to , then σk+1<11+ϵ/2σk\sigma_{k+1}<\frac{1}{1+\epsilon/2}\sigma_{k}, so m=km=k and we are done. So we assume w≥1w\geq 1 henceforth. Again, we first prove the statement for Algorithm 2 and then explain how the proof extends to the simpler case of Algorithm 1.

Intuitively, Property 1 follows from the guarantee that there is a rank mm subspace of span(K)span(\mathbf{K}) that aligns with A\mathbf{A} nearly as well as the space spanned by A\mathbf{A}’s top mm singular vectors. To prove Property 2 we must show that there is also some rank kk subspace in span(K)span(\mathbf{K}) whose components all align nearly as well with A\mathbf{A} as uk\mathbf{u}_{k}, the kthk^{\text{th}} singular vector of A\mathbf{A}. The existence of such a subspace ensures that Z\mathbf{Z} performs well, even on singular vectors in the intermediate range [σk,(1+ϵ/2)σk+1][\sigma_{k},(1+\epsilon/2)\sigma_{k+1}].

Let Ainner\mathbf{A}_{inner} = Ar∖k−Ar∖(k+w)\mathbf{A}_{r\setminus k}-\mathbf{A}_{r\setminus(k+w)}. Ainner=UΣinnerVT\mathbf{A}_{inner}=\mathbf{U}\mathbf{\Sigma}_{inner}\mathbf{V}^{T} where Σinner\mathbf{\Sigma}_{inner} contains only the singular values σk+1,…,σk+w\sigma_{k+1},\ldots,\sigma_{k+w}. These are the ww intermediate singular values of A\mathbf{A} falling in the range [11+ϵ/2σk,σk)\left[\frac{1}{1+\epsilon/2}\sigma_{k},\sigma_{k}\right). Let Aouter=A−Ainner=UΣouterVT\mathbf{A}_{outer}=\mathbf{A}-\mathbf{A}_{inner}=\mathbf{U}\mathbf{\Sigma}_{outer}\mathbf{V}^{T}. Σouter\mathbf{\Sigma}_{outer} contains all large singular values of A\mathbf{A} with σi≥σk\sigma_{i}\geq\sigma_{k} and all small singular values with σi<11+ϵ/2σk\sigma_{i}<\frac{1}{1+\epsilon/2}\sigma_{k}.

We next apply the argument used to prove Property 1 to p2(Aouter)Πp_{2}(\mathbf{A}_{outer})\mathbf{\Pi}. The (k+1)th(k+1)^{\text{th}} singular value of Aouter\mathbf{A}_{outer} is equal to σk+w+1≤11+ϵ/2σk=α\sigma_{k+w+1}\leq\frac{1}{1+\epsilon/2}\sigma_{k}=\alpha. So applying (7) we have for all l≤kl\leq k,

Plugging (9) and (6.1) into (8) yields that, for any x\mathbf{x} in span(Y2)span(\mathbf{Y}_{2}), i.e. span(p2(A)Π)span(p_{2}(\mathbf{A})\mathbf{\Pi}),

So, we have identified a rank kk subspace Y2\mathbf{Y}_{2} within our Krylov subspace such that every vector in its span aligns at least as well with A\mathbf{A} as uk\mathbf{u}_{k}.

Now, for any m≤l≤km\leq l\leq k, consider E(Zl,A)\mathcal{E}(\mathbf{Z}_{l},\mathbf{A}). We know that given Zl−1\mathbf{Z}_{l-1}, we can form a rank ll matrix Z‾l\mathbf{\overline{Z}}_{l} in our Krylov subspace simply by appending a column x\mathbf{x} orthogonal to the l−1l-1 columns of Zl−1\mathbf{Z}_{l-1} but falling in the span of Y2\mathbf{Y}_{2}. Since Y2\mathbf{Y}_{2} has rank kk, finding such a column is always possible. Since Zl\mathbf{Z}_{l} is the optimal rank ll Frobenius norm approximation to A\mathbf{A} falling within our Krylov subspace,

Again, a nearly identical proof applies for Algorithm 1. We just choose p2(x)=σk(xσk)2q+1p_{2}(x)=\sigma_{k}\left(\frac{x}{\sigma_{k}}\right)^{2q+1}. For q=Θ(log⁡d/ϵ)q=\Theta(\log d/\epsilon) this polynomial satisfies the necessary properties: for all i≥ki\geq k, p1(σi)≤O(ϵ2d2σk2)p_{1}(\sigma_{i})\leq O\left(\frac{\epsilon}{2d^{2}}\sigma_{k}^{2}\right) and for all i≤ki\leq k, σi≤p2(σi)\sigma_{i}\leq p_{2}(\sigma_{i}).

Proof of Property 3

By Properties 1 and 2 we already have, for all l≤kl\leq k, E(Zl,A)≤ϵσk+12+(l−m)⋅3ϵσk+12≤(1+k−m)⋅3ϵ⋅σk+12\mathcal{E}(\mathbf{Z}_{l},\mathbf{A})\leq\epsilon\sigma_{k+1}^{2}+(l-m)\cdot 3\epsilon\sigma_{k+1}^{2}\leq(1+k-m)\cdot 3\epsilon\cdot\sigma_{k+1}^{2}. So if k−m≤wk-m\leq w then we immediately have Property 3.

For l≤m+wl\leq m+w, then Properties 1 and 2 already give us E(Zl,A)≤ϵσk+12+(l−m)⋅3ϵσk+12≤(w+1)⋅3ϵ⋅σk+12\mathcal{E}(\mathbf{Z}_{l},\mathbf{A})\leq\epsilon\sigma_{k+1}^{2}+(l-m)\cdot 3\epsilon\sigma_{k+1}^{2}\leq(w+1)\cdot 3\epsilon\cdot\sigma_{k+1}^{2}. So consider m+w≤l≤km+w\leq l\leq k. Given Zm\mathbf{Z}_{m}, to form a rank ll matrix Z‾l\mathbf{\overline{Z}}_{l} in our Krylov subspace we need to append l−ml-m orthonormal columns. We can choose min⁡{k−w−m,l−m}\min\{k-w-m,l-m\} columns, X1\mathbf{X}_{1}, from the k−wk-w dimensional subspace within span(Y2)span(\mathbf{Y}_{2}) that is entirely contained in span(Youter)span(\mathbf{Y}_{outer}). If necessary (i.e. k−w−m≤l−mk-w-m\leq l-m), We can then choose the remaining l−(k−w)l-(k-w) columns X2\mathbf{X}_{2} from the span of Y2\mathbf{Y}_{2}.

Similar to our argument when considering a single vector in the span of Youter\mathbf{Y}_{outer}, letting Y‾outer=(I−X1X1T)Youter\mathbf{\overline{Y}}_{outer}=\left(\mathbf{I}-\mathbf{X}_{1}\mathbf{X}_{1}^{T}\right)\mathbf{Y}_{outer}, we have by (10):

By applying (6.1) directly to each column of X2\mathbf{X}_{2} we also have:

Assume that min⁡{k−w−m,l−m}=k−w−m\min\{k-w-m,l-m\}=k-w-m. Similar calculations show the same result when min⁡{k−w−m,l−m}=l−m\min\{k-w-m,l-m\}=l-m. We can use the above two bounds to obtain:

2 Error Bounds for Simultaneous Iteration and Block Krylov Iteration

With Lemma 9 in place, we can easily prove that Simultaneous Iteration and Block Krylov Iteration both achieve the low-rank approximation and PCA guarantees (1), (2), and (3).

With probability 99/10099/100, Algorithms 1 and 2 return Z\mathbf{Z} satisfying (2):

Let mm be the number of singular values with σi≥(1+ϵ/2)σk+1\sigma_{i}\geq(1+\epsilon/2)\sigma_{k+1}. If m=0m=0 then we are done since any Z\mathbf{Z} will satisfy ∥A−ZZTA∥2≤∥A∥2=σ1≤(1+ϵ/2)σk+1≤(1+ϵ)∥A−Ak∥2\|\mathbf{A}-\mathbf{Z}\mathbf{Z}^{T}\mathbf{A}\|_{2}\leq\|\mathbf{A}\|_{2}=\sigma_{1}\leq(1+\epsilon/2)\sigma_{k+1}\leq(1+\epsilon)\|\mathbf{A}-\mathbf{A}_{k}\|_{2}. Otherwise, by Property 1 of Lemma 9,

Additive error in Frobenius norm directly translates to additive spectral norm error. Specifically, applying Theorem 3.4 of , which we also prove as Lemma 15 in Appendix A,

Finally, ZmZmTA=ZZmTA\mathbf{Z}_{m}\mathbf{Z}_{m}^{T}\mathbf{A}=\mathbf{Z}\mathbf{Z}_{m}^{T}\mathbf{A} and so by Lemma 3 we have ∥A−ZZTA∥22≤∥A−ZmZmTA∥22\|\mathbf{A}-\mathbf{Z}\mathbf{Z}^{T}\mathbf{A}\|_{2}^{2}\leq\|\mathbf{A}-\mathbf{Z}_{m}\mathbf{Z}_{m}^{T}\mathbf{A}\|_{2}^{2}, which combines with (13) to give the result. ∎

With probability 99/10099/100, Algorithms 1 and 2 return Z\mathbf{Z} satisfying (1):

ww is defined as the number of singular values with 11+ϵ/2σk≤σi<σk\frac{1}{1+\epsilon/2}\sigma_{k}\leq\sigma_{i}<\sigma_{k}. So ∥A−Ak∥F2≥w⋅(11+ϵ/2σk)2\|\mathbf{A}-\mathbf{A}_{k}\|_{F}^{2}\geq w\cdot\left(\frac{1}{1+\epsilon/2}\sigma_{k}\right)^{2}. Plugging into (6.2) we have:

Adjusting constants on the ϵ\epsilon gives us the result. ∎

With probability 99/10099/100, Algorithms 1 and 2 return Z\mathbf{Z} satisfying (3):

First note that ziTAATzi≤uiTAATui\mathbf{z}_{i}^{T}\mathbf{A}\mathbf{A}^{T}\mathbf{z}_{i}\leq\mathbf{u}_{i}^{T}\mathbf{A}\mathbf{A}^{T}\mathbf{u}_{i}. This is because ziTAATzi=ziTQQTAATQQTzi=σi(QQTA)2\mathbf{z}_{i}^{T}\mathbf{A}\mathbf{A}^{T}\mathbf{z}_{i}=\mathbf{z}_{i}^{T}\mathbf{Q}\mathbf{Q}^{T}\mathbf{A}\mathbf{A}^{T}\mathbf{Q}\mathbf{Q}^{T}\mathbf{z}_{i}=\sigma_{i}(\mathbf{Q}\mathbf{Q}^{T}\mathbf{A})^{2} by our choice of zi\mathbf{z}_{i}. σi(QQTA)2≤σi(A)2\sigma_{i}(\mathbf{Q}\mathbf{Q}^{T}\mathbf{A})^{2}\leq\sigma_{i}(\mathbf{A})^{2} since applying a projection to A\mathbf{A} will decrease each of its singular values (which follows for example from the Courant-Fischer min-max principle). Then by Property 2 of Lemma 9 we have, for all i≤ki\leq k,

σi2=uiTAATui\sigma_{i}^{2}=\mathbf{u}_{i}^{T}\mathbf{A}\mathbf{A}^{T}\mathbf{u}_{i}, so simply adjusting constants on ϵ\epsilon gives the result. ∎

Improved Convergence With Spectral Decay

In order to avoid inverse dependence on the potentially small singular value gap σkσk+1−1\frac{\sigma_{k}}{\sigma_{k+1}}-1, the number of Block Krylov iterations inherently depends on 1/ϵ1/\sqrt{\epsilon}. This ensures that our matrix polynomial sufficiently separates small singular values from larger ones. However, when σk>(1+ϵ)σk+1\sigma_{k}>(1+\epsilon)\sigma_{k+1} we can actually use q=Θ(log⁡(d/ϵ)/min⁡{1,σkσk+1−1})q=\Theta\left(\log(d/\epsilon)/\sqrt{\min\{1,\frac{\sigma_{k}}{\sigma_{k+1}}-1\}}\right) iterations, which is sufficient for separating the top kk singular values significantly from the lower values. Specifically, if we set α=σk+1\alpha=\sigma_{k+1} and γ=σkσk+1−1\gamma=\frac{\sigma_{k}}{\sigma_{k+1}}-1, we know that with q=Θ(log⁡(d/ϵ)/min⁡{1,σkσk+1−1})q=\Theta\left(\log(d/\epsilon)/\sqrt{\min\{1,\frac{\sigma_{k}}{\sigma_{k+1}}-1\}}\right), (5) still holds. We can then just follow the proof of Lemma 9 and show that Property 1 holds for all l≤kl\leq k (not just for l≤ml\leq m as originally proven). This gives Property 2 and Property 3 trivially.

Further, for p≥kp\geq k, the exact same analysis shows that q=Θ(log⁡(d/ϵ)/min⁡{1,σkσp+1−1})q=\Theta\left(\log(d/\epsilon)/\sqrt{\min\{1,\frac{\sigma_{k}}{\sigma_{p+1}}-1\}}\right) suffices. When A\mathbf{A}’s spectrum decays rapidly, so σp+1≤c⋅σk\sigma_{p+1}\leq c\cdot\sigma_{k} for some constant c<1c<1 and some pp not much larger than kk, we can obtain significantly faster runtimes. Our ϵ\epsilon dependence becomes logarithmic, rather than polynomial:

With probability 99/10099/100, for any p≥kp\geq k, Algorithm 1 or 2 initialized with Π∼N(0,1)d×p\mathbf{\Pi}\sim\mathcal{N}(0,1)^{d\times p} returns Z\mathbf{Z} satisfying guarantees (1), (2), and (3) as long as we set q=Θ(log⁡(d/ϵ)/(min⁡{1,σkσp+1−1}))q=\Theta\left(\log(d/\epsilon)/\left(\min\{1,\frac{\sigma_{k}}{\sigma_{p+1}}-1\}\right)\right) or Θ(log⁡(d/ϵ)/min⁡{1,σkσp+1−1})\Theta\left(\log(d/\epsilon)/\sqrt{\min\{1,\frac{\sigma_{k}}{\sigma_{p+1}}-1\}}\right), respectively.

This theorem may prove especially useful in practice because, on many architectures, multiplying a large A\mathbf{A} by 2k2k or even 10k10k vectors is not much more expensive than multiplying by kk vectors. Additionally, it should still be possible to perform all steps for post-processing K\mathbf{K} in memory, again limiting additional runtime costs due to its larger size.

Finally, we note that while Theorem 13 is more reminiscent of classical gap-dependent bounds, it still takes substantial advantage of the fact that we’re looking for nearly optimal low-rank approximations and principal components instead of attempting to converge precisely to A\mathbf{A}’s true singular vectors. This allows the result to avoid dependence on the gap between adjacent singular values, instead varying only with σkσp+1\frac{\sigma_{k}}{\sigma_{p+1}}, which should be much larger.

Experiments

We close with several experimental results. A variety of empirical papers, not to mention widespread adoption, already justify the use of randomized SVD algorithms. Prior work focuses in particular on benchmarking Simultaneous Iteration and, due to its improved accuracy over sketch-and-solve approaches, this algorithm is popular in practice . As such, we focus on demonstrating that for many data problems Block Krylov Iteration can offer significantly better convergence.

We implement both algorithms in MATLAB using Gaussian random starting matrices with exactly kk columns. We explicitly compute K\mathbf{K} for both algorithms, as described in Section 5, and use reorthonormalization at each iteration to improve stability . We test the algorithms with varying iteration count qq on three common datasets, SNAP/amazon0302 , SNAP/email-Enron , and 20 Newsgroups , computing column principal components in all cases. We plot error vs. iteration count for metrics (1), (2), and (3) in Figure 3. For per vector error (3), we plot the maximum deviation amongst all top kk approximate principal components (relative to σk+1\sigma_{k+1}).

Unsurprisingly, both algorithms obtain very accurate Frobenius norm error, ∥A−ZZTA∥F/∥A−Ak∥F\|\mathbf{A}-\mathbf{Z}\mathbf{Z}^{T}\mathbf{A}\|_{F}/\|\mathbf{A}-\mathbf{A}_{k}\|_{F}, with very few iterations. This is our intuitively weakest guarantee and, in the presence of a heavy singular value tail, both iterative algorithms will outperform the worst case analysis.

On the other hand, for spectral norm low-rank approximation and per vector error, we confirm that Block Krylov Iteration converges much more rapidly than Simultaneous Iteration, as predicted by our theoretical analysis. It it often possible to achieve nearly optimal error with <8<8 iterations where as getting to within say 1%1\% error with Simultaneous Iteration can take much longer.

The final plot in Figure 3 shows error verses runtime for the 11269×1508811269\times 15088 dimensional 20 Newsgroups dataset. We averaged over 7 trials and ran the experiments on a commodity laptop with 16GB of memory. As predicted, because its additional memory overhead and post-processing costs are small compared to the cost of the large matrix multiplication required for each iteration, Block Krylov Iteration outperforms Simultaneous Iteration for small ϵ\epsilon.

More generally, these results justify the importance of convergence bounds that are independent of singular value gaps. Our analysis in Section 7 predicts that, once ϵ\epsilon is small in comparison to the gap σkσk+1−1\frac{\sigma_{k}}{\sigma_{k+1}}-1, we should see much more rapid convergence since qq will depend on log⁡(1/ϵ)\log(1/\epsilon) instead of 1/ϵ1/\epsilon. However, for Simultaneous Iteration, we do not see this behavior with SNAP/amazon0302 and it only just begins to emerge for 20 Newsgroups.

While all three datasets have rapid singular value decay, a careful look confirms that their singular value gaps are actually quite small! For example, σkσk+1−1\frac{\sigma_{k}}{\sigma_{k+1}}-1 is .004 for SNAP/amazon0302 and .011 for 20 Newsgroups, in comparison to .042 for SNAP/email-Enron. Accordingly, the frequent claim that singular value gaps can be taken as constant is insufficient, even for small ϵ\epsilon.

We thank David Woodruff, Aaron Sidford, Richard Peng and Jon Kelner for several valuable conversations. Additionally, Michael Cohen was very helpful in discussing many details of this project, including the ultimate form of Lemma 9. This work was partially supported by NSF Graduate Research Fellowship Grant No. 1122374, AFOSR grant FA9550-13-1-0042, DARPA grant FA8650-11-C-7192, and the NSF Center for Science of Information.

References

Appendix A Appendix

We first give a deterministic Lemma, from which the main approximation result follows.

We follow . Apply Lemma 14 with S=Π\mathbf{S}=\mathbf{\Pi}. With probability 11, VkTS\mathbf{V}_{k}^{T}\mathbf{S} has full rank. So, to show the result we need to show that ∥(A−Ak)S(VkTS)+∥F2≤c∥A−Ak∥F2\|\left(\mathbf{A}-\mathbf{A}_{k}\right)\mathbf{S}\left(\mathbf{V}_{k}^{T}\mathbf{S}\right)^{+}\|_{F}^{2}\leq c\|\mathbf{A}-\mathbf{A}_{k}\|_{F}^{2} for some fixed cc. For any two matrices M\mathbf{M} and N\mathbf{N}, ∥MN∥F≤∥M∥F∥N∥2\|\mathbf{MN}\|_{F}\leq\|\mathbf{M}\|_{F}\|\mathbf{N}\|_{2}. This property is known as spectral submultiplicativity. Noting that ∥Ur∖kΣr∖k∥F2=∥A−Ak∥F2\|\mathbf{U}_{r\setminus k}\mathbf{\Sigma}_{r\setminus k}\|_{F}^{2}=\|\mathbf{A}-\mathbf{A}_{k}\|_{F}^{2} and applying submultiplicativity,

By the rotational invariance of the Gaussian distribution, since the rows of VT\mathbf{V}^{T} are orthonormal, the entries of VkTS\mathbf{V}_{k}^{T}\mathbf{S} and Vr∖kTS\mathbf{V}^{T}_{r\setminus k}\mathbf{S} are independent Gaussians. By standard Gaussian matrix concentration results (Fact 6 of , also in ), with probability at least 99/10099/100, ∥Vr∖kTS∥22≤c1⋅max⁡{k,r−k}≤c1d˙\|\mathbf{V}^{T}_{r\setminus k}\mathbf{S}\|_{2}^{2}\leq c_{1}\cdot\max\{k,r-k\}\leq c_{1}\dot{d} and ∥(VkTS)+∥22≤c2k\|\left(\mathbf{V}_{k}^{T}\mathbf{S}\right)^{+}\|_{2}^{2}\leq c_{2}k for some fixed constants c1,c2c_{1},c_{2}. So,

for some fixed cc, yielding the result. Note that we choose probability 99/10099/100 for simplicity – we can obtain a result with higher probability by simply allowing for a higher constant cc, which in our applications of Lemma 4 will only factor into logarithmic terms. ∎

Chebyshev Polynomials

Given a specified value α>0\alpha>0, gap γ∈(0,1]\gamma\in(0,1], and q≥1q\geq 1, there exists a degree qq polynomial p(x)p(x) such that:

p((1+γ)α)=(1+γ)αp(\left(1+\gamma)\alpha\right)=(1+\gamma)\alpha

p(x)≥xp(x)\geq x for all x≥(1+γ)αx\geq(1+\gamma)\alpha

∣p(x)∣≤α2qγ−1|p(x)|\leq\frac{\alpha}{2^{q\sqrt{\gamma}-1}} for all x∈[0,α]x\in[0,\alpha]

Furthermore, when qq is odd, the polynomial only contains odd powered monomials.

The required polynomial can be constructed using a standard Chebyshev polynomial of degree qq, Tq(x)T_{q}(x), which is defined by the three term recurrence:

Each Chebyshev polynomial satisfies the well known property that Tq(x)≤1T_{q}(x)\leq 1 for all x∈x\in and, for x>1x>1, we can write the polynomials in closed form :

which is clearly of degree qq and well defined since, referring to (15), Tq(x)>0T_{q}(x)>0 for all x>1x>1. Now,

so p(x)p(x) satisfies property 1. With property 1 in place, to prove that p(x)p(x) satisfies property 2, it suffices to show that p′(x)≥1p^{\prime}(x)\geq 1 for all x≥(1+γ)αx\geq(1+\gamma)\alpha. By chain rule,

Thus, it suffices to prove that, for all x≥(1+γ)x\geq(1+\gamma),

We do this by showing that (1+γ)Tq′(1+γ)≥Tq(1+γ)(1+\gamma)T^{\prime}_{q}(1+\gamma)\geq T_{q}(1+\gamma) and then claim that Tq′′(x)≥0T^{\prime\prime}_{q}(x)\geq 0 for all x>(1+γ)x>(1+\gamma), so (17) holds for x>(1+γ)x>(1+\gamma) as well. A standard form for the derivative of the Chebyshev polynomial is

(18) can be verified via induction once noting that the Chebyshev recurrence gives Tq′=2xTq−1′+2Tq−1−Tq−2′T_{q}^{\prime}=2xT^{\prime}_{q-1}+2T_{q-1}-T^{\prime}_{q-2}. Since Ti(x)>0T_{i}(x)>0 when x≥1x\geq 1, we can conclude that Tq′(x)≥2qTq−1(x)T^{\prime}_{q}(x)\geq 2qT_{q-1}(x). So proving (17) for x=(1+γ)x=(1+\gamma) reduces to proving that

Noting that, for x≥1x\geq 1, (x+x2−1)>0(x+\sqrt{x^{2}-1})>0 and (x−x2−1)>0(x-\sqrt{x^{2}-1})>0, it follows from (15) that

So, to prove (19), it suffices to show that 2(1+γ)≤(1+γ)2q2(1+\gamma)\leq(1+\gamma)2q, which is true whenever q≥1q\geq 1. So (17) holds for all x=(1+γ)x=(1+\gamma).

Finally, referring to (18), we know that Tq′′T_{q}^{\prime\prime} must be some positive combination of lower degree Chebyshev polynomials. Again, since Ti(x)>0T_{i}(x)>0 when x≥1x\geq 1, we conclude that Tq′′(x)≥0T_{q}^{\prime\prime}(x)\geq 0 for all x≥1x\geq 1. It follows that Tq′(x)T^{\prime}_{q}(x) does not decrease above x=(1+γ)x=(1+\gamma), so (17) also holds for all x>(1+γ)x>(1+\gamma) and we have proved property 2.

To prove property 3, we first note that, by the well known property that Ti(x)≤1T_{i}(x)\leq 1 for x∈x\in, Tq(x/α)≤1T_{q}(x/\alpha)\leq 1 for x∈[0,α]x\in[0,\alpha]. So, to prove p(x)≤α2qγ−1p(x)\leq\frac{\alpha}{2^{q\sqrt{\gamma}-1}}, we just need to show that

Equation (15) gives Tq(1+γ)≥12(1+γ+(1+γ)2−1)q≥12(1+γ)qT_{q}(1+\gamma)\geq\frac{1}{2}(1+\gamma+\sqrt{(1+\gamma)^{2}-1})^{q}\geq\frac{1}{2}(1+\sqrt{\gamma})^{q}. When γ≤1\gamma\leq 1, (1+γ)1/γ≥2(1+\sqrt{\gamma})^{1/\sqrt{\gamma}}\geq 2. Thus, (1+γ)q≥2qγ(1+\sqrt{\gamma})^{q}\geq 2^{q\sqrt{\gamma}}. Dividing by 2 gives Tq(1+γ)≥2qγ−1T_{q}(1+\gamma)\geq 2^{q\sqrt{\gamma}-1}, which gives (20) and thus property 3.

Finally, we remark that it is well known that odd degree Chebyshev polynomials of the first kind only contain monomials of odd degree (and this is easy to verify inductively). Accordingly, since pq(x)p_{q}(x) is simply a scaling of Tq(x)T_{q}(x), if we choose qq to be odd, pq(x)p_{q}(x) only contains odd degree terms. ∎

Additive Frobenius Norm Error Implies Additive Spectral Norm Error

Note that if n<dn<d, we can just work with AT\mathbf{A}^{T} and BT\mathbf{B}^{T}. Now, σk+1(B)=0\sigma_{k+1}(\mathbf{B})=0 since B\mathbf{B} is rank kk. Using the resulting inequality and recalling that ∥A−Ak∥F2=∑i=k+1nσi2(A)\|\mathbf{A}-\mathbf{A}_{k}\|_{F}^{2}=\sum_{i=k+1}^{n}\sigma_{i}^{2}(\mathbf{A}), we see that:

σk+12(A)\sigma_{k+1}^{2}(\mathbf{A}) is equal to the squared top singular value of A−Ak\mathbf{A}-\mathbf{A}_{k} (i.e. ∥A−Ak∥22\|\mathbf{A}-\mathbf{A}_{k}\|_{2}^{2}, so the lemma follows. ∎