Dimensionality-Reduction Techniques for Approximate Nearest Neighbor Search: A Survey and Evaluation

Zeyu Wang, Haoran Xiong, Qitong Wang, Zhenying He, Peng Wang, Themis Palpanas, Wei Wang

Abstract

As Large Language Models (LLMs) and deep learning push vector embeddings into thousands of dimensions, the "curse of dimensionality" makes Approximate Nearest Neighbor Search (ANNS) prohibitively slow. This paper surveys and evaluates six dimensionality-reduction (DR) techniques across two integration frameworks: In-place transformation and Out-of-place acceleration. Our evaluation demonstrates that while DR can speed up search by up to 6.3x, its effectiveness is contingent on dataset characteristics and hardware acceleration. We introduce Fudist, a library designed to integrate these techniques into standard ANNS workflows.

Introduction

In modern AI applications, objects such as images, text, and audio are represented as dense, high-dimensional vectors. Finding the "top-k" most similar items—a process known as Approximate Nearest Neighbor Search (ANNS)—is a foundational task for recommendation engines and retrieval-augmented generation (RAG). However, as embedding models evolve, dimensionality ($D$) has increased significantly (e.g., Alibaba’s Qwen2 uses 3584-D).

The primary bottleneck in ANNS is the distance calculation, which scales linearly with the number of dimensions. In popular graph-based indexes like HNSW, distance calculations can account for 60%–90% of total query time. This study investigates whether compressed, lower-dimensional representations can be used to "short-circuit" these expensive calculations without compromising search accuracy.

Architectural Frameworks

The authors categorize the application of dimensionality reduction into two primary architectural frameworks:

  1. In-Place Transformation: The dataset is transformed (e.g., via PCA) before the index is built. During search, distances are calculated dimension-by-dimension. This allows for "early termination"—if the partial distance calculated using the first few dimensions already exceeds a certain threshold, the candidate can be discarded immediately.
  2. Out-of-Place Acceleration: The original high-dimensional index is maintained, but an auxiliary low-dimensional table is created. The system uses the low-D version to estimate distances and "prune" candidates that are unlikely to be in the top-k results.
Comparison of (a) In-place transformation and (b) Out-of-place acceleration frameworks for ANNS.

Dimensionality-Reduction Techniques

The study evaluates six specific techniques across different categories:

  • Classical: Principal Component Analysis (PCA) and Discrete Wavelet Transform (DWT).
  • Randomized: ADSampling and PM-LSH (based on random projections).
  • Machine Learning: Optimized Product Quantization (OPQ).
  • Deep Learning: SEANet* (an adapted Series Approximation Network).

The following table summarizes the theoretical costs and guarantees of these methods:

Theoretical comparison of dimensionality-reduction techniques, including accuracy guarantees and computational overheads.

Experimental Setup and Results

The techniques were tested using Fudist, a pluggable library, across six public datasets ranging from 96-D (Deep) to 4096-D (Trevi). Queries were generated using the Steiner-Hardness method to ensure a rigorous evaluation.

Key findings include:

  • The 800-Dimension Rule: DR techniques provide significant gains primarily for vectors with $D > 800$. Below this threshold, the framework's overhead often negates the savings in distance calculation.
  • The SIMD Paradox: Modern CPUs use SIMD (Single Instruction, Multiple Data) to accelerate distance calculations. When SIMD is active, the relative benefit of DR decreases because the baseline calculation is already highly optimized.
  • DWT Performance: Discrete Wavelet Transform (DWT) emerged as a highly effective, lightweight tool. On the 4096-D Trevi dataset, DWT improved HNSW performance by 6.3x at 98% recall, requiring zero extra memory.
  • Deep Learning Potential: SEANet* provided the best distance estimation accuracy on several datasets, though it remains computationally expensive and struggled with extremely sparse data like MNIST.

Conclusion

There is no "silver bullet" for dimensionality reduction in ANNS. While PCA and DWT excel on structured data, OPQ and SEANet* are better suited for dense, complex embeddings. Future research should focus on automated selection algorithms that can dynamically choose the optimal DR strategy based on dataset distribution and hardware capabilities.

Summary updated

BibTeX
@article{wang2024dimensionality,
  author = {Zeyu Wang and Haoran Xiong and Qitong Wang and Zhenying He and Peng Wang and Themis Palpanas and Wei Wang},
  title = {{Dimensionality-Reduction Techniques for Approximate Nearest Neighbor Search: A Survey and Evaluation}},
  journal = {IEEE Data Eng. Bull.},
  year = {2024},
}
Figure