NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Probabilistic Kernel Function for Fast Angle Testing

Kejing Lu, Chuan Xiao, Yoshiharu Ishikawa

TL;DR

Similarity search in high-dimensional spaces often boils down to "angle testing"—deciding which vectors are closer to a query without calculating exact distances. This paper introduces two new probabilistic kernel functions that replace standard random Gaussian projections with structured, deterministic projection vectors and "reference angles." This approach results in a 2.5x–3x speedup over the industry-standard HNSW algorithm.

In modern machine learning, finding the "nearest neighbor" to a query vector (e.g., retrieving the most relevant document in a Retrieval-Augmented Generation system) is a fundamental operation. As the dimensionality ($d$) of these vectors grows, calculating the exact inner product or cosine similarity becomes a computational bottleneck, costing $O(d)$ per comparison.

To accelerate this, researchers use probabilistic angle testing. Instead of calculating the exact angle, they use "kernel functions" to estimate whether an angle is smaller than a threshold or smaller than another angle. Existing state-of-the-art methods like CEOs and PEOs rely on random projection vectors drawn from Gaussian distributions. However, these methods have a major theoretical flaw: their accuracy guarantees only hold as the number of projection vectors approaches infinity. In real-world applications where minimizing projections is crucial for speed, these "asymptotic" assumptions often fall apart.

A Deterministic Approach to Angle Testing

The authors propose two new kernel functions: KS1 (for comparing two angles) and KS2 (for thresholding an angle against a fixed value). Their approach deviates from traditional methods in three key ways:

  1. Deterministic Structure: Instead of purely random Gaussian vectors, they use structured sets of projection vectors, such as antipodal pairs (vectors and their exact opposites) or cross-polytopes (the vertices of a high-dimensional diamond).
Algorithm for generating antipodal projections
  1. Reference Angles: They incorporate the "reference angle"—the distance between a data vector and its closest projection vector—directly into the kernel. This provides a deterministic correction factor that Gaussian methods ignore.
  2. Exact Probability Guarantees: Unlike previous work, their mathematical proofs do not require the number of projections to be infinite. The relationship between the projected values and the actual angles is deterministic and predictable even with a small number of projections.

These kernels are integrated into a graph-based search framework (HNSW+KS2) and a Maximum Inner Product Search (MIPS) framework (KS1).

Key Insights

  • Gaussian is Suboptimal: The paper argues that Gaussian distributions are "messy" for projection. By using structured configurations like cross-polytopes, the high-dimensional sphere is covered more evenly, leading to much more accurate angle estimations.
  • The Power of "Anchors": By treating projection vectors as "anchors" and measuring how far a vector is from its nearest anchor (the reference angle), the system gains a much clearer picture of the vector's true position in space.
  • Simplicity Wins: The KS2 routing test is mathematically simpler than the previous state-of-the-art (PEOs). This simplicity translates directly into lower CPU overhead during the search process.

Performance and Results

The researchers evaluated their methods on six standard high-dimensional benchmarks, including Text/NLP datasets (Word, GloVe1M, GloVe2M) and Image datasets (SIFT, Tiny, GIST).

  • Throughput (QPS): HNSW equipped with the KS2 test achieved 2.5x to 3x higher Queries-Per-Second than the standard HNSW algorithm.
  • Beating the State-of-the-Art: Compared to HNSW+PEOs (the previous leader in probabilistic routing), KS2 was 10% to 30% faster while actually reducing the index size by about 5%.
  • Accuracy: In MIPS tasks, KS1 consistently outperformed CEOs in recall, proving that structured projections provide a more reliable "hint" than random ones.
KS1 outperforms CEOs across multiple text datasets

Limitations and Future Work

  • The "Best" Configuration: While the authors show that cross-polytopes are better than Gaussian noise, finding the mathematically optimal arrangement of $m$ points on a $d$-dimensional sphere (the "best covering problem") remains an open challenge in geometry for cases where $m > d+3$.
  • Parameter Tuning: The performance of KS2 depends on a parameter $L$ (the number of space partitions). Users still need to balance $L$ to trade off between index size and search speed.
  • Metric Specificity: The current work is heavily optimized for $\ell_2$ and cosine similarity. Extending these deterministic structures to other distance metrics (like Manhattan distance) is a potential avenue for future research.

Summary updated

BibTeX
@inproceedings{lu2026probabilistic,
  author = {Kejing Lu and Chuan Xiao and Yoshiharu Ishikawa},
  title = {{Probabilistic Kernel Function for Fast Angle Testing}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=nCsF3Bsn2n},
}
Figure