Probabilistic Kernel Function for Fast Angle Testing

Kejing Lu, Chuan Xiao, Yoshiharu Ishikawa

International Conference on Learning Representations 2026 · Oral

Overview

The presented work introduces a novel approach to address the fundamental challenge of Top-k Nearest Neighbors (Top-kNS) search in high-dimensional and large-scale datasets. This problem is ubiquitous across various real-world applications, including recommender systems, image retrieval, and more recently, generative AI (IAG). The core difficulty lies in striking an optimal balance between search efficiency and retrieval accuracy: ideally, one seeks to identify as many true nearest neighbors as possible while maintaining rapid search times. Traditional methods often force a compromise between slow, exact distance computations and fast, approximate methods prone to significant ranking errors. This paper proposes a sophisticated middle ground, leveraging probabilistic kernel functions to accelerate the angle testing phase in a two-stage filtering process.

Watch on SlidesLive

Visual summary for Probabilistic Kernel Function for Fast Angle Testing by Kejing Lu, Chuan Xiao, Yoshiharu Ishikawa
Visual summary for Probabilistic Kernel Function for Fast Angle Testing by Kejing Lu, Chuan Xiao, Yoshiharu Ishikawa

Key moments

  1. 0:00 Introduction to Top-kNS and efficiency-accuracy trade-off
  2. 2:00 Introducing probabilistic kernel functions KS1 and KS2 for angle testing
  3. 2:40 Definitions of KS1 and KS2 based on linear transformations
  4. 4:00 Theoretical guarantees and novel cone-based projection structure
  5. 5:20 Applying KS2 test to similarity graphs for fast traversal
  6. 6:00 Experimental results: HNSW+KS2 achieves significantly higher throughput
  7. 6:20 Recent progress: Projection-Augmented Graph (PAG) for construction

Probabilistic Kernel Function for Fast Angle Testing

Speakers: Kejing Lu, Chuan Xiao, Yoshiharu Ishikawa

Conference: ICLR 2026

YouTube: https://slideslive.com/39062157

Overview

The presented work introduces a novel approach to address the fundamental challenge of Top-k Nearest Neighbors (Top-kNS) search in high-dimensional and large-scale datasets. This problem is ubiquitous across various real-world applications, including recommender systems, image retrieval, and more recently, generative AI (IAG). The core difficulty lies in striking an optimal balance between search efficiency and retrieval accuracy: ideally, one seeks to identify as many true nearest neighbors as possible while maintaining rapid search times. Traditional methods often force a compromise between slow, exact distance computations and fast, approximate methods prone to significant ranking errors. This paper proposes a sophisticated middle ground, leveraging probabilistic kernel functions to accelerate the angle testing phase in a two-stage filtering process.

The speakers, Kejing Lu, Chuan Xiao, and Yoshiharu Ishikawa, introduce two specialized kernel functions, KS1 and KS2, designed to provide probabilistic guarantees for angle comparisons. These functions enable a highly efficient preliminary test: a newly encountered vector is first checked against a current top-k boundary using an approximate, fast kernel function. Only if it passes this initial probabilistic test is its exact distance computed, thereby drastically reducing the number of expensive exact distance calculations. This methodology is particularly impactful for similarity metrics like cosine similarity, where the angular relationship between high-dimensional vectors is paramount.

The significance of this research extends to enhancing existing approximate nearest neighbor (ANN) search structures, particularly similarity graphs like HNSW (Hierarchical Navigable Small World). By integrating the KS2 test into graph traversal, the proposed method demonstrably improves throughput without sacrificing accuracy. Furthermore, the paper briefly touches upon the evolution of this concept into Projection-Augmented Graphs (PAG), a new framework that applies the kernel functions not only during query time but also during graph construction, promising even greater efficiency for both indexing and search performance. This work offers a robust solution for practitioners grappling with the computational burden of large-scale similarity search, providing tools to build faster and more accurate systems.

Background

▶ Watch: Introduction to Top-kNS and efficiency-accuracy trade-off (0:00)

The problem of Top-k Nearest Neighbors (Top-kNS) is a cornerstone in many data-intensive applications. Given a query vector, the objective is to identify the k data points in a high-dimensional dataset that are most similar to it, according to a specified similarity metric. The scale of modern datasets—often comprising millions or billions of high-dimensional vectors (e.g., embeddings from deep learning models)—renders exhaustive, exact similarity computations prohibitively slow. This computational bottleneck is particularly acute in domains like personalized recommendations, where real-time responses are critical, or large-scale image databases, where rapid content-based retrieval is essential. The emergence of Image/Text-to-Image Generation (IAG) models further exacerbates this, as their latent spaces often involve very high-dimensional vectors requiring efficient similarity search for tasks like prompt engineering or model steering.

Historically, solutions to Top-kNS have fallen into two main categories: exact methods and approximate methods. Exact methods guarantee finding the true top-k neighbors by computing the distance (or similarity) between the query and every data point. While perfectly accurate, their computational complexity, often proportional to the product of the number of data points and their dimensionality, makes them impractical for large datasets. Approximate Nearest Neighbor (ANN) methods, on the other hand, sacrifice some accuracy for significant speedups. These methods include tree-based structures (e.g., KD-trees, ball trees), hashing-based methods (e.g., Locality-Sensitive Hashing - LSH), and quantization-based methods (e.g., Product Quantization - PQ). While fast, ANN methods introduce approximation errors that can unpredictably alter the ranking of neighbors, potentially leading to suboptimal results or missed true neighbors.

The challenge, therefore, lies in navigating the trade-off between efficiency and accuracy. The ideal solution would retrieve as many true neighbors as possible while keeping the search fast. The speakers highlight a practical strategy to achieve this "middle ground": continuously maintain a list of current top-k nearest neighbors. For any newly encountered vector, a fast, approximate test is performed to ascertain if it is potentially closer to the query than the current k-th nearest neighbor. Only if this preliminary test is positive is the more expensive, exact distance computation performed. This two-stage filtering process aims to prune a large number of irrelevant candidates early, thereby accelerating the overall search. The success of this approach hinges on two critical factors: first, the threshold for the current top-k list must quickly converge to the true top-k boundary; and second, an effective and computationally inexpensive test for the comparison must be available. This paper primarily focuses on addressing the second challenge, particularly in the context of cosine similarity, where angle testing is the key operation.

Key Findings

▶ Watch: Definitions of KS1 and KS2 based on linear transformations (2:40)

The central contribution of this research is the development of two novel probabilistic kernel functions, KS1 and KS2, specifically designed for fast angle testing in high-dimensional similarity search. These functions address the critical need for an efficient and reliable approximate comparison mechanism in the two-stage Top-kNS search strategy.

The key findings are:

  1. Probabilistic Guarantees for Angle Testing: The proposed KS1 (for pairwise comparison) and KS2 (for comparison against a threshold) functions offer explicit probability guarantees. This means that if a vector is indeed closer to the query in the original space, its kernel values are statistically more likely to be larger, providing a robust basis for approximate filtering. The success probability of these tests is guaranteed to be at least one half, ensuring their utility.
  1. Computational Efficiency and Parallelization: Both KS1 and KS2 are constructed using only linear transformations, making them computationally inexpensive. This design choice is crucial for their role as fast, preliminary filters. Furthermore, their inherent structure is friendly to parallelization, allowing for efficient execution on modern hardware and scalability to large datasets.
  1. Optimized Projection Structure via Reference Angle: The theoretical underpinnings of the method reveal that the optimal projection structure for accurate angle estimation derives from the best covering on the sphere, rather than traditional Gaussian distributions. This insight leads to a refined sampling strategy where random vectors are restricted to a cone defined by a "reference angle." A smaller reference angle directly correlates with a more accurate estimator, enhancing the precision of the probabilistic tests.
  1. Integration with Similarity Graphs for Enhanced Throughput: When the KS2 test is applied to widely used similarity graph structures, such as HNSW, it leads to significant performance improvements. Experiments demonstrate that HNSW plus KS2 achieves "significantly higher throughput" compared to the original HNSW. This is attributed to KS2's ability to prune irrelevant nodes efficiently during graph traversal, accelerating the search for true neighbors.
  1. Introduction of Projection-Augmented Graphs (PAG): The research extends beyond query-time optimization with the introduction of Projection-Augmented Graphs (PAG). This new framework incorporates the KS2 test not only during the query phase but also during the graph construction (indexing) phase, using additional techniques. PAG offers two variants: PAG-light for fast indexing and a smaller memory footprint, and PAG-base for high search performance. Both variants are shown to achieve high throughput, with PAG-light demonstrating "competitive indexing time compared to quantization-based methods." This indicates a comprehensive solution that improves both the construction and querying of similarity graphs.

These findings collectively present a powerful and practical framework for accelerating high-dimensional similarity search, offering a principled way to balance accuracy and efficiency through probabilistic angle testing and optimized projection structures.

Technical Deep Dive

▶ Watch: Theoretical guarantees and novel cone-based projection structure (4:00)

The core of this work lies in the design and application of two novel probabilistic kernel functions, KS1 and KS2, tailored for fast angle testing. The problem specifically targets cosine similarity, which is equivalent to testing angles between high-dimensional vectors when norms are normalized. For other similarities like Euclidean distance or inner product, if vector norms are pre-computed, the angular component remains the most expensive part.

The principles guiding the design of KS1 and KS2 are threefold:

  1. Low Computational Cost: The functions must be much faster to compute than exact angle comparisons.
  2. Guaranteed Success Probability: The test must have a success probability of at least one half, ensuring its reliability as a filter.
  3. Parallelization Friendliness: The computation should lend itself well to parallel execution.

Let's denote the query vector as q and an arbitrary data vector as v. The kernel functions leverage a randomly rotated matrix H and a fixed point set S on the sphere. The definitions of KS1 (for pairwise comparison) and KS2 (for comparison against a threshold) are derived from the information of the angle from v to S, referred to as the reference angle, and the nearest point in S to v. While the exact mathematical forms are not fully detailed in the transcript, it's stated that "both of these two functions only rely on linear transformations and can be computed efficiently." This implies operations such as dot products with projected vectors or comparisons of projected values.

A crucial statistical relationship exists: if a vector v is closer to the query q in the original high-dimensional space (i.e., smaller angle, higher cosine similarity), its kernel values are "more likely to be large." The reference angle is identified as the key quantity controlling the estimation accuracy; a smaller reference angle leads to a more accurate estimator.

The theoretical guarantees provided are "exact and non-asymptotic." This means they hold for finite dimensions and dataset sizes, not just in theoretical limits. A significant theoretical contribution is the finding that "the best projection structure comes from the best covering on the sphere rather than the classical Gaussian distribution." This directly contrasts with many traditional projection-based methods, such as Locality-Sensitive Hashing (LSH), which often use Gaussian random projections. Instead of drawing random vectors from the entire sphere, the proposed method restricts the sampling region to a cone whose half-angle is the reference angle. This constrained sampling strategy is explicitly stated to make the estimation more accurate.

To generate a large number of projection vectors efficiently, a product quantization style design is employed. The entire high-dimensional space is partitioned into L subspaces. Within each subspace, m sub-vectors are generated, meticulously designed to be "as spread out as possible." As a practical alternative to achieving a true best covering configuration, the method utilizes "multiple randomly rotated cross-polytopes" to generate these sub-vectors. The parameter L (number of subspaces) plays a role in the sharpness of the estimator: a larger L leads to a sharper estimator, but beyond a moderate value, it primarily increases space cost without significant accuracy gains.

The application of the angle thresholding function KS2 to similarity graphs is a key integration point. Similarity graphs, such as HNSW, are known for their ability to quickly converge the current result list's threshold to the true top-k boundary. During graph traversal, each visited node has multiple neighbors that need to be evaluated. The "parallel nature of KS2" makes it highly suitable for this scenario. The framework for graph plus KS2 test involves a "projection table" whose number of columns corresponds to L. AS denotes the reference angle, and the threshold delta is dynamically provided by the distance of the current k-th nearest neighbor. If the output of the KS2 test is positive (indicating the candidate is potentially closer), the exact distance is computed. Otherwise, the candidate is discarded, effectively pruning many irrelevant nodes and accelerating graph traversal.

Finally, the recent development of Projection-Augmented Graphs (PAG) extends this concept. While the initial integration of KS2 was primarily for the query phase, PAG applies the KS2 test, along with "additional techniques," to the graph construction (indexing) phase. PAG has two variants:

  • PAG-light: Designed for fast indexing and a relatively small memory footprint.
  • PAG-base: Designed for high search performance.

Both variants leverage the core probabilistic kernel functions for efficiency during both graph construction and query execution.

Experimental Setup & Results

▶ Watch: Experimental results: HNSW+KS2 achieves significantly higher throughput (6:00)

The experimental validation of the proposed probabilistic kernel functions and their integration with similarity search structures is crucial. The primary focus of the experiments was to demonstrate the effectiveness of the KS2 test in accelerating similarity graph traversals, specifically using HNSW (Hierarchical Navigable Small World), a widely adopted and high-performing ANN graph-based index.

Application to HNSW:

The core experiment involved applying the KS2 test to the query phase of HNSW. The results conclusively show that "HNSW plus KS2 can achieve significantly higher throughput than the original graph." This indicates that the fast, probabilistic angle testing enabled by KS2 effectively prunes a substantial number of irrelevant candidates during graph traversal, leading to a faster search without compromising the quality of the retrieved neighbors. The specific magnitude of "significantly higher throughput" is not quantified with exact numbers in the transcript, but the qualitative assessment suggests a substantial performance gain.

Impact of L Parameter:

The design of the projection structure involves partitioning the space into L subspaces. Experiments were conducted to evaluate the impact of the parameter L on search performance. The findings indicate that the KS2 test functions across all values of L. A larger L generally leads to a "better search performance" because it contributes to a sharper estimator. However, this improvement comes "at the expense of more space cost" due to the increased size of the projection table. The speakers suggest that "a moderate L is enough for our use and increasing it further only increases the space cost," implying a practical optimal point where performance gains plateau while memory consumption continues to rise.

Projection-Augmented Graphs (PAG):

Beyond the direct application of KS2 to existing similarity graphs during querying, the research introduced a more integrated framework called Projection-Augmented Graphs (PAG). This framework extends the use of KS2 to the graph construction (indexing) phase, along with additional unspecified techniques. Two variants of PAG were evaluated:

  • PAG-light: Aimed at fast indexing and a small memory footprint.
  • PAG-base: Optimized for high search performance.

The results for PAG variants were also positive: "both of these two variants can achieve high throughput." This demonstrates the versatility and effectiveness of the kernel functions in improving both the build time and query time aspects of similarity graph indexes.

Indexing Time Performance:

A specific highlight for PAG-light was its indexing time performance. The results showed that "PAG-light can actually achieve competitive indexing time compared to quantization-based methods." This is a significant claim, as quantization-based methods (like Product Quantization) are known for their efficiency in creating compact and fast-to-build indexes. Achieving competitive indexing time while also offering high search throughput positions PAG-light as a strong contender for scenarios requiring rapid index creation alongside efficient querying.

While specific dataset names (e.g., SIFT1M, GIST1M), hardware configurations (e.g., GPU types, CPU models), or detailed performance metrics (e.g., QPS, recall@k values) are not provided in the transcript, the qualitative results strongly indicate the practical efficacy and performance advantages of the proposed probabilistic kernel functions and the PAG framework. The consistent messaging around "significantly higher throughput" and "competitive indexing time" underscores the practical utility of this approach for large-scale ANN search.

Practical Implications

▶ Watch: Recent progress: Projection-Augmented Graph (PAG) for construction (6:20)

The development of Probabilistic Kernel Functions for Fast Angle Testing and the subsequent Projection-Augmented Graph (PAG) framework carries significant practical implications for various stakeholders involved in AI/ML systems:

For Practitioners and Model Builders:

  • Accelerated Similarity Search: The most immediate benefit is the ability to perform high-dimensional Top-kNS queries significantly faster, especially for cosine similarity. This directly translates to more responsive recommender systems, quicker image retrieval, and faster exploration in generative AI applications.
  • Improved Accuracy-Efficiency Trade-off: Practitioners no longer have to make a stark choice between exact but slow searches and fast but potentially inaccurate approximate methods. The probabilistic kernel functions offer a principled "middle ground" that prunes irrelevant candidates efficiently, leading to higher throughput while maintaining or improving recall compared to naive approximate methods.
  • Enhanced Graph-Based ANN Systems: For those already using or planning to deploy similarity graphs like HNSW, integrating the KS2 test provides an immediate performance uplift. This means existing deployments can be optimized without a complete overhaul of their underlying data structures.
  • Versatile Indexing and Querying: The PAG framework offers flexibility. PAG-light is ideal for scenarios where fast index construction and a small memory footprint are critical, such as dynamic datasets or edge deployments. PAG-base caters to applications demanding the absolute highest search performance. This allows practitioners to choose the variant best suited for their specific operational constraints.

For Infrastructure Teams and Deployers:

  • Reduced Computational Resources: Faster search times imply that the same workload can be handled with fewer computational resources (CPUs, GPUs), or a larger workload can be processed with existing infrastructure. This leads to cost savings in cloud environments and more efficient utilization of on-premise hardware.
  • Scalability: The inherent parallelization friendliness of the kernel functions and their integration with scalable graph structures like HNSW means the solution can effectively scale to ever-growing datasets, addressing the demands of modern large-scale ML applications.
  • Simplified Deployment: As the method integrates with established ANN libraries and techniques, its deployment should be relatively straightforward for teams familiar with existing similarity search infrastructure. The focus on linear transformations also suggests lower complexity in terms of specialized hardware requirements compared to some highly optimized, custom hardware solutions.

Tradeoffs and Limitations:

  • Space Cost vs. Performance: The parameter L (number of subspaces) in the projection structure presents a clear tradeoff. While a larger L can yield better search performance, it increases the space cost. Infrastructure teams will need to carefully tune this parameter based on available memory and performance targets.
  • Reference Angle Optimization: The accuracy of the estimator is controlled by the reference angle. While the theory suggests deriving the best projection structure from optimal spherical coverings, the practical implementation uses "multiple randomly rotated cross-polytopes" as an approximation. Further research or fine-tuning might be needed to optimize this aspect for specific data distributions.
  • Similarity Metric Specificity: While the method is presented as generalizable to other metrics if norms are pre-computed, its core strength lies in cosine similarity and angle testing. Its direct applicability and performance benefits might vary for other complex similarity measures that do not primarily rely on angles.
  • Integration Complexity: While promising, the "additional techniques" used in PAG for graph construction are not fully detailed in the talk. The practical effort required to integrate these techniques into existing graph-building pipelines might vary.

In summary, this work provides powerful tools for accelerating high-dimensional similarity search, offering tangible benefits in terms of speed, resource efficiency, and accuracy for a wide range of ML applications. The flexibility of the PAG framework further enhances its utility, allowing for tailored solutions based on specific performance and resource constraints.

Key Takeaways

  • Top-kNS Problem Solved with Probabilistic Filtering: The research addresses the critical challenge of balancing efficiency and accuracy in high-dimensional Top-k Nearest Neighbors (Top-kNS) search by employing a two-stage filtering approach, using fast probabilistic tests before expensive exact computations.
  • Novel Probabilistic Kernel Functions (KS1, KS2): Two new kernel functions, KS1 (pairwise) and KS2 (threshold comparison), are introduced. These functions rely on linear transformations, are computationally inexpensive, friendly to parallelization, and provide a statistical guarantee of at least 50% success probability for angle testing.
  • Optimized Projection Structure via Reference Angle: The method's accuracy stems from a theoretically optimal projection structure based on the "best covering on the sphere," rather than traditional Gaussian projections. This involves restricting sampling to a cone defined by a "reference angle," leading to more accurate estimations.
  • Significant Throughput Gains for Similarity Graphs: Integrating the KS2 test into existing similarity graph structures like HNSW (HNSW plus KS2) demonstrably achieves "significantly higher throughput" by efficiently pruning irrelevant nodes during graph traversal.
  • Projection-Augmented Graphs (PAG) for End-to-End Optimization: The concept is extended to Projection-Augmented Graphs (PAG), a new framework that applies KS2 during both graph construction (indexing) and querying. PAG-light offers competitive indexing time and low memory, while PAG-base focuses on high search performance.
  • Practical Impact on AI/ML Systems: This work provides practical tools to accelerate real-world applications such as recommender systems, image retrieval, and generative AI, leading to faster response times, reduced computational costs, and improved overall system performance.

About the Speaker(s)

The talk was presented by Kejing Lu, Chuan Xiao, and Yoshiharu Ishikawa. While specific titles and affiliations beyond "ICLR" are not detailed in the transcript, the content of the presentation indicates that they are researchers actively engaged in the field of high-dimensional similarity search and approximate nearest neighbors, likely from an academic or research institution given the nature of an ICLR conference paper. Their work focuses on developing novel algorithmic and systems-level solutions to fundamental problems in machine learning and data retrieval.

Reviews

→ Top-rated talks at International Conference on Learning Representations 2026

All talks from International Conference on Learning Representations 2026