-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to transfer the IVF index from one PQ compression setting to another? #2455
Comments
Yes it is possible but somewhat error-prone. For these cases, OPQx,IVFy,PQz -> OPQx',IVFy',PQz'
After the transfer is done the remaining untrained part (eg. the PQ) can be trained by calling |
Demo here: |
This is fascinating. Thank you for taking the time to write up a notebook. If I understand it correctly, the IVF coarse quantizer uses the intermediate vectors with dimension If In your notebook, the OPQ trained for |
No in my notation, x means M or M_D both work about your last question: I am not sure, it should be tried out. |
Asked in the comment section of the notebook: For a sanity check I tried to copy everything:
I can confirm PreTransforms and pq centroids are identical, and codes computed from just the PQ modules are identical:
However the
And the whole index level
Also the reconstruction error is different, sometimes better/worse when it happens. Here I repetitively run below script:
Most of the time
Sometimes
|
I think I have an answer to this now from reading the source code. The |
Hello,
I have trained an
OPQ128_512,IVF262144_HNSW32,PQ128x6
, and it took some time! Would it be possible to avoid training again, but to just transfer the IVF index to another index, but with a different PQ compression, such asOPQ128_512,IVF262144_HNSW32,PQ128
, orOPQ256_1024,IVF262144_HNSW32,PQ256
?And to a somewhat related note, would it be possible to take out the PQ/SQ compression module from a trained index and use as an embedding size-reduction preprocessor? We found SQ8 yields about the same accuracy for similarity comparisons as the original float32 vectors at 1/4 the size, so that can be quite attractive for storage purposes.
Thank you!
The text was updated successfully, but these errors were encountered: