On Symmetric and Asymmetric LSHs for Inner Product Search

Behnam Neyshabur, Nathan Srebro

Introduction

MIPS problems of the form (1) arise, e.g. when using matrix-factorization based recommendation systems (Koren et al., 2009; Srebro et al., 2005; Cremonesi et al., 2010), in multi-class prediction (Dean et al., 2013; Jain et al., 2009) and structural SVM (Joachims, 2006; Joachims et al., 2009) problems and in vision problems when scoring filters based on their activations (Dean et al., 2013) (see Shrivastava and Li, 2014a, for more about MIPS). In order to efficiently find approximate MIPS solutions, Shrivastava and Li (2014a) suggest constructing a Locality Sensitive Hash (LSH) for inner product “similarity”.

Several tree-based methods have also been proposed for inner product search (Ram and Gray, 2012; Koenigstein et al., 2012; Curtin et al., 2013). Shrivastava and Li (2014a) argue that tree-based methods, such as cone trees, are impractical in high dimensions while the performance of LSH-based methods is in a way independent of dimension of the data. Although the exact regimes under which LSH-based methods are superior to tree-based methods and vice versa are not fully established yet, the goal of this paper is to analyze different LSH methods and compare them with each other, rather than comparing to tree-based methods, so as to understand which LSH to use and why, in those regimes where tree-based methods are not practical.

As mentioned above, our study also yields an LSH for MIPS, which we refer to as simple-lsh, which is not only symmetric but also parameter-free and enjoys significantly better theoretical and empirical compared to l2-alsh(sl) proposed by Shrivastava and Li (2014a). In Appendix A we show that all of our theoretical observations about l2-alsh(sl) apply also to the alternative hash sign-lsh(sl) put forth by Shrivastava and Li (2014b).

The transformation at the root of simple-lsh was also recently proposed by Bachrach et al. (2014), who used it in a PCA-Tree data structure for speeding up the Xbox recommender system. Here, we study the transformation as part of an LSH scheme, investigate its theoretical properties, and compare it to ls-alsh(sl).

Locality Sensitive Hashing

A hash of a set Z\mathcal{Z} of objects is a random mapping from Z\mathcal{Z} to some alphabet Γ\Gamma, i.e. a distribution over functions h:Z→Γh:\mathcal{Z}\rightarrow\Gamma. The hash is sometimes thought of as a “family” of functions, where the distribution over the family is implicit.

A hash is said to be a (S,cS,p1,p2)(S,cS,p_{1},p_{2})-LSH for a similarity function sim over the pair of spaces X,Y⊆Z\mathcal{X},\mathcal{Y}\subseteq\mathcal{Z} if for any x∈Xx\in\mathcal{X} and y∈Yy\in\mathcal{Y}:

When X=Y\mathcal{X}=\mathcal{Y}, we say simply “over the space X\mathcal{X}”.

Here S>0S>0 is a threshold of interest, and for efficient approximate nearest neighbor search, we need p1>p2p_{1}>p_{2} and c<1c<1. In particular, given an (S,cS,p1,p2)(S,cS,p1,p2)-LSH, a data structure for finding SS-similar objects for query points when cScS-similar objects exist in the database can be constructed in time O(nρlog⁡n)O(n^{\rho}\log n) and space O(n1+ρ)O(n^{1+\rho}) where ρ=log⁡p1log⁡p2\rho=\frac{\log p_{1}}{\log p_{2}}. This quantity ρ\rho is therefore of particular interest, as we are interested in an LSH with minimum possible ρ\rho, and we refer to it as the hashing quality.

An asymmetric hash is said to be an (S,cS,p1,p2)(S,cS,p_{1},p_{2})-ALSH for a similarity function sim over X,Y\mathcal{X},\mathcal{Y} if for any x∈Xx\in\mathcal{X} and y∈Yy\in\mathcal{Y}:

Referring to either of the above definitions, we also say that a hash is an (S,cS)(S,cS)-LSH (or ALSH) if there exists p2>p1p_{2}>p_{1} such that it is an (S,cS,p1,p2)(S,cS,p_{1},p_{2})-LSH (or ALSH). And we say it is a universal LSH (or ALSH) if for every S>0,0<c<1S>0,0<c<1 it is an (S,cS)(S,cS)-LSH (or ALSH).

For any NN (to be set later), define the N×NN\times N matrix ZZ as follows:

where ⊙\odot denotes element-wise (Hadamard) product. Now, for a sign matrix ZZ, the margin complexity of ZZ is defined as mc(Z)=inf⁡Z⊙X≥1∥X∥max⁡mc(Z)=\inf_{Z\odot X\geq 1}\left\lVert X\right\rVert_{\max} (see Srebro and Shraibman, 2005, and also for the definition of the max-norm ∥X∥max⁡\left\lVert X\right\rVert_{\max}), and we know that the margin complexity of an N×NN\times N triangular matrix is bounded by mc(Z)=Ω(log⁡N)mc(Z)=\Omega(\log N) (Forster et al., 2003), implying

Furthermore, any collision probability matrix has max-norm ∥P∥max⁡≤1\left\lVert P\right\rVert_{\max}\leq 1 (Neyshabur et al., 2014), and shifting the matrix by 0<θ<10<\theta<1 changes the max-norm by at most θ\theta, implying ∥P−θ∥max⁡≤2\left\lVert P-\theta\right\rVert_{\max}\leq 2, which combined with (5) implies ϵ=O(1/log⁡N)\epsilon=O(1/\log N). For any ϵ=p1−p2>0\epsilon=p_{1}-p_{2}>0, selecting a large enough NN we get a contradiction. ∎

For completeness, we also include in Appendix B a full definition of the max-norm and margin complexity, as well as the bounds on the max-norm and margin complexity used in the proof above.

Maximum Inner Product Search

The query qq is normalized: Since given a vector qq, the norm ∥q∥\left\lVert q\right\rVert does not affect the argmax in (1), we can assume ∥q∥=1\left\lVert q\right\rVert=1 always.

But first, we review l2-alsh(sl) and note that it is not universal—it depends on three parameters and no setting of the parameters works for all thresholds SS. We also compare our simple-lsh to l2-alsh(sl) (and to the recently suggested sign-alsh(sl)) both in terms of the hashing quality ρ\rho and empirically of movie recommendation data sets.

For an integer parameter mm, and real valued parameters 0<U<10<U<1 and r>0r>0, consider the following pair of mappings:

combined with the standard L2L_{2} hash function

Shrivastava and Li (2014a) establishShrivastava and Li (2014a) have the scaling by UU as a separate step, and state their hash as an (S0,cS0)(S_{0},cS_{0})-ALSH over {∥x∥≤U},{∥q∥=1}\{\left\lVert x\right\rVert\leq U\},\{\left\lVert q\right\rVert=1\}, where the threshold S0=USS_{0}=US is also scaled by UU. This is equivalent to the presentation here which integrates the pre-scaling step, which also scales the threshold, into the hash. that for any 0<c<10<c<1 and 0<S<10<S<1, there exists 0<U<10<U<1, r>0r>0, m≥1m\geq 1, such that l2-alsh(sl) is an (S,cS)(S,cS)-ALSH over X∙,Y∘\mathcal{X}_{\bullet},\mathcal{Y}_{\circ}. They furthermore calculate the hashing quality ρ\rho as a function of m,Um,U and rr, and numerically find the optimal ρ\rho over a grid of possible values for m,Um,U and rr, for each choice of S,cS,c.

Before moving on to presenting a symmetric hash for the problem, we note that l2-alsh(sl) is not universal (as defined at the end of Section 2). That is, not only might the optimal m,Um,U and rr depend on S,cS,c, but in fact there is no choice of the parameters mm and UU that yields an ALSH for all S,cS,c, or even for all ratios cc for some specific threshold SS or for all thresholds SS for some specific ratio cc. This is unfortunate, since in MIPS problems, the relevant threshold SS is the maximal inner product max⁡x∈Sq⊤x\max_{x\in\mathcal{S}}q^{\top}x (or the threshold inner product if we are interested in the “top-kk” hits), which typically varies with the query. It is therefore desirable to have a single hash that works for all thresholds.

l2-alsh(sl) is not an (S,cS)(S,cS)-ALSH for inner product similarity over X∙={x|∥x∥≤1}\mathcal{X}_{\bullet}=\left\{x\middle|\left\lVert x\right\rVert\leq 1\right\} and Y∘={q|∥q∥=1}\mathcal{Y}_{\circ}=\left\{q\middle|\left\lVert q\right\rVert=1\right\}.

Assume for contradiction that it is an (S,cS)(S,cS)-ALSH. For any query point q∈Y∘q\in\mathcal{Y}_{\circ}, let x∈X∙x\in\mathcal{X}_{\bullet} be a vector s.t. q⊤x=Sq^{\top}x=S and ∥x∥2=1\|x\|_{2}=1 and let y=cSqy=cSq, so that q⊤y=cSq^{\top}y=cS. We have that:

where Fr(δ)\mathcal{F}_{r}(\delta) is a monotonically decreasing function of δ\delta (Datar et al., 2004). To get a contradiction it is therefor enough to show that ∥P(y)−Q(q)∥2≤∥P(x)−Q(q)∥2\left\lVert P(y)-Q(q)\right\rVert^{2}\leq\left\lVert P(x)-Q(q)\right\rVert^{2}. We have:

For any U,mU,m and rr, l2-alsh(sl) is not a universal ALSH for inner product similarity over X∙={x|∥x∥≤1}\mathcal{X}_{\bullet}=\left\{x\middle|\left\lVert x\right\rVert\leq 1\right\} and Y∘={q|∥q∥=1}\mathcal{Y}_{\circ}=\left\{q\middle|\left\lVert q\right\rVert=1\right\}. Furthermore, for any c<1c<1, and any choice of U,m,rU,m,r there exists 0<S<10<S<1 for which l2-alsh(sl) is not an (S,cS)(S,cS)-ALSH over X∙,Y∘\mathcal{X}_{\bullet},\mathcal{Y}_{\circ}, and for any S<1S<1 and any choice of U,m,rU,m,r there exists 0<c<10<c<1 for which l2-alsh(sl) is not an (S,cS)(S,cS)-ALSH over X∙,Y∘\mathcal{X}_{\bullet},\mathcal{Y}_{\circ}.

In Appendix A, we show a similar non-universality result also for sign-alsh(sl).

2 SIMPLE-LSH

We propose here a simpler, parameter-free, symmetric LSH, which we call simple-lsh.

For any x∈X∙x\in\mathcal{X}_{\bullet} we have ∥P(x)∥=1\left\lVert P(x)\right\rVert=1, and for any q∈Y∘q\in\mathcal{Y}_{\circ}, since ∥q∥=1\left\lVert q\right\rVert=1, we have:

Now, to define the hash simple-lsh, take a spherical random vector a∼N(0,I)a\sim\mathcal{N}(0,I) and consider the following random mapping into the binary alphabet Γ={±1}\Gamma=\{\pm 1\}:

simple-lsh given in (11) is a universal LSH over X∙,Y∘\mathcal{X}_{\bullet},\mathcal{Y}_{\circ}. That is, for every 0<S<10<S<1 and 0<c<10<c<1, it is an (S,cS)(S,cS)-LSH over X∙,Y∘\mathcal{X}_{\bullet},\mathcal{Y}_{\circ}. Furthermore, it has hashing quality:

For any x∈X∙x\in\mathcal{X}_{\bullet} and q∈Y∘q\in\mathcal{Y}_{\circ} we have (Goemans and Williamson, 1995):

Since for any 0≤x≤10\leq x\leq 1, 1−cos⁡−1(x)π1-\frac{\cos^{-1}(x)}{\pi} is a monotonically increasing function, this gives us an LSH. ∎

3 Theoretical Comparison

Earlier we discussed that an LSH with the smallest possible hashing quality ρ\rho is desirable. In this Section, we compare the best achievable hashing quality and show that simple-lsh allows for much better hashing quality compared to l2-alsh(sl), as well as compared to the improved hash sign-lsh(sl).

For l2-alsh(sl) and sign-alsh(sl), for each desired threshold SS and ratio cc, one can optimize over the parameters mm and UU, and for l2-alsh(sl) also rr, to find the hash with the best ρ\rho. This is a non-convex optimization problem and Shrivastava and Li (2014a) suggest using grid search to find a bound on the optimal ρ\rho. We followed the procedure, and grid, as suggested by Shrivastava and Li (2014a)We actually used a slightly tighter bound—a careful analysis shows the denominator in equation 19 of Shrivastava and Li (2014a) can be log⁡Fr(1+m/2−2cSU+(cSU)2m+1))\log F_{r}(\sqrt{1+m/2-2cSU+(cSU)^{2^{m+1}})}). For simple-lsh no parameters need to be tuned, and for each S,cS,c the hashing quality is given by Theorem 5.3. In Figure 1 we compare the optimal hashing quality ρ\rho for the three methods, for different values of SS and cc. It is clear that the simple-lsh dominates the other methods.

4 Empirical Evaluation

We also compared the hash functions empirically, following the exact same protocol as Shrivastava and Li (2014a), using two collaborative filtering datasets, Netflix and Movielens 10M.

For a given user-item matrix ZZ, we followed the pureSVD procedure suggested by Cremonesi et al. (2010): we first subtracted the overall average rating from each individual rating and created the matrix ZZ with these average-subtracted ratings for observed entries and zeros for unobserved entries. We then take a rank-ff approximation (top ff singular components, f=150f=150 for Movielens and f=300f=300 for Netflix) Z≈WΣR⊤=YZ\approx W\Sigma R^{\top}=Y and define L=WΣL=W\Sigma so that Y=LR⊤Y=LR^{\top}. We can think of each row of LL as the vector presentation of a user and each row of RR as the presentation for an item.

The database SS consists of all rows RjR_{j} of RR (corresponding to movies) and we use each row LiL_{i} of LL (corresponding to users) as a query. That is, for each user ii we would like to find the top TT movies, i.e. the TT movies with highest ⟨Li,Rj⟩\langle L_{i},R_{j}\rangle, for different values of TT.

To do so, for each hash family, we generate hash codes of length KK, for varying lengths KK, for all movies and a random selection of 60000 users (queries). For each user, we sort movies in ascending order of hamming distance between the user hash and movie hash, breaking up ties randomly. For each of several values of TT and KK we calculate precision-recall curves for recalling the top TT movies, averaging the precision-recall values over the 60000 randomly selected users.

In Figures 2 and 3, we plot precision-recall curves of retrieving top TT items by hash code of length KK for Netflix and Movielens datasets where T∈{1,5,10}T\in\{1,5,10\} and K∈{64,128,256,512}K\in\{64,128,256,512\}. For l2-alsh(sl) we used m=3,U=0.83,r=2.5m=3,U=0.83,r=2.5, suggested by the authors and used in their empirical evaluation. For sign-alsh(sl) we used two different settings of the parameters suggested by Shrivastava and Li (2014b): m=2,U=0.75m=2,U=0.75 and m=3,U=0.85m=3,U=0.85. simple-lsh does not require any parameters.

As can be seen in the Figures, simple-lsh shows a dramatic empirical improvement over l2-alsh(sl). Following the presentation of simple-lsh and the comparison with l2-alsh(sl), Shrivastava and Li (2014b) suggested the modified hash sign-alsh(sl), which is based on random projections, as is simple-lsh, but with an asymmetric transform similar to that in l2-alsh(sl). Perhaps not surprising, sign-alsh(sl) does indeed perform almost the same as simple-lsh (simple-lsh has only a slight advantage on Movielens), however: (1) simple-lsh is simpler, and uses a single symmetric lower-dimensional transformation P(x)P(x); (2) simpler-lsh is universal and parameter free, while sign-alsh(sl) requires tuning two parameters (its authors suggest two different parameter settings for use). Therefor, we see no reason to prefer sign-alsh(sl) over the simpler symmetric option.

Unnormalized Queries

In the previous Section, we exploited asymmetry in the MIPS problem formulation, and showed that with such asymmetry, there is no need for the hash itself to be asymmetric. In this Section, we consider LSH for inner product similarity in a more symmetric setting, where we assume no normalization and only boundedness. That is, we ask whether there is an LSH or ALSH for inner product similarity over X∙=Y∙={x  |  ∥x∥≤1}\mathcal{X}_{\bullet}=\mathcal{Y}_{\bullet}=\left\{x\;\middle|\;\left\lVert x\right\rVert\leq 1\right\}. Beyond a theoretical interest in the need for asymmetry in this fully symmetric setting, the setting can also be useful if we are interested in using sets X\mathcal{X} and Y\mathcal{Y} interchangeably as query and data sets. In user-item setting for example, one might be also interested in retrieving the top users interested in a given item without the need to create a separate hash for this task.

We first observe that there is no symmetric LSH for this setting. We therefore consider asymmetric hashes. Unfortunately, we show that neither l2-alsh(sl) (nor sign-alsh(sl)) are ALSH over X∙\mathcal{X}_{\bullet}. Instead, we propose a parameter-free asymmetric extension of simple-lsh, which we call simple-alsh, and show that it is a universal ALSH for inner product similarity over X∙\mathcal{X}_{\bullet}.

To summarize the situation, if we consider the problem asymmetrically, as in the previous Section, there is no need for the hash to be asymmetric, and we can use a single hash function. But if we insist on considering the problem symmetrically, we do indeed have to use an asymmetric hash.

We first show we do not have a symmetric LSH:

For any 0<S≤10<S\leq 1 and 0<c<10<c<1 there is no (S,cS)(S,cS)-LSH (by Definition 1) for inner product similarity over X∙=Y∙={x  |  ∥x∥≤1}\mathcal{X}_{\bullet}=\mathcal{Y}_{\bullet}=\left\{x\;\middle|\;\left\lVert x\right\rVert\leq 1\right\}.

2 L2-ALSH(SL)

We might hope l2-alsh(sl) is a valid ALSH here. Unfortunately, whenever S<(c+1)/2S<(c+1)/2, and so in particular for all S<1/2S<1/2, it is not:

For any 0<c<10<c<1 and any 0<S<(c+1)/20<S<(c+1)/2, there are no U,mU,m and rr such that l2-alsh(sl) is an (S,cS)(S,cS)-ALSH for inner product similarity over X∙=Y∙={x  |  ∥x∥≤1}\mathcal{X}_{\bullet}=\mathcal{Y}_{\bullet}=\left\{x\;\middle|\;\left\lVert x\right\rVert\leq 1\right\}.

Let q1q_{1} and x1x_{1} be unit vectors such that q1⊤x1=Sq_{1}^{\top}x_{1}=S. Let x2x_{2} be a unit vector and define q2=cSx2q_{2}=cSx_{2}. For any UU and mm:

where the inequality follows from S<(c+1)/2S<(c+1)/2. Now, the same arguments as in Lemma 1 using monotonicity of collision probabilities in ∥P(x)−Q(q)∥\left\lVert P(x)-Q(q)\right\rVert establish ls-alsh(sl) is not an (S,cS)(S,cS)-ALSH. ∎

In Appendix A, we show a stronger negative result for sign-alsh(sl): for any S>0S>0 and 0<c<10<c<1, there are no U,mU,m such that sign-alsh(sl) is an (S,cS)−ALSH(S,cS)-ALSH.

3 SIMPLE-ALSH

Fortunately, we can define a variant of simple-lsh, which we refer to as simple-alsh, for this more general case where queries are not normalized. We use the pair of transformations:

and the random mappings f(x)=ha(P(x))f(x)=h_{a}(P(x)), g(y)=ha(Q(x))g(y)=h_{a}(Q(x)), where ha(z)h_{a}(z) is as in (11). It is clear that by these definitions, we always have that for all x,y∈X∙x,y\in\mathcal{X}_{\bullet}, P(x)⊤Q(y)=x⊤yP(x)^{\top}Q(y)=x^{\top}y and ∥P(x)∥=∥Q(y)∥=1\left\lVert P(x)\right\rVert=\left\lVert Q(y)\right\rVert=1.

simple-alsh is a universal ALSH over X∙=Y∙={x  |  ∥x∥≤1}\mathcal{X}_{\bullet}=\mathcal{Y}_{\bullet}=\left\{x\;\middle|\;\left\lVert x\right\rVert\leq 1\right\}. That is, for every 0<S,c<10<S,c<1, it is an (S,cS)(S,cS)-ALSH over X∙,Y∙\mathcal{X}_{\bullet},\mathcal{Y}_{\bullet}.

Shrivastava and Li (2015) also showed how a modification of simple-alsh can be used for searching similarity measures such as set containment and weighted Jaccard similarity.

Conclusion

We provide a complete characterization of when symmetric and asymmetric LSH are possible for inner product similarity: {itemize*}

For the MIPS setting, with normalized queries ∥q∥=1\left\lVert q\right\rVert=1 and bounded database vectors ∥x∥≤1\left\lVert x\right\rVert\leq 1, a universal symmetric LSH is possible.

It is important to emphasize that even though in the MIPS setting an asymmetric hash, as we define here, is not needed, an asymmetric view of the problem is required. In particular, to use a symmetric hash, one must normalize the queries but not the database vectors, which can legitimately be viewed as an asymmetric operation which is part of the hash (though then the hash would not be, strictly speaking, an ALSH). In this regard Shrivastava and Li (2014a) do indeed successfully identify the need for an asymmetric view of MIPS, and provide the first practical ALSH for the problem.

This research was partially funded by NSF award IIS-1302662.

References

Appendix A Another variant

To benefit from the empirical advantages of random projection hashing, Shrivastava and Li (2014b) also proposed a modified asymmetric LSH, which we refer to here as sign-alsh(sl). sign-alsh(sl) uses two different mappings P(x)P(x), Q(q)Q(q), similar to those of l2-alsh(sl), but then uses a random projection hash ha(x)h_{a}(x), as is the one used by simple-lsh, instead of the quantized hash used in l2-alsh(sl). In this appendix we show that our theoretical observations about l2-alsh(sl) are also valid for sign-alsh(sl).

where mm and UU are parameters, as in l2-alsh(sl). sign-alsh(ls) is then given by f(x)=ha(P(x))f(x)=h_{a}(P(x)), g(y)=ha(Q(x))g(y)=h_{a}(Q(x)), where hah_{a} is the random projection hash given in (11). sign-alsh(ls) therefor depends on two parameters, and uses a binary alphabet Γ={±1}\Gamma=\{\pm 1\}.

In this section, we show that, like l2-alsh(ls), sign-alsh(ls) is not a universal ALSH over X∙,Y∘\mathcal{X}_{\bullet},\mathcal{Y}_{\circ}, and moreover for any S>0S>0 and 0<c<10<c<1 it is not an (S,cS)(S,cS)-ALSH over X∙=Y∙\mathcal{X}_{\bullet}=\mathcal{Y}_{\bullet}:

sign-alsh(sl) is not an (S,cS)(S,cS)-ALSH for inner product similarity over X∙={x|∥x∥≤1}\mathcal{X}_{\bullet}=\left\{x\middle|\left\lVert x\right\rVert\leq 1\right\} and Y∘={q|∥q∥=1}\mathcal{Y}_{\circ}=\left\{q\middle|\left\lVert q\right\rVert=1\right\}.

and sign-alsh(sl) is an (S,cS)(S,cS)-ALSH. For any query point q∈Y∘q\in\mathcal{Y}_{\circ}, let x∈X∙x\in\mathcal{X}_{\bullet} be a vector s.t. q⊤x=Sq^{\top}x=S and ∥x∥2=1\|x\|_{2}=1 and let y=cSqy=cSq, so that q⊤y=cSq^{\top}y=cS. We have that:

The monotonicity of 1−cos⁡−1(x)π1-\frac{\cos^{-1}(x)}{\pi} establishes a contradiction. To get the other bound on cc, let αm=(m/2)2m+1−22m+1\alpha_{m}=\sqrt[2^{m+1}]{\frac{(m/2)}{2^{m+1}-2}} and assume for contradiction that:

and sign-alsh(sl) is an (S,cS)(S,cS)-ALSH. For any query point q∈Y∘q\in\mathcal{Y}_{\circ}, let x∈X∙x\in\mathcal{X}_{\bullet} be a vector s.t. q⊤x=Sq^{\top}x=S and ∥x∥2=1\|x\|_{2}=1 and let y=(αm/U)qy=(\alpha_{m}/U)q. By the monotonicity of 1−cos⁡−1(x)π1-\frac{\cos^{-1}(x)}{\pi}, to get a contradiction is enough to show that

For any U,mU,m and rr, sign-alsh(sl) is not a universal ALSH for inner product similarity over X∙={x|∥x∥≤1}\mathcal{X}_{\bullet}=\left\{x\middle|\left\lVert x\right\rVert\leq 1\right\} and Y∘={q|∥q∥=1}\mathcal{Y}_{\circ}=\left\{q\middle|\left\lVert q\right\rVert=1\right\}. Furthermore, for any c<1c<1, and any choice of U,m,rU,m,r there exists 0<S<10<S<1 for which sign-alsh(sl) is not an (S,cS)(S,cS)-ALSH over X∙,Y∘\mathcal{X}_{\bullet},\mathcal{Y}_{\circ}, and for any S<1S<1 and any choice of U,m,rU,m,r there exists 0<c<10<c<1 for which sign-alsh(sl) is not an (S,cS)(S,cS)-ALSH over X∙,Y∘\mathcal{X}_{\bullet},\mathcal{Y}_{\circ}.

For any S>0S>0 and 0<c<10<c<1 there are no UU and mm such that sign-alsh(sl) is an (S,cS)(S,cS)-ALSH for inner product similarity over X∙=Y∙={x  |  ∥x∥≤1}\mathcal{X}_{\bullet}=\mathcal{Y}_{\bullet}=\left\{x\;\middle|\;\left\lVert x\right\rVert\leq 1\right\}.

Similar to the proof of Theorem 5.2, for any S>0S>0 and 0<c<10<c<1, let q1q_{1} and x1x_{1} be unit vectors such that q1⊤x1=Sq_{1}^{\top}x_{1}=S. Let x2x_{2} be a unit vector and define q2=cSx2q_{2}=cSx_{2}. For any UU and mm:

Now, the same arguments as in Lemma 1 using monotonicity of collision probabilities in ∥P(x)−Q(q)∥\left\lVert P(x)-Q(q)\right\rVert establish sign-alsh(sl) is not an (S,cS)(S,cS)-ALSH. ∎

Appendix B Max-norm and margin complexity

For any two sets of objects and hashes over them, if PP is the collision probability matrix, then ∥P∥max⁡≤1\left\lVert P\right\rVert_{\max}\leq 1.

For each ff and gg, define the following biclustering matrix:

For any function f:Z→Γf:\mathcal{Z}\rightarrow\Gamma, let Rf∈{0,1}n×∣Γ∣R_{f}\in\{0,1\}^{n\times|\Gamma|} be the indicator of the values of function ff:

Margin complexity

For any sign matrix ZZ, the margin complexity of ZZ is defined as:

Let Z∈{±1}N×NZ\in\{\pm 1\}^{N\times N} be a sign matrix with +1 on and above the diagonal and -1 below it. Forster et al. (2003) prove that the margin complexity of matrix ZZ is Ω(log⁡N)\Omega(\log N).