Probabilistic LSH candidate-collision and query-failure step #
This module formalizes the probabilistic candidate-collision and query-failure step on unbucketed
point-set filtering toward the static (c, r)-approximate near-neighbour data structure of Indyk
and Motwani (after [IM98] and [HPIM12], Theorem 3.4). It is not a
bucketed sublinear approximate near-neighbour data structure: candidates filters the entire point
list P across all L tables rather than looking up hash buckets in a dictionary, and Word-RAM
hash tables, seed storage, dynamic updates, and sublinear O(n ^ ρ) query running time remain open
in #3361.
Unbucketed query model. Each of L tables is keyed by a hash g (s j) drawn independently
from a seed law ν (in the amplified step, the AND of k hashes of an (r, c r, p₁, p₂)-sensitive
family, Cslib.Probability.andHash). Cslib.DataStructure.NearNeighbor.candidates lists, table by
table, the points of P that collide with q. Cslib.DataStructure.NearNeighbor.query scans the
first T colliding candidates and returns the first one that is not far from q. Its answers are
always correct (query_eq_some), and if x₀ ∈ P is not far from q, returning none implies
either x₀ collides with q in no table or the first T colliding candidates are all far
(le_countP_candidates).
Probabilistic failure step. Let near pairs collide under g with probability at least P₁ and
far pairs with probability at most P₂. The tables are drawn independently, so x₀ misses all of
them with probability at most (1 - P₁) ^ L. The far colliding candidates number at most
L |P| P₂ on average, and Markov's inequality gives Pr[fail] ≤ (1 - P₁) ^ L + L |P| P₂ / T
(toOuterMeasure_query_eq_none_le), using only per-table marginals across far points.
Parameters. For a (p₁, p₂)-sensitive family with 0 < p₂ < p₁ ≤ 1 and n = |P|, let
ρ = log (1 / p₁) / log (1 / p₂) (Cslib.DataStructure.NearNeighbor.rho). Take
k = ⌈log n / log (1 / p₂)⌉ (numHashes), L = ⌈n ^ ρ / p₁⌉ (numTables) and T = 3 L (after
the scanning rule of [IM98]; see [AI08], Section 2.4, "Strategy 1"). For
n = |P| > 0 (obtained from a near-point witness x₀ ∈ P in the query theorems), these satisfy
n p₂ ^ k ≤ 1 and L p₁ ^ k ≥ 1, so query returns none with probability at most
e⁻¹ + 1 / 3 < 1 (toOuterMeasure_query_numTables_eq_none_le), and R independent repetitions
all fail with probability at most (e⁻¹ + 1 / 3) ^ R
(toOuterMeasure_queryRepeat_numTables_eq_none_le).
What is bounded, and what remains open (#3361). query tests far on at most
min T (L |P|) colliding candidates (length_take_candidates_le, length_candidates_le), and the
parameters satisfy k < log n / log (1 / p₂) + 1, L < n ^ ρ / p₁ + 1, and 0 ≤ ρ < 1
(numHashes_lt, numTables_lt, rho_nonneg, rho_lt_one). No declaration counts machine
operations: candidates evaluates g (s j) across all of P in every table, and replacing
full-list filtering with a Word-RAM hash dictionary, seed storage, and native O(n ^ ρ) query time
is tracked in #3361.
Main definitions #
Cslib.DataStructure.NearNeighbor.candidates: unbucketed list of points ofPcolliding withq, filtered table by table.Cslib.DataStructure.NearNeighbor.query: the first of the firstTcolliding candidates not far fromq.Cslib.DataStructure.NearNeighbor.queryRepeat: runsquerywith each supplied seed vectors rin turn and returns the first answer.Cslib.DataStructure.NearNeighbor.rho,numHashes,numTables: the exponentρand parameter formulaskandL.
Main results #
Cslib.DataStructure.NearNeighbor.query_eq_some: every returned candidate belongs toPand is not far fromq.Cslib.DataStructure.NearNeighbor.toOuterMeasure_query_eq_none_le: probabilistic query-failure step(1 - P₁) ^ L + L |P| P₂ / Ton unbucketedcandidates.Cslib.DataStructure.NearNeighbor.toOuterMeasure_query_andHash_eq_none_le: AND-table query-failure step(1 - p₁ ^ k) ^ L + L |P| p₂ ^ k / T.Cslib.DataStructure.NearNeighbor.toOuterMeasure_query_numTables_eq_none_le: explicit-parameter query-failure step≤ e⁻¹ + 1 / 3.Cslib.DataStructure.NearNeighbor.toOuterMeasure_queryRepeat_numTables_eq_none_le:Rindependent repetitions fail with probability at most(e⁻¹ + 1 / 3) ^ R.Cslib.DataStructure.NearNeighbor.length_take_candidates_le,length_candidates_le: prefix boundmin T (L |P|)on colliding candidates inspected byfar.Cslib.DataStructure.NearNeighbor.rho_lt_one,numHashes_lt,numTables_lt: algebraic boundsρ < 1and parameter upper bounds.
References #
- P. Indyk, R. Motwani, Approximate Nearest Neighbors: Towards Removing the Curse of Dimensionality
- S. Har-Peled, P. Indyk, R. Motwani, Approximate Nearest Neighbor: Towards Removing the Curse of Dimensionality, Section 3.
- A. Andoni, P. Indyk, Near-Optimal Hashing Algorithms for Approximate Nearest Neighbor in High Dimensions
Unbucketed candidate model #
Unbucketed candidate list for the probabilistic LSH step (#3361): the points of P that
collide with q under g (s 0), …, g (s (L - 1)), computed by filtering all of P table by table
(with repetitions) rather than looking up hash buckets.
Unbucketed LSH query model (#3361): scan the first T entries of candidates g s P q and
return the first point that is not far from q.
Soundness of the unbucketed query model: every returned point belongs to P and is not far
from q.
The far candidates, counted with multiplicity, are the far points of P colliding with q,
summed over the tables.
Deterministic failure decomposition on unbucketed candidates: if x ∈ P is not far from q,
collides with q in some table, and query returns none, then at least T far colliding
candidates were seen.
Each of the L tables contributes at most |P| colliding candidates.
Candidate-prefix bound: the scanned prefix (candidates g s P q).take T has length at most
min T (L |P|) (bounding far tests on colliding candidates, not total hash evaluations across
P; #3361).
Probabilistic failure step #
Expected far-candidate step on unbucketed candidates (#3361): if far pairs collide under g
with probability at most P₂, the expected number of far colliding candidates over L independent
tables is at most L |P| P₂.
Probabilistic query-failure step on unbucketed point-set filtering (after [IM98];
not a bucketed sublinear near-neighbour data structure, #3361). Let x₀ ∈ P be not far from q
and collide with q under g with probability at least P₁, and let every far point of P
collide with q with probability at most P₂. Over L independent tables with stop limit T > 0,
query returns none with probability at most (1 - P₁) ^ L + L |P| P₂ / T.
Amplified sensitive families #
Probabilistic AND-table query-failure step on unbucketed point-set filtering (after
[IM98]; not a bucketed sublinear near-neighbour data structure, #3361). When each of
L tables concatenates k hashes of a (p₁, p₂)-sensitive family with p₂ < p₁ and some
x₀ ∈ P is near q, query with stop limit T > 0 returns none with probability at most
(1 - p₁ ^ k) ^ L + L |P| p₂ ^ k / T.
Parameters #
The LSH exponent ρ = log (1 / p₁) / log (1 / p₂).
The number of hashes per table, k = ⌈log n / log (1 / p₂)⌉.
The number of tables, L = ⌈n ^ ρ / p₁⌉.
For (p₁, p₂)-sensitive parameters 0 < p₂ < p₁ ≤ 1 and n > 0, the explicit choices
k = numHashes n p₂ and L = numTables n p₁ p₂ satisfy 0 < L and
(1 - p₁ ^ k) ^ L + L * n * p₂ ^ k / (3 * L) ≤ exp (-1) + 1 / 3.
Probabilistic query-failure step with explicit parameters on unbucketed point-set filtering
(after [IM98] and [HPIM12], Theorem 3.4; not a bucketed sublinear
(c, r)-near-neighbour data structure, #3361). Let hash be (p₁, p₂)-sensitive with
0 < p₂ < p₁ ≤ 1, n = |P|, k = numHashes n p₂, L = numTables n p₁ p₂, and stop limit 3 L
(as in [AI08], Section 2.4). If some x₀ ∈ P is near q, query returns none with
probability at most e⁻¹ + 1 / 3.
Repetition #
Run the unbucketed query model with each supplied seed vector s r in turn and return the
first answer (#3361); independence comes from the product law in the failure theorems.
Every answer of queryRepeat belongs to P and is not far from q.
R independent instances of query all return none with the R-th power of the failure
probability of one instance (#3361).
Probabilistic repetition step on unbucketed point-set filtering (#3361): with the parameters of
toOuterMeasure_query_numTables_eq_none_le, R independent instances of query all return none
with probability at most (e⁻¹ + 1 / 3) ^ R.