[Paper Review] Near Neighbor: Who is the Fairest of Them All?
This paper proposes a fair variant of the near neighbor problem where any point within distance $ r $ of a query is selected uniformly at random, avoiding bias toward closer points. Using a modified Locality-Sensitive Hashing (LSH) approach with degree approximation, the method achieves near-uniform sampling with query time proportional to $ O(\mathrm{dns}(q,r) \cdot \mathcal{Q}(n,c)) $, outperforming standard sampling methods by up to 10x in statistical distance to uniformity.
$ ewcommand{\ball}{\mathbb{B}} ewcommand{\dsQ}{\mathcal{Q}} ewcommand{\dsS}{\mathcal{S}}$In this work we study a fair variant of the near neighbor problem. Namely, given a set of $n$ points $P$ and a parameter $r$, the goal is to preprocess the points, such that given a query point $q$, any point in the $r$-neighborhood of the query, i.e., $\ball(q,r)$, have the same probability of being reported as the near neighbor. We show that LSH based algorithms can be made fair, without a significant loss in efficiency. Specifically, we show an algorithm that reports a point in the $r$-neighborhood of a query $q$ with almost uniform probability. The query time is proportional to $O\bigl( \mathrm{dns}(q.r) \dsQ(n,c) \bigr)$, and its space is $O(\dsS(n,c))$, where $\dsQ(n,c)$ and $\dsS(n,c)$ are the query time and space of an LSH algorithm for $c$-approximate near neighbor, and $\mathrm{dns}(q,r)$ is a function of the local density around $q$. Our approach works more generally for sampling uniformly from a sub-collection of sets of a given collection and can be used in a few other applications. Finally, we run experiments to show performance of our approach on real data.
Motivation & Objective
- To address selection bias in data structures that favor closer points in near neighbor queries.
- To design a data structure that returns a uniformly random point from the $ r $-neighborhood of a query, without explicitly enumerating all neighbors.
- To maintain efficiency comparable to standard LSH while ensuring individual fairness in query responses.
- To evaluate the method's performance on real datasets using statistical distance to uniformity as a fairness metric.
Proposed method
- Adapt LSH to sample uniformly from the $ r $-neighborhood by estimating the degree (number of hash collisions) of each point in the query's bucket.
- Use a degree approximation technique that samples from buckets and estimates the inverse of the collision probability to weight selection.
- Introduce a rejection sampling strategy that ensures uniformity by adjusting selection probabilities based on estimated degrees.
- Leverage multiple LSH functions to increase collision probability and improve sampling accuracy.
- Preprocess exact degrees for the optimal baseline to enable fair comparison across repeated queries.
- Measure performance via total variation distance between empirical and uniform distributions over neighbors.
Experimental results
Research questions
- RQ1Can LSH-based data structures be modified to ensure uniform random sampling from the $ r $-neighborhood of a query?
- RQ2What is the trade-off between sampling accuracy and query efficiency in fair near neighbor search?
- RQ3How does the proposed degree approximation method compare to exact and baseline sampling methods in terms of statistical distance to uniformity?
- RQ4Does the method scale well with increasing neighborhood size and varying LSH parameters?
Key findings
- For MNIST, the proposed method achieved a statistical distance of 2.4 to uniformity, outperforming standard methods that were 6.6–10x worse.
- On SIFT, the method had a distance of 1.4 to uniformity, compared to 6.1–9.7 for other methods.
- For GloVe, the method was 2.7x worse than optimal, while alternatives were 6.5–13.1x worse.
- Increasing query repetitions improved accuracy: for MNIST, 4x more queries reduced distance to 1.05 from 2.4.
- With $ L=300 $, the method was 4.3x faster than the optimal algorithm, though still slower than two baseline methods.
- The method maintained strong performance across varying LSH parameters, with degree ranges increasing from [1,33] to [1,99] on MNIST.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.