Probabilistic Kernel Function for Fast Angle Testing
Kejing Lu, Chuan Xiao, Yoshiharu Ishikawa
Abstract
In this paper, we study the angle testing problem in the context of similarity search in high-dimensional Euclidean spaces and propose two projection-based probabilistic kernel functions, one designed for angle comparison and the other for angle thresholding. Unlike existing approaches that rely on random projection vectors drawn from Gaussian distributions, our approach leverages reference angles and adopts a deterministic structure for the projection vectors. Notably, our kernel functions do not require asymptotic assumptions, such as the number of projection vectors tending to infinity, and can be theoretically and experimentally shown to outperform Gaussian-distribution-based kernel functions. We apply the proposed kernel function to Approximate Nearest Neighbor Search (ANNS) and demonstrate that our approach achieves a 2.5×-3× higher query-per-second (QPS) throughput compared to the widely-used graph-based search algorithm HNSW. Our code and data are available at https://github.com/KejingLu-810/KS . INTRODUCTION Vector-based similarity search is a core problem with broad applications in machine learning, data mining, and information retrieval. It involves retrieving data points in a high-dimensional space that are most similar to a given query vector based on a specific similarity measure. This task is central to many downstream applications, including nearest neighbor classification, recommendation systems, clustering, anomaly detection, and retrieval-augmented generation (RAG). However, the high dimensionality of modern datasets makes efficient similarity search particularly challenging, highlighting the need for fast and scalable vector computation techniques. Among the various similarity measures for high-dimensional vectors, the ℓ 2 norm, cosine similarity, and inner product are the most commonly used in practice. As discussed in Yan et al. ( 2018 ); Dai et al. (2020); Lu et al. ( 2024 ), it is often possible to pre-compute and store the norms of vectors in advance, allowing these measures to be reduced to the computation of the cosine of the angle between two normalized vectors, thereby highlighting the central role of angle computation. On the other hand, in many real-world scenarios, we are not concerned with the exact values of the angles but rather with the outcome-which one is greater-of an angle comparison, which is referred to as angle testing: Given a query vector q and data vectors v 1 , v 2 , v on the sphere S d-1 , typical operations include comparing ⟨q, v 1 ⟩ and ⟨q, v 2 ⟩, or determining whether ⟨q, v⟩ exceeds a certain threshold. These operations, however, require computing exact cosines of angles, which has a cost of O(d) per comparison and becomes expensive in high dimensions. To address this, we aim to design a computationally efficient probabilistic kernel function K that can approximate these comparisons with reduced cost and high success probability. More precisely, we focus on the following two problems: Problem 1.1. (Probabilistic kernel function for comparison) Design a probabilistic kernel function K: S d-1 × S d-1 → RV with computational cost o(d), where RV denotes the set of random variables, such that, for any data vectors v 1 , v 2 ∈ S d-1 and query q ∈ S d-1 satisfying ⟨q, v 1 ⟩ > ⟨q, v 2 ⟩, we have Pr[K(q, v 1 ) > K(q, v 2 )] > 1 -ϵ, where ϵ ≤ 0.5. Problem 1.2. (Probabilistic kernel function for thresholding) Given a fixed angle threshold θ ∈ (0, π), design a probabilistic kernel function K: S d-1 × S d-1 → RV with computational cost o(d) such that
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 228e7e80-b6a3-44e9-8763-f6ddd62c032dCited by top-tier papers1
Ask how each one uses itBuilds on14
- Accelerating Large-Scale Inference with Anisotropic Vector QuantizationRuiqi Guo, Philip Sun, Erik Lindgren, Quan Geng et al.ICML 2020 · 539 citations
- RaBitQ: Quantizing High-Dimensional Vectors with a Theoretical Error Bound for Approximate Nearest Neighbor SearchJianyang Gao, Cheng LongSIGMOD 2024 · 83 citations
- Efficient Approximate Nearest Neighbor Search in Multi-dimensional DatabasesYun Peng, Byron Choi, Tsz Nam Chan, Jianye Yang et al.SIGMOD 2023 · 74 citations
- High-Dimensional Approximate Nearest Neighbor Search: with Reliable and Efficient Distance Comparison OperationsJianyang Gao, Cheng LongSIGMOD 2023 · 73 citations
- FINGER: Fast Inference for Graph-based Approximate Nearest Neighbor SearchPatrick H. Chen, Wei-Cheng Chang, Jyun-Yu Jiang, Hsiang-Fu Yu et al.WWW 2023 · 35 citations
Related papers
- Angular Distance-Guided Neighbor Selection for Graph-Based Approximate Nearest Neighbor SearchSungjun Jung, Yongsang Park, Haeun Lee, Young H. Oh et al.WWW 2025 · 3 citations
- Efficient Approximate Nearest Neighbor Search via Hemi-Sphere Centroids GraphRunwen Qiu, Jing TangSIGMOD 2026 · 5 citations
- GPU-accelerated Proximity Graph Approximate Nearest Neighbor Search and ConstructionYuanhang Yu, Dong Wen, Ying Zhang, Lu Qin et al.ICDE 2022 · 28 citations
- Accelerating Graph Indexing for ANNS on Modern CPUsMengzhao Wang, Haotian Wu, Xiangyu Ke, Yunjun Gao et al.SIGMOD 2025 · 6 citations
- PANNS: Enhancing Graph-based Approximate Nearest Neighbor Search through Recency-aware Construction and Parameterized SearchXizhe Yin, Chao Gao, Zhijia Zhao, Rajiv GuptaPPoPP 2025 · 5 citations
