A Versatile Implementation of HNSW for Efficient Approximate Nearest Neighbor Search

In this thesis, I present the implementation of a Hierarchical Navigable Small World (HNSW) graph for approximate nearest neighbor (ANN) search, developed in Rust and integrated into the KANNolo library developed by the Consiglio Nazionale delle Ricerche (CNR) and University of Pisa. This implementation is designed for versatility, supporting both dense and sparse datasets, as well as two different types of quantizers. The primary role of a quantizer is to encode vectors, reducing dimensionality for more efficient computation. One of the supported quantizers does not encode the vectors, allowing the HNSW index to work with the original data, while the other employs the Product Quantization (PQ) process to efficiently encode the vectors. The HNSW implementation is adaptable across different datasets and quantizers, as they just need to implement the Dataset and Quantizer traits, respectively. These traits are defined and implemented in the KANNolo library to establish the required functionality. This design ensures future extensibility, allowing the HNSW index to support new datasets or quantizers by simply implementing these traits, making it highly adaptable to evolving requirements in similarity search tasks.

Publication Details

Journal
Electronic Theses and Dissertations Repository (University of Pisa)
Published
2024-10-06
Primary Topic
X-ray Diffraction in Crystallography
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

A Versatile Implementation of HNSW for Efficient Approximate Nearest Neighbor Search

Electronic Theses and Dissertations Repository (University of Pisa)
X-ray Diffraction in Crystallography
article

A Versatile Implementation of HNSW for Efficient Approximate Nearest Neighbor Search

article en

Abstract

In this thesis, I present the implementation of a Hierarchical Navigable Small World (HNSW) graph for approximate nearest neighbor (ANN) search, developed in Rust and integrated into the KANNolo library developed by the Consiglio Nazionale delle Ricerche (CNR) and University of Pisa. This implementation is designed for versatility, supporting both dense and sparse datasets, as well as two different types of quantizers. The primary role of a quantizer is to encode vectors, reducing dimensionality for more efficient computation. One of the supported quantizers does not encode the vectors, allowing the HNSW index to work with the original data, while the other employs the Product Quantization (PQ) process to efficiently encode the vectors. The HNSW implementation is adaptable across different datasets and quantizers, as they just need to implement the Dataset and Quantizer traits, respectively. These traits are defined and implemented in the KANNolo library to establish the required functionality. This design ensures future extensibility, allowing the HNSW index to support new datasets or quantizers by simply implementing these traits, making it highly adaptable to evolving requirements in similarity search tasks.

Electronic Theses and Dissertations Repository (University of Pisa)
Industry, innovation and infrastructure
Openalex Percentile: Top 68%
X-ray Diffraction in Crystallography
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.