Skip to content
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

The correctness of HNSW implementation for HNSW::upper_beam != 1 #3610

Closed
alexanderguzhva opened this issue Jul 3, 2024 · 1 comment
Closed

Comments

@alexanderguzhva
Copy link
Contributor

alexanderguzhva commented Jul 3, 2024

Summary

I wonder whether this (

int candidates_size = upper_beam;
) branch in HNSW is designed in the way as it is implemented.

Currently, it seems that HNSW may use a beam search, which is controlled by a field HNSW::upper_beam. According to the code, upper_beam serves not only as a beam search parameter, but as a replacement of ef parameter, so it is used across all HNSW levels. Logically speaking, I would expect upper_beam to control upper levels only, and leave ef for the last level. So,

MinimaxHeap candidates_upper_levels(upper_beam);
for (int level = max_level; level >= 1; level--) {
    // use `upper_beam`
}

// last level uses `ef`
MinimaxHeap candidates_last_level(ef);
candidates_last_level.copy_from(candidates_upper_levels);
...

@mdouze Could you please comment on the topic? Thanks.

@asadoughi
Copy link
Contributor

Closing as it was addressed in #3692.

@asadoughi asadoughi closed this as not planned Won't fix, can't repro, duplicate, stale Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants