TL;DR
This paper introduces HAKES, a novel distributed vector database designed for efficient and scalable Approximate Nearest Neighbor (ANN) search on high-dimensional embedding vectors. HAKES tackles the challenges of high build costs, read-write contention, and poor scalability in existing vector databases by employing a two-stage filter-and-refine index with learned compression and a disaggregated architecture.
What Problem Does This Paper Address?
Modern AI applications, especially those involving retrieval-augmented generation (RAG), rely heavily on transforming complex data (text, images, audio) into high-dimensional embedding vectors. Finding similar vectors (ANN search) is crucial for these applications. While graph-based ANN indexes offer good performance, they are expensive to build, struggle with concurrent updates (reads and writes), and don't scale well across multiple servers. This creates a bottleneck for real-world, dynamic applications that require both fast searches and frequent data updates.
Methods
HAKES introduces a novel ANN index called HAKES-Index with a two-stage design:
- Filter Stage: This stage uses aggressively compressed vectors to quickly narrow down the search space. Key techniques include:
- Dimensionality Reduction: A learned transformation matrix reduces vector dimensions.
- Product Quantization (PQ): Vectors are compressed into compact codes.
- Inverted File (IVF): Vectors are partitioned based on centroids.
- Learned Compression Parameters: A lightweight, self-supervised machine learning technique fine-tunes the dimensionality reduction and PQ parameters to optimize the similarity score distribution, ensuring true nearest neighbors are likely to be in the filtered set.
- Early Termination: A dynamic check adapts the search process to terminate early when sufficient candidates are found, further boosting efficiency.
- Refine Stage: This stage uses the full-precision vectors of the filtered candidates to ensure high recall.
HAKES also features:
- Decoupled Index Parameters: Separate parameters are used for compressing vectors during inserts and for searching, minimizing write contention and allowing learned parameters to be applied without re-indexing.
- Disaggregated Architecture: The filter and refine stages are separated into distinct worker types (IndexWorkers and RefineWorkers) that can be scaled independently, improving overall system scalability and throughput.
Datasets
The paper uses several deep embedding datasets for evaluation:
- 1-million scale datasets: DPR-768, OPENAI-1536, MBNET-1024, RSNET-2048, GIST-960.
- 10-million scale datasets: DPR-768-10m, E5-1024-10m.
- Drift datasets: Derived from ImageNet, used to test robustness to data distribution changes.
- Out-of-Distribution (OOD) dataset: Text-to-Image 10M, for evaluating performance on cross-modal search.
Key Insights and Ideas
- Learned Compression for Recall: The core innovation is using machine learning to fine-tune compression parameters not just for vector accuracy, but for preserving the distribution of similarity scores. This is crucial for ensuring that the filter stage returns high-quality candidates, thereby boosting recall in the refine stage.
- Two-Stage Design is Key: Separating the search into a fast, compressed filter and a precise refine stage is essential for balancing speed and accuracy, especially with high-dimensional data.
- Decoupling for Writes: Maintaining separate parameters for indexing and searching is a clever way to handle concurrent writes without sacrificing search performance or requiring expensive re-indexing.
- Disaggregation for Scalability: Separating compute and memory for the filter and refine stages allows for independent scaling, a critical factor for large-scale vector databases.
- High-Dimensional Data Matters: The paper emphasizes that traditional ANN benchmarks and datasets may not reflect the challenges of modern, high-dimensional embedding vectors, highlighting the need for specialized solutions like HAKES.
Key Results
- High Recall and Throughput: HAKES-Index outperforms state-of-the-art ANN indexes in the high recall region.
- Scalability: The HAKES distributed database achieves up to 16x higher throughput than existing distributed vector databases.
- Read-Write Performance: HAKES demonstrates superior performance under concurrent read-write workloads compared to graph-based indexes, with partitioning-based approaches showing better resilience to updates.
- Learned Compression Benefits: Table 2 shows that learned compression significantly boosts performance, with additional gains from scalar quantization and early termination.
- Robustness: HAKES shows tolerance to data drift, maintaining performance even with changes in data distribution.
- Efficient Index Construction: HAKES-Index construction is significantly faster than graph-based indexes like HNSW.
Limitations and Future Work
- Cross-Modal Performance: While HAKES performs well on embedding vectors from the same modality, its performance on cross-modal datasets (e.g., text-to-image search) is limited by the k-means based partitioning. The authors suggest that a new space partitioning scheme is needed for such scenarios.
- Low-Dimensional Data: HAKES is optimized for high-dimensional data. On very low-dimensional datasets (like SIFT), its advantage diminishes, and graph-based indexes or other specialized methods might perform comparably or better.
- Index Rebuilding: While HAKES is efficient to build, significant changes in dataset size due to insertions and deletions might still necessitate rebuilding the index for optimal performance.
- Future Work: The paper suggests exploring new space partitioning schemes for cross-modal search and further optimizing HAKES for low-dimensional datasets.
Summary updated