← All questions
Retrieval & EmbeddingsMedium· Data Structures· High-Dimensional Search· Algorithms

Why is a kd-tree not suitable for high-dimensional sema...

The pruning test |qi - s| > r fails to exclude nodes because the radius r grows with the square root of the dimensions, while coordinate gaps remain small. At 768 dimensions, the tree traversal provides no benefit over a linear scan. The performance degrades significantly, and the bookkeeping required for the tree structure adds unnecessary latency compared to a simple scan.

Code playground (Python)