Introduction
Finding the $k$-nearest neighbors ($k$-NN) to a query point is a cornerstone of modern machine learning, computer vision, and robotics. However, as data dimensionality grows, traditional algorithms encounter the "curse of dimensionality," where search performance degrades to the point of being slower than a brute-force exhaustive search. This paper identifies the root cause as space partitioning—the strategy used by methods like k-d trees and Locality-Sensitive Hashing (LSH). Space partitioning divides the vector space into discrete cells, which in high dimensions leads to either an exponential explosion of cells or cells so large they offer no computational benefit. Furthermore, the "boundary problem"—where a neighbor is missed because it lies just across a cell border—requires searching adjacent cells, a task that is computationally intractable in high-dimensional spaces.
The DCI Framework: Beyond Discrete Buckets
To overcome these limitations, the authors propose Dynamic Continuous Indexing (DCI). Instead of partitioning space into discrete boxes, DCI projects data points onto multiple random 1D lines. For each line, it maintains a continuous index—such as a binary search tree or skip list—that orders points based on their 1D projection values.
At query time, DCI utilizes a "composite index" to track points that appear close to the query across multiple projections simultaneously. Because the indices are continuous, DCI avoids artificial cell boundaries entirely. The algorithm retrieves a small set of highly probable candidate points and performs exact distance calculations only on this subset.
As illustrated in Figure 1, the core insight is that the relative order of points across multiple random projections provides a strong enough signal to identify nearest neighbors. The algorithm reasons about the probability that a point further away in the original space might appear closer in a 1D projection, using multiple directions to narrow down the search to a high-confidence region.
Adaptive Stopping via Statistical Inference
A key innovation in DCI is its data-dependent stopping condition. Rather than retrieving a fixed number of candidates, DCI employs statistical hypothesis testing. By leveraging the randomness of the projection directions, the algorithm can infer the probability that an unseen point is closer than the current best candidates. It stops searching once it reaches a user-defined confidence level that the true nearest neighbors have been found. This allows DCI to naturally adapt to the local density of the data, providing mathematical guarantees for early stopping.
Empirical Evaluation and Results
The authors evaluated DCI against LSH using high-dimensional image datasets: CIFAR-100 (3,072 dimensions) and MNIST (784 dimensions). These datasets represent the high-dimensional regimes where traditional tree-based methods typically fail.
As shown in Figure 2, DCI demonstrates superior efficiency and scalability:
- Search Efficiency: DCI required between 61.3% and 78.7% fewer candidate points than LSH to achieve the same approximation quality, serving as a hardware-independent proxy for faster search times.
- Memory Savings: DCI utilized less than 1/20th of the memory required by Exact Euclidean LSH, a critical advantage for large-scale applications.
- Theoretical Scaling: DCI's query time scales linearly with ambient dimensionality but sub-linearly with the intrinsic dimensionality and dataset size.
- Dynamic Tuning: Unlike LSH, which requires rebuilding hash tables to change accuracy levels, DCI allows users to tune the speed-accuracy tradeoff on-the-fly for each query by simply adjusting the stopping condition.
Conclusion
Dynamic Continuous Indexing represents a significant shift away from traditional space-partitioning methods. By combining continuous 1D indices with a robust statistical stopping condition, DCI offers a memory-efficient, fast, and flexible solution for high-dimensional $k$-NN search. Its ability to handle dynamic dataset updates without retraining makes it particularly well-suited for online learning and streaming data environments.
Summary updated