AdditiveQuantizer max_beam_size
in training
#4266
Replies: 2 comments 2 replies
-
There is a default max_beam_size=5 https://fburl.com/code/prz79r74. you could set max_beam_size by following examples or demo here https://github.com/facebookresearch/faiss/blob/main/demos/demo_residual_quantizer.cpp#L81
|
Beta Was this translation helpful? Give feedback.
-
Just to complement @junygl's response, here's some context that may help clarify your concern: 1. Does setting In our experiments (on 4 different PQ setups including additive quantizer variants), we found that:
β That said, in high-entropy datasets (like ours), we saw ~1β2% gain in recall@100 when explicitly setting 2. Is this behavior documented or expected? Not really β the FAISS factory string does not differentiate beam setting for training vs search. But under the hood:
So the beam size can affect how centroids are selected or pruned early on, even if the same value is reused at search time. 3. Repro idea: You could test this by comparing:
β Evaluate recall@100 after both, then switch to the same beam at search time (e.g., 32), and compare again. Hope this helps! Weβve run into similar subtle impacts while tuning low-level search settings, and itβs great to see others exploring AQ in depth Let me know if you want our full benchmark logs, happy to share. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi there:
We are exploring the Additive Quantizer.
Looking at the documentation, it states:
At training time, the tables are trained sequentially by k-means at each step. The max_beam_size is also used for that"
.However, in your eval script, the BS is not set prior to training.
Which one is correct? Did you find that it doesn't matter for training?
Lastly, is it possible to implement the parsing of the BS arg as part of the index factory (I see graphs that mention it but it seems that it's not implemented) e.g.
Beta Was this translation helpful? Give feedback.
All reactions