Difference between revisions of "Inverted File Indexes (IVF)"

From
Jump to: navigation, search
m
m
Line 36: Line 36:
  
 
IVF is implemented alongside product quantization (PQ) for a fast and efficient approximate nearest neighbor search. IVFPQ is also commonly referred to as IVFADC in research papers. An inverted file is an index structure that is used to map contents to their locations. IVF reduces the overall search scope by arranging the entire dataset into partitions. All partitions are associated with a centroid, and every vector in the dataset is assigned to a partition that corresponds to its nearest centroid. A [https://en.wikipedia.org/wiki/Voronoi_diagram two-dimensional Voronoi diagram] is used to partition the space into cells, with each cell containing the vectors that are closest to its centroid.  The popularity of IVFPQ can be attributed to its ability to significantly reduce the retrieval cost, given that the query only needs to access a small fraction of documents guided by IVF.  
 
IVF is implemented alongside product quantization (PQ) for a fast and efficient approximate nearest neighbor search. IVFPQ is also commonly referred to as IVFADC in research papers. An inverted file is an index structure that is used to map contents to their locations. IVF reduces the overall search scope by arranging the entire dataset into partitions. All partitions are associated with a centroid, and every vector in the dataset is assigned to a partition that corresponds to its nearest centroid. A [https://en.wikipedia.org/wiki/Voronoi_diagram two-dimensional Voronoi diagram] is used to partition the space into cells, with each cell containing the vectors that are closest to its centroid.  The popularity of IVFPQ can be attributed to its ability to significantly reduce the retrieval cost, given that the query only needs to access a small fraction of documents guided by IVF.  
 +
 +
https://en.wikipedia.org/wiki/File:Euclidean_Voronoi_diagram.svg
  
 
IVFPQ is often used in combination with other techniques to further improve its performance. For example, IVFPQ together with [[Hierarchical Navigable Small World (HNSW)]] as the coarse quantizer can deliver an extremely memory-efficient and fast search that is of good accuracy for billion-scale similarity search. IVFPQ is implemented with IndexIVFPQ in Faiss, and the IndexHNSWFlat works as the coarse quantizer for IndexIVFPQ.
 
IVFPQ is often used in combination with other techniques to further improve its performance. For example, IVFPQ together with [[Hierarchical Navigable Small World (HNSW)]] as the coarse quantizer can deliver an extremely memory-efficient and fast search that is of good accuracy for billion-scale similarity search. IVFPQ is implemented with IndexIVFPQ in Faiss, and the IndexHNSWFlat works as the coarse quantizer for IndexIVFPQ.

Revision as of 10:38, 17 August 2023

YouTube search... ...Google search


Inverted File Indexes (IVF) are used in AI for similarity search and nearest neighbor search. IVF is one of the simplest and most basic indexing strategies, and it is commonly used in AI for similarity search and nearest neighbor search. By reducing the search scope, IVF can significantly improve both query speed and throughput. IVF is a partition-based indexing strategy that assigns all database vectors to the partition with the closest centroid. The goal is to map the query vector to a smaller subset of the vector space and then only search that smaller space for approximate nearest neighbors.

Inverted File Product Quantization (IVFPQ)

IVF is implemented alongside product quantization (PQ) for a fast and efficient approximate nearest neighbor search. IVFPQ is also commonly referred to as IVFADC in research papers. An inverted file is an index structure that is used to map contents to their locations. IVF reduces the overall search scope by arranging the entire dataset into partitions. All partitions are associated with a centroid, and every vector in the dataset is assigned to a partition that corresponds to its nearest centroid. A two-dimensional Voronoi diagram is used to partition the space into cells, with each cell containing the vectors that are closest to its centroid. The popularity of IVFPQ can be attributed to its ability to significantly reduce the retrieval cost, given that the query only needs to access a small fraction of documents guided by IVF.

https://en.wikipedia.org/wiki/File:Euclidean_Voronoi_diagram.svg

IVFPQ is often used in combination with other techniques to further improve its performance. For example, IVFPQ together with Hierarchical Navigable Small World (HNSW) as the coarse quantizer can deliver an extremely memory-efficient and fast search that is of good accuracy for billion-scale similarity search. IVFPQ is implemented with IndexIVFPQ in Faiss, and the IndexHNSWFlat works as the coarse quantizer for IndexIVFPQ.

Bi-Phase Enhanced IVFPQ

Bi-Phase Enhanced IVFPQ is a recent development that further improves the performance of IVFPQ for time-efficient ad-hoc retrieval. Bi-Phase Enhanced IVFPQ is a novel framework used for time-efficient ad-hoc retrieval in similarity search. It combines two types of features, namely latent topics and explicit features, to enhance the retrieval process.

Faiss library

The `IndexIVF` class in the Faiss library is an implementation of the IVF index. In the inverted file, the quantizer (an `Index` instance) provides a quantization index for each vector to be added. The quantization index maps to a list (aka inverted list or posting list), where the id of the vector is stored. The inverted list object is required only after training. If none is set externally, an `InvertedLists` instance is used automatically.

Faiss is a C++ library developed by Meta Facebook AI Research for efficient similarity search and clustering of dense vectors. It contains algorithms that search in sets of vectors of any size, up to ones that possibly do not fit in RAM. It also contains supporting code for evaluation and parameter tuning. Faiss is written in C++ with complete wrappers for Python. Some of the most useful algorithms are implemented on the GPU.

Faiss provides several similarity search methods that span a wide spectrum of usage trade-offs. It is optimized for memory usage and speed and offers a state-of-the-art GPU implementation for the most relevant indexing methods. Faiss implements a dozen index types that are often compositions of other indices. The optional GPU version has been optimized for billion-scale datasets. Faiss is commonly used in various AI applications, including image and video search, Natural Language Processing (NLP), and recommendation systems. It is also used in research and academic settings for similarity search and clustering of large datasets.