Product Quantisation for Vector Compression

hard
Unit 26 · Vector Search0/0 to milestone

A 128-dimensional float32 vector takes 512 bytes. Product quantisation (PQ) compresses it to a handful of bytes: split each vector into m sub-vectors, learn a small codebook of k centroids per sub-space, and store just the centroid ids.

Pro problem

Unlock this and every premium problem across all tracks — plus hidden-test grading, advanced AI engineering modules and new content every week.

Start 7-day free trial
solution.py · Python 3.13
Run your code to see results. ⌘↵ to run · ⌘⇧↵ to submit
Product Quantisation for Vector Compression · TechGradify