Introduction
Similarity search is a fundamental operation in modern computer science, underpinning technologies ranging from recommendation engines to facial recognition systems. The core task, known as the $r$-near neighbor ($r$-NN) problem, involves identifying any point $p$ within a specified distance $r$ of a query point $q$. However, standard algorithms for this task are inherently biased. They tend to favor the "closest" items, often ignoring other valid candidates that still meet the search criteria. This paper introduces a framework for Fair Near Neighbor Search, ensuring that every item within the target radius has an equal probability of being retrieved—a concept the authors describe as "equal opportunity" for data.
The Bias in Locality Sensitive Hashing
In high-dimensional spaces, the standard approach to similarity search is Locality Sensitive Hashing (LSH). LSH functions hash points such that similar items are more likely to collide in the same bucket. While efficient, LSH possesses a hidden structural bias: the probability of collision is a function of distance. Consequently, the closer a point is to the query, the more likely it is to be returned.
In a recommendation system, this bias means that the most similar items are shown repeatedly, while "sufficiently similar" items are systematically excluded. In sensitive applications like hiring or credit scoring, this "unexpected advantage" for certain data points can lead to systemic algorithmic bias. To address this, the authors formalize the $r$-NNS (Sampling) problem: returning a point uniformly at random from the set of all valid neighbors.
Algorithmic Approaches to Fairness
The authors propose three primary methods to achieve uniform sampling without sacrificing the performance benefits of high-dimensional indexing:
1. The "Rank" Trick (Black-Box LSH)
This method utilizes a random permutation approach. Every point in the dataset is assigned a random "rank" independent of its position in space. The data structure then returns the point within distance $r$ that possesses the lowest rank. Because the ranking is independent of distance, every point in the $r$-neighborhood has an equal mathematical chance of being the minimum, thereby ensuring uniform selection probability.
2. Independent Range Sampling (NNIS)
To ensure that repeated queries for the same point do not simply return the same result, the authors developed a more robust version using count-distinct sketches. This allows the algorithm to estimate the size of the neighborhood and sample segments of the data independently, satisfying the rigorous requirements of independent range sampling.
3. Nearly-Linear Space Filters
For inner-product similarity—a common metric in machine learning—the authors introduce a space-efficient method using locality-sensitive filters. This approach avoids the significant memory overhead typically associated with complex LSH schemes by storing each data point only a minimal number of times.
Experimental Evaluation
The proposed algorithms were evaluated using two real-world recommendation datasets:
- MovieLens: Comprising 2,112 users and 65,536 movies.
- Last.FM: Comprising 1,892 users and 18,739 artists.
Data was converted into set representations to measure Jaccard similarity (the overlap between sets of movies or artists liked by users). The results demonstrated that while standard LSH is heavily skewed toward high-similarity items, the "Fair LSH" approach produces a perfectly uniform distribution across the entire $r$-neighborhood.
Key Insights and the "Fairness Tax"
The research highlights several critical aspects of algorithmic fairness:
- Indexing as a Source of Bias: Fairness issues are not limited to decision-making layers; they can be baked into the underlying data structures used for retrieval.
- The Fairness Tax: Achieving uniformity incurs a computational cost. The query time is influenced by the ratio of points in the "approximate" neighborhood ($cr$) to those in the true neighborhood ($r$). If many points reside just outside the fair radius, the algorithm must perform additional work to filter them out.
- The Fragility of Approximation: The authors demonstrate that "approximate neighborhood" approaches—which allow points slightly further than $r$ to be returned—can lead to massive disparities. In some instances, a specific point was 50 times more likely to be returned than another valid neighbor.
Conclusion and Future Work
This work establishes that fair, independent sampling is achievable in high-dimensional similarity search with query times that match standard LSH performance up to polylogarithmic factors. While the current model relies on a fixed radius $r$, future research may explore "weighted fairness," where closer points are preferred in a controlled, non-biased manner. Additionally, integrating these fair structures with privacy-preserving search techniques remains a promising avenue for ensuring both equity and security in data retrieval.
Summary updated