Sparsity Lower Bounds for Dimensionality Reducing Maps
Jelani Nelson, Huy L. Nguyen
Introduction
The last decade has witnessed a burgeoning interest in algorithms for large-scale data. A common feature in many of these works is the exploitation of data sparsity to achieve algorithmic efficiency, for example to have running times proportional to the actual complexity of the data rather than the dimension of the ambient space it lives in. This approach has found applications in compressed sensing [CT05, Don06], dimension reduction [BOR10, DKS10, KN10, KN12, WDL+09], and numerical linear algebra [CW12, MM12, MP12, NN12]. Given the success of these algorithms, it is important to understand their limitations. Until now, for most of these problems it is not known how far one can reduce the running time on sparse inputs. In this work we make a step towards understanding the performance of algorithms for sparse data and show several tight lower bounds.
In this work we provide three main contributions. We give near-optimal or optimal sparsity lower bounds for Johnson-Lindenstrauss transforms, matrices satisfying the restricted isometry property for use in compressed sensing, and subspace embeddings used in numerical linear algebra. These three contributions are discussed in Section 1.1, Section 1.2, and Section 1.3, respectively.
The following lemma, due to Johnson and Lindenstrauss [JL84], has been used widely in many areas of computer science to reduce data dimension.
Typically one uses the lemma in algorithm design by mapping some instance of a high-dimensional computational geometry problem to a lower dimension. The running time to solve the instance then becomes the time needed for the lower-dimensional problem, plus the time to perform the matrix-vector multiplications ; see [Ind01, Vem04] for further discussion. This latter step highlights the importance of having a JL matrix supporting fast matrix-vector multiplication. The original proofs of the JL lemma took to be a random dense matrix, e.g. with i.i.d. Gaussian, Rademacher, or even subgaussian entries [Ach03, AV06, DG03, FM88, IM98, JL84, Mat08]. The time to compute then becomes , where has non-zero entries.
A beautiful work of Ailon and Chazelle [AC09] described a construction of a JL matrix supporting matrix-vector multiplication in time , also with . This was improved to [AL09] with the same for any constant , or to with [AL11, KW11]. Thus if one can obtain nearly-linear embedding time with the same target dimension as the original JL lemma, or one can also obtain nearly-linear time for any setting of by increasing slightly by factors.
While the previous paragraph may seem to present the end of the story, in fact note that the “nearly-linear” embedding time is actually much worse than the original time of dense JL matrices when is very small, i.e. when is sparse. Indeed, in several applications we expect to be sparse. Consider the bag of words model in information retrieval: in for example an email spam collaborative filtering system for Yahoo! Mail [WDL+09], each email is treated as a -dimensional vector where is the size of the lexicon. The th entry of the vector is some weighted count of the number of occurrences of word (frequent words like “the” should be weighted less heavily). A machine learning algorithm is employed to learn a spam classifier, which involves dot products of email vectors with some learned classifier vector, and JL dimensionality reduction is used to speed up the repeated dot products that are computed during training. Note that in this scenario we expect to be sparse since most emails do not contain nearly every word in the lexicon. An even starker scenario is the turnstile streaming model, where the vectors may receive coordinate-wise updates in a data stream. In this case maintaining in a stream given some update of the form “add to ” requires adding to the compression stored in memory. Since , we would not like to spend per streaming update.
The intuition behind all the works [AC09, AL09, AL11, KW11] to obtain embedding time was as follows. Picking to be a scaled sampling matrix (where each row has a in a random location) gives the correct expectation for , but the variance may be too high. Indeed, the variance is high exactly when is sparse; consider the extreme case where so that sampling is not even expected to see the non-zero coordinate unless . These works then all essentially proceed by randomly preconditioning to ensure that is very well-spread (i.e. far from sparse) with high probability, so that sampling works, and thus fundamentally cannot take advantage of input sparsity. One way of obtaining faster matrix-vector multiplication for sparse inputs is to have sparse JL matrices . Indeed, if has at most non-zero entries per column then can be computed in time. A line of work [Ach03, Mat08, DKS10, BOR10, KN10, KN12] investigated the value achievable in a JL matrix, culminating in [KN12] showing that it is possible to simultaneously have and . Such a sparse JL transform thus speeds up embeddings by a factor of roughly without increasing the target dimension.
Note that if one can simply take to be the identity matrix which achieves , and thus the restriction is nearly optimal. Also note that we can assume since otherwise is required in any JL matrix [Alo09], and thus the restriction is no worse than requiring . Furthermore if all the entries of are required to be equal in magnitude, our lower bound holds as long as .
Before our work, only a restricted lower bound of had been shown [DKS10]. In fact this lower bound only applied to the distributional JL problem, a much stronger guarantee where one wants to design a distribution over matrices such that any fixed vector has with probability over the choice of . Indeed any distributional JL construction yields the JL lemma by setting and union bounding over all the difference vectors. Thus, aside from the weaker lower bound on , [DKS10] only provided a lower bound against this stronger guarantee, and furthermore only for a certain restricted class of distributions that made certain independence assumptions amongst matrix entries, and also assumed certain bounds on the sum of fourth moments of matrix entries in each row.
2 Compressed sensing and the restricted isometry property
Another object of interest are matrices satisfying the restricted isometry property (RIP). Such matrices are widely used in compressed sensing.
For any integer , a matrix is said to have the -restricted isometry property with distortion if for all with .
Another upside of sparse RIP matrices is that they allow faster algorithms for encoding . If has non-zeroes per column and receives, for example, turnstile streaming updates, then the compression can be maintained on the fly in time per update (assuming the non-zero entries of any column of can be recovered in time).
We show as long as , any -RIP matrix with distortion and rows with non-zero entries per column must have . That is, RIP matrices with the optimal number of rows must be dense for almost the full range of up to . This lower bound strongly rules out any hope for faster recovery and compression algorithms for compressed sensing by using sparse RIP matrices as mentioned above.
We note that any sparsity lower bound should fail as approaches since the identity matrix trivially satisfies -RIP for any and has column sparsity . Thus, our lower bound holds for almost the full range of parameters for .
3 Oblivious Subspace Embeddings
Sarlós showed in [Sar06] that OSE’s are useful for approximate least squares regression and low rank approximation, and they have also been shown useful for approximating statistical leverage scores [DMIMW12], an important concept in statistics and machine learning. See [CW12] for an overview of several applications of OSE’s.
The work of Sarlós picked with special structure so that can be computed in time , namely by using the Fast Johnson-Lindenstrauss Transform of [AC09] (see also [Tro11]). Unfortunately the time is even for sparse matrices , and several applications require solving numerical linear algebra problems on sparse matrix inputs. For example in the Netflix matrix where rows are users and columns are movies, and is some rating score, is very sparse since most users rate only a tiny fraction of all movies [ZWSP08]. If denotes the number of non-zero entries of , we would like running times closer to than to multiply by . Such a running time would be possible, for example, if only had non-zero entries per column.
In a recent and surprising work, Clarkson and Woodruff [CW12] gave an OSE with and , thus providing fast numerical linear algebra algorithms for sparse matrices. For example, the running time for least-squares regression becomes . The dependence on was improved in [NN12] to . The work [NN12] also showed how to obtain , for any constant (the constant in the big-Oh depends polynomially on ), or , . It is thus natural to ask whether one can obtain the best of both worlds: can there be an OSE with and ?
In this work we show that any OSE such that all matrices in its support have rows and non-zero entries per column must have if . Thus for constant and large , the upper bound of [NN12] is optimal.
4 Organization
In Section 2 we prove our lower bound for the sparsity required in JL matrices. In Section 3 we give our sparsity lower bound for RIP matrices, and in Section 4 we give our lower bound on the number of rows for OSE’s having sparsity . In Section 5 we give a lower bound involving on the number of rows in an RIP matrix, and in Section 6 we state an open problem.
JL Sparsity Lower Bound
In Section 2.1 we give the lower bound on in the case that all entries in are in . In Section 2.2 we give our lower bound without making any assumption on the magnitudes of entries in . Before proceeding further, we prove a couple lemmas used throughout this section, and also later in this paper. Throughout this section is always an -incoherent matrix.
For any , cannot have any row with at least entries greater than , nor can it have any row with at least entries less than .
Proof. For the sake of contradiction, suppose did have such a row, say the th row. Suppose for some , where (the case where they are each less than is argued identically). Let denote the th column of . Let be but with the th coordinate replaced with . Then for any
and rearranging gives the contradiction .
Let be positive reals with and . Then if it must be the case that .
Proof. Define the function . Then is increasing for . Then since , for for constant we have the equality , where the term goes to zero as . Thus for sufficiently small we have that the term must be less than , so in order to have , since is increasing we must have .
In this section we consider the case that all entries of are either or and show a lower bound on in this case.
Suppose and all entries of are in . Then .
Proof. For the sake of contradiction suppose . There are non-zero entries in and thus at least of these entries have the same sign by the pigeonhole principle; wlog let us say appears at least times. Then again by pigeonhole some row of has values that are . The claim now follows by Lemma 3 with .
We now show how to improve the bound to the desired form.
Suppose and all entries of are in . Then .
Proof. We know by Lemma 5. Let . Every has subsets of size of non-zero coordinates. Thus by pigeonhole there exists a set of rows and columns such that for each row all entries in those columns are in magnitude and have the same sign (the signs may vary across rows). Letting be but with those coordinates set to , we have
Suppose for some small constant so that . Then
Taking the natural logarithm of both sides gives
Define , . Then , since . By [Alo09] we must have , so for smaller than some fixed constant. Thus by Lemma 4 we have . The theorem follows since since [Alo09].
Suppose and all entries of are in . Then .
2 General matrices
Suppose . Then .
Proof. For the sake of contradiction suppose . We know by Lemma 3 that for any , no row of can have more than entries of value at least in magnitude and of the same sign. Define . Let be the subset of indices in with , and define . Let denote the square of a random positive value from . Then
We now show how to obtain the extra factor of in the lower bound.
Now for these vectors , let of size be the set of the largest coordinates (in magnitude) in each . Define ; that is, we zero out the coordinates in . Then for ,
The last inequality used that . Also we pick to ensure so that the right hand side of Eq. (1) is less than . The penultimate inequality follows by Cauchy-Schwarz. Thus we have
However we also have , which implies by rearranging Eq. (2).
Proof. By Lemma 8, . Set so that Lemma 9 applies. Then by Lemma 9, as long as ,
where is as in Lemma 9. Taking the natural logarithm on both sides,
Define . Thus we have . We have that is always the case for since then and we have that . Also note for smaller than some constant we have that since by [Alo09]. Thus by Lemma 4 we have . Using that since , and that for our setting of when gives . Since [Alo09], this is equivalent to our lower bound in the theorem statement.
From Theorem 10, we can deduce that for constant , in order for the sparsity to be a constant independent of , it must be the case that . This fact rules out very sparse mappings even when we significantly increase the target dimension.
RIP Sparsity Lower Bound
Assume , for some fixed universal small constant , . Then we must have .
a contradiction. Let a pattern at scale be a subset of size of along with signs. There are patterns where for all and the signs of match the signs of .
There are possible patterns at scale . By an averaging argument, there exists a scale , and a pattern such that the number of columns of with this pattern is at least . Consider 2 cases.
Pick an arbitrary set of such columns. Consider the vector with ones at locations corresponding to those columns and zeroes everywhere else. We have and for each , we have
This contradicts the assumption that .
Case 2 (z<kz<k):
Consider the vector with ones at locations corresponding to those columns and zeroes everywhere else. We have and for each , we have . Consider 2 subcases.
Case 2.1 (u=1u=1):
Then , so
This contradicts the assumption that .
Case 2.2 (u=24−ts/ku=2^{4-t}s/k):
Eq. (4) follows from . Eq. (5) follows from the fact that is monotonically decreasing for . Indeed,
Eq. (6) follows since , which holds since . This contradicts the assumption of Case 2 that .
Thus we have as desired. If we are done. Otherwise we have . Define , . Thus we have . We have for smaller than some constant by Theorem 20, and we have since we assume we are in the case . Thus by Lemma 4 we have , which completes the proof of the theorem.
When , for some universal constant , and the number of rows , we must have .
The restriction in Theorem 13 was relevant in Eq. (3). Note the choice of in the proof was just so that converges. We could instead have chosen and obtained a qualitatively similar result, but with the slightly milder restriction , where can be chosen as an arbitrary constant.
Oblivious Subspace Embedding Sparsity Lower Bound
In this section, we show a lower bound on the dimension of very sparse OSE’s.
Proof. Assume for the sake of contradiction that . By Yao’s minimax principle, we only need to show there exists a distribution over subspaces such that any fixed matrix with column sparsity and too few rows would fail to preserve lengths of vectors in the subspace with probability more than .
If we pick one by one. Conditioned on , the probability that is heavy is at least . Therefore, by a Chernoff bound, with probability at least , the number of indices such that are heavy is at least .
We will show that conditioned on the number of such being at least , with probability at least , two such indices collide. Let be indices with . Conditioned on , the probability that does not collide with any previous index is at most
Thus, the probability that no collision occurs is at most . In other words, collision occurs with probability at least . When collision occurs, the number of non-zero entries of , where is the matrix whose columns are , is at most so it has rank at most . Therefore, with probability at least , maps some non-zero vector in the subspace to the zero vector (any vector for ) and fails to preserve the length of all vectors in the subspace.
Lower Bound on Number of Rows for RIP Matrices
In this section we show a lower bound on the number of rows of any -RIP matrix with distortion . First we need the following form of the Chernoff bound.
This form of the Chernoff bound can then be used to show the existence of a large error-correcting code with high relative distance.
For any and integers with , there exists a -ary code with and block length of relative distance , and with size at least
for some absolute constant .
Proof. We take a random code. That is, pick
Therefore by a union bound, a random multiset of codewords has relative distance with positive probability (in which case it must also clearly be not just a multiset, but a set).
Before proving the main theorem of this section, we also need the following theorem of Alon [Alo09].
For any and integers with , any -RIP matrix with distortion must have rows.
Proof. Let be a code as in Lemma 18 with block length and alphabet size with
Thus if we define by , then the satisfy the requirements of Theorem 19 with inner products at most in magnitude. The lower bound on the number of rows of then follows.
It is also possible to obtain a lower bound on the number of rows of in Theorem 20 of the form . This is because a theorem of [KW11] shows that any such RIP matrix with , when its column signs are flipped randomly, is a JL matrix for any set of points with high probability. We then know from Theorem 19 that a JL matrix must have rows, which is .
Future Directions
For several applications the JL lemma is used as a black box to obtain dimensionality-reducing linear maps for other problems. For example, applying the JL lemma with distortion on a certain net with vectors yields a -RIP matrix with distortion [BDDW08]. Note in this case, for constant , the number of rows one obtains is the optimal . Applying the distributional JL lemma with distortion to a certain net of size yields an OSE with rows to preserve -dimensional subspaces (see [CW12, Fact 10], based on [AHK06]).
Applying the JL lemma in this black-box way using the sparse JL matrices of [KN12] yields a factor- improvement in sparsity over using a random dense JL construction, with for example random Gaussian entries. However, some examples have shown that it is possible to do much better by not using the JL lemma statement as a black box, but rather by analyzing the sparsity required from the constructions in [KN12] “from scratch” for the problem at hand. For example, the work [NN12] showed that one can have column sparsity with rows in an OSE for any , which is much better than the column sparsity that is obtained by using the sparse JL theorem as a black box.
All entries of are in . We write where is an indicator random variable for the event , and the are independent uniform r.v.’s.
For any , with probability .
Note that the resolution of this question will not just be in terms of the functional. In particular, for constant we see that is necessary and sufficient when is the set of all unit norm -sparse vectors. Even increasing to does not decrease the lower bound on by much. Meanwhile for a unit sphere of a -dimensional subspace, we can simultaneously have , and not depending on at all.