Optimal lower bounds for locality sensitive hashing (except when q is tiny)
Ryan O'Donnell, Yi Wu, Yuan Zhou
Locality Sensitive Hashing
Locality Sensitive Hashing (LSH) is a widely-used algorithmic tool which brings the classic technique of hashing to geometric settings. It was introduced for general metric spaces in the seminal work of Indyk and Motwani [IM98]. Indyk and Motwani showed that the important problem of (approximate) nearest neighbor search can be reduced to the problem of devising good LSH families. Subsequently, numerous papers demonstrating the practical utility of solving high-dimensional nearest neighbor search problems via the LSH approach [GIM99, Buh01, CDF+01, SVD03, RPH05, DDGR07]. For a survey on LSH, see Andoni and Indyk [AI08].
We recall the basic definition from [IM98]:
As mentioned, the most useful application of LSH is to the approximate near neighbor problem in high dimensions:
Several important problems in computational geometry reduce to the approximate near neighbor problem, including approximate versions of nearest neighbor, furthest neighbor, close pair, minimum spanning tree, and facility location. For a short survey of these topics, see Indyk [Ind04].
Regarding the reduction from -near neighbor problem to LSH, it is usual (see [Ind01, DIIM04]) to credit roughly the following theorem to [IM98, GIM99]:
The rho parameter of an -sensitive LSH family is
Please note that in Theorem 1.1, it is implicitly assumed [Ind09] that is bounded away from . For “subconstant” values of , the theorem does not hold. This point is discussed further in Section 4.
Because of Theorem 1.1, there has been significant interest [DIIM04, TT07, AI08, Ney10] in determining the smallest possible that can be obtained for a given metric space and value of . Constant factors are important here, especially for the most natural regime of close to . For example, shrinking by an additive leads to time and space savings of .
Previous work
The original work of Indyk and Motwani [IM98] contains the following simple yet strong result:
There is an LSH family for under the Hamming distance which for each has rho parameter
In this theorem, the family is simply the uniform distribution over the functions . For a given and , this family is obviously -sensitive, whence
(The complexity of evaluating a hash function also increases as increases.)
2 Lower bounds
There is one known result on lower bounds for LSH, due to Motwani, Naor, and Panigrahy [MNP07]:
Fix , , and consider . Then there exists some such that for any LSH family for under Hamming distance which is -sensitive must satisfy
The metric setting of under Hamming distance is the most powerful setting for lower bounds; as Motwani, Naor, and Panigrahy note, one can immediately deduce a lower bound of
As , the lower bound in Theorem 2.4 approaches . This is a factor of away from the upper bound of Indyk and Motwani. The gap is slightly larger in the more natural regime of close to ; here one only has that .
Note that in Theorem 2.4, the parameter is fixed before one lets tend to ; i.e., is assumed to be at least a “constant”. Even though this is the same assumption implicitly made in the application of LSH to near-neighbors (Theorem 1.1), we feel it is not completely satisfactory. In fact, as stated in [MNP07], Theorem 2.4 still holds so long as . Our new lower bound for LSH also holds for this range of . But we believe the most satisfactory lower bound would hold even for “tiny” , meaning . This point is discussed further in Section 4.
Our result
In this work, we improve on Theorem 2.4 by obtaining a sharp lower bound of for every . This dependence on is optimal, by the upper bound of Indyk and Motwani. The precise statement of our result is as follows:
Here, the precise meaning of the expression is
where is a universal constant, and we assume , say.
As mentioned, the lower bound is only of the form under the assumption that . For of the form for a large constant , the bound (1) still gives some useful information.
As with the Motwani–Naor–Panigrahy result, because our lower bound is for we may immediately conclude:
This lower bound matches the known upper bounds for Euclidean space ([AI08]) and ([DIIM04]). It seems reasonable to conjecture that it is also tight at least for .
Finally, the lower bound in Theorem 3.1 also holds for the Jaccard distance on sets, matching the upper bound of Indyk and Motwani [IM98]. We explain why this is true in Section 3.2, although we omit the very minor necessary changes to the proof details.
Our proof of Theorem 3.1 requires some facts about boolean noise stability. We begin by recalling some basics of the analysis of boolean functions.
For , we say that are -correlated random strings in if is chosen uniformly at random and is formed by rerandomizing each coordinate of independently with probability .
where is the usual inner product.In the case that is countably infinite, we require our functions to have for all .
We also extend the notion of noise stability to hash families:
If is a hash family on , we define
By combining this definition with equation (2) and Proposition 3.3, we immediately deduce:
Let be a hash family on . Then
Finally, it is sometimes more natural to express the parameter as , where . (For example, we can think of a -correlated pair by taking to be uniformly random and to be the string that results from running the standard continuous-time Markov Chain on , starting from , for time .) We make the following definition:
2 The proof, modulo some tedious calculations
We now present the essence of our proof of Theorem 3.1. It will be quite simple to see how it gives a lower bound of the form (assuming is not tiny). Some very tedious calculations (Chernoff bounds, elementary inequalities, etc.) are needed to get the precise statement given in Theorem 3.1; the formal proof is therefore deferred to Section 5.
Let be a hash family on , and let us consider
We then deduce the desired lower bound of from the following theorem and its corollary:
For any hash family on , , and ,
As mentioned, we give the careful proof keeping track of approximations in Section 5. But first, we note what we view as a shortcoming of the proof: after deducing , we wish to “neglect” the additive term. This requires that indeed be negligible compared to ! Being more careful, the arises from a Chernoff bound applied to a Binomial random variable, where is very small. So to be more precise, the error term is of the form , and hence is only negligible if .
Discussion
As described in Section 1, it is normally stated that the quality of an -sensitive LSH family is governed by , and more specifically that can be used to solve the -near neighbor problem with roughly space and query time . However, this involves the implicit assumption that is bounded away from .
Given an -sensitive family of functions and a positive integer , we define the family by drawing independently from and forming the function , . It is easy to check that is -sensitive.
Indyk and Motwani show that if one has an -sensitive hash family with , then one can obtain a -near neighbor data structure with space roughly and query time roughly . Thus given an arbitrary -sensitive family , Indyk and Motwani suggest using the Powering Construction with . The resulting is -sensitive, with , yielding an space, time data structure.
However this argument makes sense only if is a positive integer. For example, with the trivially “optimal” LSH family, we have and thus . Indeed, whenever to begin with, one doesn’t get space and time, one simply gets space and time. For example, a hypothetical LSH family with and has but only yields an space, time near neighbor data structure.
The assumption is still not enough for the deduction in Theorem 1.1 to hold precisely. The reason is that the Indyk–Motwani choice of may not be an integer. For example, suppose we design an -sensitive family with and . Then . However, we cannot actually get an space, time data structure from this . The reason is that to get , we need to take . Then , so we only get an space, time data structure.
The effect of rounding up to the nearest integer is not completely eliminated unless one makes the assumption, implicit in Theorem 1.1, that . Under the weaker assumption that , the conclusion of Theorem 1.1 remains true up to factors. To be completely precise, one should assume and take . If we then use , the Powering Construction will yield an LSH family with and . In this way, one obtains a refinement of Theorem 1.1 with no additional assumptions:
2 On assuming q𝑞q is not tiny
Let us return from the near-neighbor problem to the study of locality sensitive hashing itself. Because of the “trivial” LSH family, it is essential to impose some kind of lower bound on how small the parameter is allowed to be. Motwani, Naor, and Panigrahy carry out their lower bound for LSH families on under the assumption that , but also note that it goes through assuming . Our main result, Theorem 3.1, is also best when , and is only nontrivial assuming for a sufficiently large constant .
One may ask what the “correct” lower bound assumed on should be. For the Indyk–Motwani application to -near neighbor data structures, the answer seems obvious: “”. Indeed, since the Indyk–Motwani reduction immediately uses Powering to reduce the parameter down to , the most meaningful LSH lower bounds would simply involve fixing and trying to lower bound .
There is an obvious catch here, though, which is that in the definition of LSH, there is no notion of “”! Still, in settings such as which have a notion of dimension, , it seems reasonable to think that applications will have . In this case, to maintain the Indyk–Motwani Theorem 4.1 up to factors one would require . This is precisely the assumption that this paper and the Motwani–Naor–Panigrahy paper have made. Still, we believe that the most compelling kind of LSH lower bound for would be nontrivial even for with a “medium” constant , say . We currently do not have such a lower bound.
Proof details
We require the following lemma, whose proof follows easily from Proposition 3.4 and the definition of hash family sensitivity:
Let be an -sensitive hash family on and suppose is a pair of -correlated random strings. Then
We now prove Theorem 3.1, which for convenience we slightly rephrase as follows:
Let be a small quantity to be chosen later, and let . Suppose that is an -sensitive hash family for . Our goal is to lower bound . By the Powering Construction we may assume that , and hence will use without further comment. Define also and .
Let be -correlated random strings and let be -correlated random strings. Using the two bounds in Lemma 5.1 separately, we have
We will also ensure that the quantity in (7) is positive by making the following
Substituting the three estimates (5)–(7) into (4) we obtain
We now estimate and in terms of (and ), after which we will choose so as to minimize . By definition, is the probability that a Binomial random variable exceeds , where . Let us select so that . Thus
Here we used the definitions of and , and then the assumption . Using a standard Chernoff bound, we conclude
using the fact that is increasing in , and again. We additionally estimate
Here the second inequality used , which certainly holds since . The third inequality used . Substituting this into (11) we obtain our upper bound for ,
Our estimation of is quite similar:
where and is chosen so that . This entails
This expression is the reason we were forced to take noticeably smaller than . Using our specific setting , we conclude
where we used again. As for , we can lower bound it similarly to , obtaining
Substituting our lower bounds for and into (13) yields
Plugging our upper bounds (12), (14) for , into (10) gives
where is an absolute constant. For sufficiently large, this makes all three terms in the bound (15) at most
It only remains to check whether this is a valid choice for . First, we note that with this choice, assumptions (8) and (9) follow from (12) and (14) (and increasing if necessary). Second, we required that . This may not hold. However, if it fails then we have
We can then trivialize the theorem by taking , making the claimed lower bound for smaller than . ∎
Acknowledgments
The authors would like to thank Alexandr Andoni, Piotr Indyk, Assaf Naor, and Kunal Talwar for helpful discussions.