acceptodds
Published as a conference paper at NeurIPS 2026

Fast Diverse Nearest Neighbor Search

Justin Chen, Soham Nagawanshi, Shenghao Xie, Haike Xu, Alan Zhou, Samson Zhou

Abstract

In the -diverse nearest neighbor search problem, the input is a dataset in which each point is assigned a color, and given a query , the goal is to retrieve approximate nearest neighbors with distinct colors. This color diversity metric is highly essential for information retrieval tasks where results are required to have different categories, e.g., recommending products from different sellers. Previous state-of-the-art solution by Anand et al. [ICML 2025] constructs a diversity-aware graph to meet this requirement. However, they suffer from an multiplicative query time overhead, creating a computational bottleneck when is large. To break this barrier, we propose a novel color bucketing framework that selects a subset of colors in each bucket and instantiates an independent approximate nearest neighbor search algorithm on the corresponding points. Inspired by group testing, we provide a randomized color sampling scheme that achieves an overhead in Euclidean spaces and an overhead in general metric spaces, where is the approximation factor, reducing a factor of . In addition, the space usage to store the data structure matches or improves upon prior methods. Empirical results on semi-synthetic and real-world datasets demonstrate that our approach achieves significantly faster search times and higher recall compared to state-of-the-art diversity search baselines. Furthermore, we introduce a dataset-oblivious deterministic bucketing scheme using expander graphs for a relaxed diverse search problem that only requires colors. Here, dataset-oblivious means that the color bucket construction does not depend on the spatial configuration of the dataset. We then establish an lower bound on the number of buckets for any dataset-oblivious deterministic bucketing scheme that gives an exact -diverse solution. We subsequently circumvent this by a dataset-aware adaptive segment tree bucketing scheme with an overhead of only , where is the number of colors. As an extension of our results, we solve the problem with general diversity metric, where the goal is to maximize the minimum pair-wise distance of the solutions, and improve the query time.

Keywords:
Atlanta, Main Track

Reviews

Among:
Shape:
123456this paper, Bottom 17%
Figure 1. Mean review rating of the reviewed papers at NeurIPS 2026. This paper averages 4.00 over 3 reviews, above 17% of the others.
Reviewer_UZDqOpenReview ↗
Rating
3
Clarity
3
Confidence
4
Originality
3
Quality
2
Significance
2
Read review
Summary

The paper tackles the k-diverse c-ANN problem: every data point carries a color, and for a query the data structure must return k near-optimal points whose colors are all distinct. The prior state of the art (Anand et al., ICML'25) bakes diversity into a navigation graph and pays an O(k2)O(k^2) multiplicative overhead at query time. The authors' main move is a "color bucketing" framework borrowed from non-adaptive group testing: build L=O(klogk)L = O(k log k) buckets, sample each color into a bucket independently with probability 1/k, and run an off-the-shelf c-ANN oracle on each bucket's sub-dataset. A coupon-collector argument shows that O(klogk)O(k log k) buckets recover all k target colors with high probability. The randomized overheads come out to O~(k1−1/c2)Õ(k^{1−1/c^2}) in Euclidean space and O~(k)Õ(k) for general metrics, the latter beating the k2k^2 barrier. On top of the randomized core, the paper adds three deterministic results: a dataset-oblivious expander-graph scheme for the relaxed (k,ϵ)(k,\epsilon)-diverse problem, an Ω(k2logN/logk)\Omega(k^2 log N / log k) lower bound for any dataset-oblivious exact scheme (via a reduction to disjunct/cover-free families), and a dataset-aware adaptive segment-tree scheme with O(klogN)O(k log N) overhead that sidesteps the lower bound. Experiments pit a randomized variant (random bucketing + DiskANN per bucket) against the single baseline on ArXiv/LAION embeddings with synthetic colors. There is also an extension to a continuous diversity objective.

Strengths and weaknesses

Strengths

S1) The group-testing framing is clean and does real work conceptually. Treating the k target colors as "defectives" and a black-box c-ANN call as a "group test" decouples the spatial search from the categorical constraint, and the resulting framework is modular: it plugs in IM98/AI08/KL04/IX23 oracles without modifying them, which is attractive for deployment.

S2) The theoretical span is respectable. The randomized result (Thm 2.1), the dataset-oblivious expander construction (Thm 3.3), the matching lower bound for the oblivious model (Thm 3.4/E.3), and the adaptive segment tree (Thm 3.5/F.6) together form a well-rounded story. The lower-bound/upper-bound pairing in the dataset-oblivious model is the most satisfying part of the paper and helps explain why the earlier k2k^2 overhead showed up. The reduction of exact diverse retrieval to (k−1)-disjunct families, then invoking the DR82 bound, is a correct and non-obvious insight.

S3) On the empirical side, the randomized variant sits ahead of the baseline on the recall–latency and recall–QPS Pareto fronts across three embedding datasets, with competitive or faster build times on the real-color ArXiv data.

Weaknesses

W1) The randomized algorithm is essentially the "color into buckets" idea from AIK+25/AAI+13 paired with a textbook coupon-collector analysis. The only genuinely new ingredient over AAI+13's per-bucket selection is the 1/k sampling with O(k log k) buckets. The Euclidean bound is an extension rather than a leap. The pieces that are new, the Ω(k2logN/logk)\Omega(k^2 log N/log k) oblivious lower bound and the segment tree, live entirely in the deterministic exact setting, which is never evaluated.

W2) The proofs I spot-checked are basically correct, but several headline statements overstate what is shown. Most importantly, the Section 3.3 results call the guarantee "exact" while the per-node oracle is only c-approximate, so "exact k-diverse" conflates combinatorial color-distinctness (true) with metric optimality (false). Separately, the o(1) and the (log(k)log(N)/ϵ)O(logk)(log(k) log(N) / \epsilon)^{O(\sqrt{log k})} factors in the deterministic theorems are super-polylogarithmic and get absorbed into "Õ" notation that hides load-bearing terms.

W3) There is a real empirical limitations:

  • Only one baseline (AIK+25). No AAI+13, no naive over-retrieve-then-rerank (CG98), no ablation over the bucket count L.
  • The asymptotic claim is never shown empirically. k is fixed (100 / 5); there is no latency-vs-k plot, which is the curve that would actually demonstrate sub-k2k^2 / sub-k scaling.
  • Only the randomized algorithm is tested. The expander construction, the lower bound, and the segment tree, the most novel material, get no empirical validation at all.
  • Colors on the flagship OpenAI dataset are synthetic with a hand-designed skew, and the authors themselves note that the real LAION distribution is less skewed and the margin shrinks there.
  • Single consumer desktop, no error bars or significance testing, despite recall ranges that overlap.

W4) The improvement is asymptotic in k, but every bound carries a multiplicative n1/c2+o(1)n^{1/c^2+o(1)} (Euclidean) or (4α)ddim(4 \alpha)^{ddim} (general) factor that dominates at the small k(≤100)k (\leq 100) actually tested. The paper never ties the measured speedups back to the claimed k-exponent.

Questions

Q1) Section 3.3 claims an exact k-diverse solution, but Algorithm 2 calls a c-ANN oracle returning c-approximate distances (line 938). Is the guarantee exact in distance, or only that exactly k distinct colors are returned within radius c·r*? Please reconcile this with the "exact" wording in Thm 3.4 and the lower bound.

Q2) The 0.99 success probability (lines 557–558) combines a Markov bound on the expected bucket count with per-oracle success of 0.99. With L=O(klogk)L = O(k log k) oracle calls, how is the union bound over oracle failures controlled, and is the cost of amplifying each oracle to failure ≤\leq 1/poly already folded into the stated k1−1/c2−o(1)k^{1−1/c^2−o(1)} overhead? A clear constant/Chernoff argument would settle this.

Q3) Can you add an experiment plotting query latency (and #buckets / #oracle calls) against k at fixed recall, to directly show the sub-k^2 (general) / sub-k (Euclidean) scaling? Without it, the title's "fast" and the abstract's "break this barrier" are not supported empirically.

Q4) Why is none of the deterministic machinery (expander Algo 5, segment tree Algo 2) evaluated, given that it is the most novel part? Even a small-scale check of the segment tree's O(klogN)O(k log N) behavior against the Ω(k2)\Omega(k^2) oblivious bound would help a lot.

Q5) The baseline (R=64/128) and your method (R=16) use different graph degrees (lines 351–352). What does the comparison look like under matched index size or build-time budget, and how does it fare against AAI+13 and a naive over-retrieve-then-rerank baseline?

Limitations

Partially. The paper is reasonably upfront about the synthetic color distribution and the shrinking margin on real LAION data, which I appreciate. But two things go unflagged: (1) the bounded doubling-dimension and aspect-ratio assumptions that every "general metric" bound silently relies on, and (2) the gap between the asymptotic k-improvement and the small-k regime where the n1/c2/(4α)ddimn^{1/c^2} / (4\alpha)^{ddim} factors dominate. I'd ask the authors to state these limitations explicitly rather than leaving them to the appendix. No negative societal-impact concerns beyond the usual for retrieval systems.

Paper formatting concerns

No formatting, anonymity, or length violations noted.

Reviewer_cjLKOpenReview ↗
Rating
4
Clarity
3
Confidence
3
Originality
3
Quality
3
Significance
3
Read review
Summary

The paper studies the problem of diverse approximate nearest neighbor search. Consider a metric space (X,d)(X, d) and a subset of points PP. Fix a radius rr and a parameter c>1c > 1. A data structure for approximate nearest neighbor search answers the following queries: given a point q∈Xq \in X, it returns a point in PP at distance at most crcr from qq if there exists a point at distance at most rr from qq. In the diverse variant of the problem, each point in PP is assigned a color. The data structure returns kk points of distinct colors within a ball of radius crcr around qq whenever there exist kk points of distinct colors within the ball of radius rr around qq.

The paper shows how to solve the diverse version of the problem using a data structure for the standard version. The reduction is based on the following idea. Sample Θ(klog⁡k)\Theta(k \log k) random color sets CiC_i, where each color is included independently with probability 1/k1/k. For each CiC_i, construct an ANN data structure for the points in PP whose colors belong to CiC_i. Given a query qq, query all of these data structures and return kk points of distinct colors from the collected answers. This reduction yields improved query time for both Euclidean and general metric spaces (see Table 1).

In addition, the paper presents results for the (k,ε)(k,\varepsilon)-diverse ANN search problem, establishes an information-theoretic lower bound for dataset-oblivious exact deterministic search, and proposes a data structure for adaptive exact deterministic search.

The paper also includes an empirical evaluation of the proposed data structures.

Strengths and weaknesses

Strengths:

The problem is well motivated. In many applications, one is interested in retrieving a diverse set of results for a given query, which is naturally modeled by requiring the returned points to have distinct colors.

The proposed reduction applies to both Euclidean and general metric spaces.

Weaknesses:

The main algorithmic idea is relatively simple. The technical contribution of the reduction is moderate and, by itself, would not meet the bar for NeurIPS. The additional results on deterministic data structures are technically more involved and substantially strengthen the paper from a technical standpoint. However, conceptually they are less central than the main reduction.

While the improvement in query time for Euclidean spaces, from O~(k)\tilde O(k) to O~(k1−1/c2)\tilde O(k^{1-1/c^2}), is meaningful, it does not represent a major breakthrough.

Questions

Could the authors comment on whether the query-time overhead achieved by their reduction is likely to be close to optimal, both in Euclidean and general metric spaces?

Limitations

yes

Paper formatting concerns

N/A

Reviewer_vzRVOpenReview ↗
Rating
5
Clarity
2
Confidence
2
Originality
3
Quality
3
Significance
3
Read review
Summary

The authors study the k-diverse nearest neighbor search problem, which asks for a given dataset and query q, to retrieve the approximate nearest neighbors to the query with distinct colors The O(k^2) barrier from previous state-of-the-art work is bypassed by using a color bucketing framework which is inspired by non-adaptive group testing. Overall, the authors propose new methods that achieve improved query and space complexity bounds. The methods are validated on semi-synthetic and real-world datasets, which seem to confirm the significantly faster search times and higher recall compared to state-of-the-art diversity search baselines

Strengths and weaknesses

S1) The authors make several clear theoretical contributions, mainly resulting in improved query time and similar (sometimes even improved) space as the previous state-of-the-art. The limits of exact deterministic retrieval are also shown, by providing lower bounds by clever use of a similarity with disjunctive codes from extremal combinatorics. Various other methods (schemes via bipartite expanders, adaptive segment tree bucketing) are also introduced.

S2) An experimental evaluation shows that the proposed algorithms generally achieve faster query time and more accurate answers on both semi-synthetic and real-world datasets.

W) Overall, I am quite positive about this paper. The contributions are clear, the claims are supported by proofs and solid experimental evaluation. The only downside of this paper is that the writing and exposition could sometimes be improved. Some math formatting and paragraphs are not that properly readable, which confiscate the reading of the entire paper. For example, Sec. 1.1 (results) is kind of a straightforward summary dump of obtained results, but not that well-written. Same goes for other parts, like Theorem 2.1 and Section 2, which could use some improved presentation and general writing.

Questions

What are the open questions and research directions? What are the limitations of your approach?

Limitations

No limitations given

Paper formatting concerns

No concerns

Final justification

Thanks to the authors for rebuttal. This paper makes a solid contribution

Comments on the paper

1 comment
Meta-review

The reviewers found the problem studied interesting but there is concern about the technical depth of the contribution and applicability of the results in empirical setting. I would suggest that authors focus on highlighting the technical depth that may have gone missing in the reviewers [I am inclined not to recommend rejection solely due to technical depth]. The questions by reviewer regarding empirical evaluation are very valid and it is important that authors address them satisfactorily.

From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.

Related papers

Loading the map…

Discussion (0)

Sign in to comment.