liveBook · Manning

Binary quantization

As explained in AI-Powered Search

Binary quantization is a quantization technique that represents each embedding feature with a single binary bit, typically 0 or 1.

Binary quantization compresses each embedding feature into a single bit, usually 0 or 1. It reduces vector storage and similarity-computation cost, trading some initial recall for faster, smaller vector search. section 13.7 section 13.7.2

A threshold assigns the bit: values on one side become 0 and values on the other become 1. A zero-centered threshold can work when feature values are evenly distributed; per-feature medians or similar thresholds help with non-uniform distributions. Model-based binary representations can preserve meaning better by learning the encoding from the full input context. section 13.7.2

A practical binary-search pipeline typically:

  • Quantizes document embeddings and stores them as unsigned binary values. section 13.7.2
  • Builds a binary index and searches it with similarly quantized query embeddings, calibrated against document embeddings when needed. section 13.7.2
  • Reranks the strongest candidates with full-precision vectors to recover recall and improve final relevance. section 13.7 section 13.7.5

FAISS benchmark

A FAISS binary index reduced search time by 83.38% and index size by 96.87%; initial recall was 0.6044, while reranked recall reached 1.0. Combining binary quantization with IVF, reduced-dimensionality embeddings, and reranking produced a 99.09% faster search, a 98.22% smaller index, and 0.7244 reranked recall. section 13.7.2 section 13.7.5

Figure 13.9 Quantizing data: full precision, reduced scalar precision, and binary precision
figure

Compare full-precision, scalar, and binary representations visually before choosing a compression level. section 13.7

How AI-Powered Search covers it

How deep it goes
Explains thresholds, distribution effects, FAISS indexing, benchmarking, and reranking, but does not demonstrate model-based encoding.
Examples
Demonstrates thresholded embeddings, FAISS binary indexes, benchmark metrics, and combined IVF, reduced-dimensionality, and reranking pipelines.
What it assumes
Assumes embedding vectors and vector similarity search, while defining quantization and its storage-computation trade-off.
What you can do after
Implement binary embedding indexes with FAISS and evaluate speed, size, recall, and reranked recall.
How it connects
Connects binary quantization with embeddings, approximate-nearest-neighbor search, scalar quantization, Matryoshka Representation Learning, and reranking.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of AI-Powered Search. The section links point to the parts of the book it draws on.