jvector icon indicating copy to clipboard operation
jvector copied to clipboard

Experiment with VQ coarse quantization for PQ

Open jbellis opened this issue 7 months ago • 0 comments

CAGRA performs compression with two stages: Vector Quantization (VQ), where kmeans is applied to the full-dimensional vectors to create a codebook of coarse cluster centers

Product Quantization (PQ), where the closest VQ centroid is subtracted from each vector before quantizing the "residuals" with PQ

It looks like this is motivated by the fact that IVF-PQ uses the coarse centers for the IVF stage, and after that, hey, they had a hammer and this was a nail. Still, it might be worth applying to DiskANN-style PQ as well, it does seem to improve accuracy in my brief experiments with the CAGRA codebase. Not immediately obvious to me what the effect on speed would be.

jbellis avatar Jul 11 '24 22:07 jbellis