Vector DB & ANN · advanced

Product Quantization

Compress vectors into sub-space codebooks for tiny memory footprint.

vector-dbquantization

Mental model

PQ splits each vector into m sub-vectors and replaces each with the id of its nearest centroid in a per-sub-space codebook. With 8-bit codes that is one byte per sub-vector: a 1536-d float32 vector (6 KB) becomes roughly 48-192 bytes depending on m — a 30-100x cut, paid for with approximate distances.

How to study Product Quantization

Begin by restating the mental model in your own words, then connect it to a concrete system you have built or operated. Name the mechanism, the constraint it addresses, and the trade-off it introduces. Use Product Quantization for Nearest Neighbor Search (Jégou et al.) to check details, but close the source before writing your explanation. Retrieval is the learning step; rereading is only preparation.

Next, compare Product Quantization with Recall / Latency Tradeoffs. Ask what changes in correctness, latency, resource use, operability, and failure recovery. Complete PQ codebook footprint and preserve the command, input, output, and one failed attempt as evidence. Finish by explaining the idea without jargon to someone who has not studied the track.

Proof of understanding

  • Explain the mechanism from first principles and identify the state it reads or changes.
  • Give one situation where the concept is the right choice and one where it is not.
  • Predict a realistic failure mode before running the drill, then compare the prediction with evidence.
  • Connect the result to a roadmap or build artifact instead of treating the concept as isolated trivia.

Where it matters

FAISS IVF-PQ, billion-scale vector search under a memory budget.

Common mistakes

  • Using PQ without IVF and losing the speedup
  • Too-aggressive compression that destroys recall

Learn from primary sources

Practice and explain it back

PQ codebook footprint

1536-d vector, m=48 subspaces, 256 centroids per subspace, 1 byte code/subspace. Bytes per vector vs raw float32?

Expected evidence: 48 bytes vs 6144 bytes (~128× compression).

Open the interactive drill →

Review prompts

  • How does product quantization shrink vector memory?

Build evidence

Use a roadmap capstone to turn this concept into working evidence.

Prerequisites

Related concepts

Learning paths

None assigned yet.