Skip to content
Last Dictionary

FAISS

proper nounAlso: Facebook AI Similarity Search

In plain wordsA free software library from Meta for searching huge collections of embeddings very fast, on ordinary processors or graphics cards. Many AI search systems use it under the hood.

  1. Facebook AI Similarity Search, an open-source toolkit from Meta's research lab for finding the nearest neighbors of a query vector in collections of up to billions of dense vectors, such as embeddingstext embedding, n.: A list of numbers that captures what a piece of text means, so that texts with similar meanings get similar lists. Computers use them to search, sort and group text by meaning.; its core is written in C++ with a Python interface, and its heaviest algorithms also run on GPUs. It offers exact (flat) search and a toolkit of approximateapproximate nearest neighbor search, n.: A family of shortcuts for finding the most similar items in a huge collection without checking every one — accepting an occasional miss in exchange for answers thousands of times faster. indexes — inverted-file (IVF) partitioning by k-meansk-means clustering, n.: A simple way to split data into a chosen number of groups: guess group centers, assign every point to its nearest center, move each center to the middle of its points, and repeat., product quantizationproduct quantization, n.: A compression trick for embeddings: chop each long list of numbers into short pieces and replace each piece with the ID of its closest typical piece, shrinking storage many times over while keeping search workable. and other compressed encodings, HNSWHNSW, abbr.: A popular way to organize millions of embeddings for fast similarity search: a layered web of links where the search starts with long jumps on sparse top layers, then takes ever shorter steps. and other graph indexes — that can be composed, for example as an IVF index storing PQ codes, and built from short 'index factory' strings. It also provides k-means, PCA and tools for tuning the trade-off between speed, memory and recallrecall@k, n.: A score for search systems: of all the right answers that exist, what fraction showed up in the top k results? Higher means fewer relevant items were missed.. FAISS is a library, not a database: it leaves persistence, metadata filtering and distribution to the applications and vector databasesvector database, n.: A database built to store embeddings — lists of numbers that represent meaning — and to quickly find the stored items most similar to a new one. It is the memory behind many AI search tools. built on it.

    For 50 million vectors we built a FAISS IVF index with PQ codes on one GPU in under an hour.

Origin

Developed at Facebook AI Research (now Meta's Fundamental AI Research) by Hervé Jégou, Matthijs Douze, Jeff Johnson and colleagues and open-sourced in 2017. Its GPU design was described in 'Billion-scale similarity search with GPUs' (arXiv, February 2017), and a 2024 paper, 'The Faiss library', documented the whole toolkit.

Usage note

The project itself spells the name 'Faiss'.

Related

See also
  • approximate nearest neighbor searchapproximate nearest neighbor search, n.: A family of shortcuts for finding the most similar items in a huge collection without checking every one — accepting an occasional miss in exchange for answers thousands of times faster.
  • vector searchvector search, n.: Searching by closeness instead of exact match: the query and all stored items are lists of numbers, and the search returns the items whose numbers are most similar to the query's.
  • vector databasevector database, n.: A database built to store embeddings — lists of numbers that represent meaning — and to quickly find the stored items most similar to a new one. It is the memory behind many AI search tools.
  • product quantizationproduct quantization, n.: A compression trick for embeddings: chop each long list of numbers into short pieces and replace each piece with the ID of its closest typical piece, shrinking storage many times over while keeping search workable.
  • HNSWHNSW, abbr.: A popular way to organize millions of embeddings for fast similarity search: a layered web of links where the search starts with long jumps on sparse top layers, then takes ever shorter steps.
  • GPUGPU, abbr.: A computer chip first designed to draw video-game graphics that turned out to be ideal for AI, because it can do thousands of simple calculations at the same time.

Sources

  1. Johnson, J., Douze, M. & Jégou, H. (2019). Billion-scale similarity search with GPUs. IEEE Transactions on Big Data 7(3): 535–547. arXiv:1702.08734. arxiv.org/abs/1702.08734
  2. Douze, M. et al. (2024). The Faiss library. arXiv:2401.08281. arxiv.org/abs/2401.08281v2
  3. facebookresearch/faiss (GitHub repository). github.com/facebookresearch/faiss

Mentioned in

approximate nearest neighbor searchapproximate nearest neighbor search, n.: A family of shortcuts for finding the most similar items in a huge collection without checking every one — accepting an occasional miss in exchange for answers thousands of times faster., HNSWHNSW, abbr.: A popular way to organize millions of embeddings for fast similarity search: a layered web of links where the search starts with long jumps on sparse top layers, then takes ever shorter steps., vector databasevector database, n.: A database built to store embeddings — lists of numbers that represent meaning — and to quickly find the stored items most similar to a new one. It is the memory behind many AI search tools., product quantizationproduct quantization, n.: A compression trick for embeddings: chop each long list of numbers into short pieces and replace each piece with the ID of its closest typical piece, shrinking storage many times over while keeping search workable.