liveBook · Manning

HNSW

As explained in LLM Customization and Fine-Tuning

A graph-based approximate nearest-neighbor indexing method commonly used for fast vector search.

At production scale, exhaustive vector search can become too slow. HNSW is an approximate nearest-neighbor (ANN) indexing method used to speed up top-k similarity search, trading a small amount of recall for much faster queries. section 4.5.3

HNSW is a common default because it tunes well across corpus sizes. The practical choice depends on scale: a flat NumPy array can suit tens of thousands of chunks, an in-process index such as FAISS can suit hundreds of thousands, and a vector database can support multi-tenant production workloads with millions. section 4.5.3

Pinecone, Weaviate, Qdrant, and pgvector are named systems using HNSW. IVF is an alternative associated with FAISS and is noted as better suited to corpora sharded across many machines. HNSW is presented as a practical selection, not explained through graph construction or parameter tuning. section 4.5.3

How LLM Customization and Fine-Tuning covers it

How deep it goes
Positions HNSW as a practical ANN choice but stops short of graph construction or parameter tuning.
Examples
Names Pinecone, Weaviate, Qdrant, and pgvector as systems using HNSW.
What you can do after
Evaluate HNSW as a fast ANN option against exhaustive search and IVF.
How it connects
Connects HNSW to approximate nearest-neighbor search, vector indexes, vector databases, and IVF.

Also explained in

Compare how 11 books explain HNSW →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of LLM Customization and Fine-Tuning. The section links point to the parts of the book it draws on.