You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What is the bug?
After introducing the settings index.knn.advanced.approximate_threshold in #2188, we may encounter such a scenario that two segments exist in one single shard. Suppose Segment_1 includes a graph and segment_2 does not, and they both include the same vector X.
When we conduct a search with a vector Q, we will get two different scores for the same vector X, because score translations for ann search and exact search are sightly different. For example, for cosine metric we have a score( 1 / (2 - cos(Q, X))) in ann search, but get another score ((1 + cos(Q, X)) / 2) in exact search.
How can one reproduce the bug?
Steps to reproduce the behavior:
Create a index with nmslib and cosine distance, set index.knn.advanced.approximate_threshold to -1, so that it never build a graph:
wdongyu
changed the title
[BUG] Difference score translations for ann search and exact search
[BUG] Different score translations for ann search and exact search
Dec 11, 2024
@wdongyu thanks for reporting this issue. I think this comes because for exact search we use Lucene based score translation and for native libs it is different. @VijayanB please take a look at this and lets ensure that we use a consistent score calculations.
What is the bug?
After introducing the settings
index.knn.advanced.approximate_threshold
in #2188, we may encounter such a scenario that two segments exist in one single shard. Suppose Segment_1 includes a graph and segment_2 does not, and they both include the same vector X.When we conduct a search with a vector Q, we will get two different scores for the same vector X, because score translations for ann search and exact search are sightly different. For example, for cosine metric we have a score(
1 / (2 - cos(Q, X))
) in ann search, but get another score ((1 + cos(Q, X)) / 2
) in exact search.How can one reproduce the bug?
Steps to reproduce the behavior:
index.knn.advanced.approximate_threshold
to -1, so that it never build a graph:index.knn.advanced.approximate_threshold
to 1, so that it always build a graph:What is the expected behavior?
Should get a consistent score for the same query and data vector.
What is your host/environment?
Do you have any screenshots?
If applicable, add screenshots to help explain your problem.
Do you have any additional context?
Add any other context about the problem.
The text was updated successfully, but these errors were encountered: