Infinity Search: Approximate Vector Search with Projections on q-Metric Spaces

Infinity Search: Approximate Vector Search with Projections on q-Metric Spaces
Notice: This research summary and analysis were automatically generated using AI technology. For absolute accuracy, please refer to the [Original Paper Viewer] below or the Original ArXiv Source.

An ultrametric space or infinity-metric space is defined by a dissimilarity function that satisfies a strong triangle inequality in which every side of a triangle is not larger than the larger of the other two. We show that search in ultrametric spaces with a vantage point tree has worst-case complexity equal to the depth of the tree. Since datasets of interest are not ultrametric in general, we employ a projection operator that transforms an arbitrary dissimilarity function into an ultrametric space while preserving nearest neighbors. We further learn an approximation of this projection operator to efficiently compute ultrametric distances between query points and points in the dataset. We proceed to solve a more general problem in which we consider projections in $q$-metric spaces – in which triangle sides raised to the power of $q$ are smaller than the sum of the $q$-powers of the other two. Notice that the use of learned approximations of projected $q$-metric distances renders the search pipeline approximate. We show in experiments that increasing values of $q$ result in faster search but lower recall. Overall, search in q-metric and infinity metric spaces is competitive with existing search methods.


💡 Research Summary

The paper addresses the problem of fast approximate nearest‑neighbor (ANN) search for high‑dimensional vector embeddings when the underlying dissimilarity function is not a metric or is computationally expensive to evaluate. The authors introduce a framework that (i) projects any symmetric dissimilarity matrix into a q‑metric or ∞‑metric (ultrametric) space, (ii) exploits the stronger triangle inequalities of these spaces to prune a Vantage‑Point (VP) tree more aggressively, and (iii) learns a neural mapping that approximates the projected distances for query points, thereby avoiding costly on‑the‑fly projections.

Key concepts

  • q‑metric spaces – A distance d satisfies the q‑triangle inequality : (d(x,y))^q ≤ (d(x,z))^q + (d(z,y))^q for a fixed q ≥ 1. When q = 1 the usual metric inequality is recovered; as q → ∞ the inequality becomes the strong (ultrametric) form d(x,y) ≤ max{d(x,z),d(z,y)}. Larger q values shrink the interval in which a VP‑tree node cannot be pruned, thus reducing the expected number of distance comparisons.
  • VP‑tree pruning – In a metric space a node can be discarded if either d(v,query)+τ < µ or µ + τ ≤ d(v,query), where v is the node’s pivot, µ the median radius, and τ an upper bound on the distance to the true nearest neighbor. The authors show that the same logic holds for q‑metrics after raising all terms to the power q, and that for ∞‑metrics the conditions collapse to simple comparisons with µ, guaranteeing that exactly one child subtree is eliminated at each level. Consequently, the worst‑case number of comparisons is bounded by the tree depth h(T) ≤ ⌈log₂ m⌉.
  • Canonical projection – To obtain a q‑metric (or ultrametric) from an arbitrary dissimilarity matrix, the authors adopt the “canonical projection” from prior work: they view the data as a complete weighted graph and compute the shortest‑path distance where the path length is measured with the q‑norm (or ∞‑norm). This projection is the only one satisfying the Projection and Transformation axioms and, crucially, it preserves nearest‑neighbor relations (Theorem 3.1).

Learning‑based approximation
Directly computing the canonical projection for a new query would require evaluating distances to all dataset points, defeating the purpose of the method. The authors therefore train a parametric function fθ (a feed‑forward neural network) that maps original embeddings x to auxiliary embeddings φ(x). The training loss forces Euclidean distances ‖φ(x_i)‑φ(x_j)‖₂ to match the pre‑computed q‑metric distances d_q(x_i,x_j). After training, a query x₀ is mapped to φ(x₀) in O(d) time, and its distance to any database point can be approximated by a cheap Euclidean computation, which is then used in the VP‑tree search. The overall online pipeline consists of (1) φ‑computation, (2) VP‑tree traversal, and (3) optional re‑ranking with the exact original distance for the top‑k candidates.

Experimental findings
The authors evaluate on several public embedding sets (sentence‑BERT, CLIP image embeddings, graph embeddings) with sizes ranging from 10⁴ to 1.5 × 10⁵. They vary q ∈ {1, 2, 4, ∞}. Results show:

  • As q increases, the average number of distance comparisons approaches the theoretical log₂ m bound, confirming that larger q yields tighter pruning.
  • Recall@k declines with larger q because the learned Euclidean proxy becomes a coarser approximation of the true q‑metric distance. For q = ∞, recall stays around 0.85–0.90, while for q = 1 it exceeds 0.95.
  • Compared with state‑of‑the‑art ANN methods such as HNSW and IVF‑PQ, the proposed approach achieves comparable query latency and memory usage, with a modest loss in recall that can be mitigated by a small re‑ranking step.

Strengths and limitations
The paper’s main strength is the theoretical insight that ultrametric spaces guarantee logarithmic‑time VP‑tree search, a property that had not been exploited for ANN before. The canonical projection provides a principled way to embed arbitrary dissimilarities into such spaces while preserving nearest‑neighbor structure. The learning‑based distance approximation makes the method practical for large‑scale queries.

Limitations include the offline cost of computing all‑pairs q‑shortest‑path distances (quadratic in dataset size) and the dependence on a neural mapper that may not generalize to out‑of‑distribution queries or to datasets with rapidly changing distributions. Moreover, the trade‑off between speed and recall is intrinsic: higher q yields faster search but lower accuracy.

Future directions suggested by the authors and inferred from the work are: (1) employing approximate shortest‑path algorithms or graph sparsification to reduce the projection preprocessing cost; (2) using meta‑learning or continual learning to adapt fθ quickly to new domains; (3) designing adaptive schemes that select q per query based on estimated difficulty; and (4) building hybrid indexes that apply VP‑tree pruning on ultrametric‑compatible subsets while falling back to conventional ANN structures for the rest.

In summary, the paper proposes a novel pipeline—canonical q‑metric projection, learned Euclidean surrogate, and VP‑tree search—that theoretically reduces ANN complexity to logarithmic time and empirically matches existing fast‑search methods, offering a fresh perspective on how stronger triangle inequalities can be leveraged for scalable similarity search.


Comments & Academic Discussion

Loading comments...

Leave a Comment