k-NN search with different ef_construction, ef_search and m return same results

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):
OpenSearch 2.11.0 on AWS

Describe the issue:
We have 2 k-NN indices of the type nmslib HNSW, each index contains more than 30 millions of vectors, the vectors are the same, with the dimension 256. They are generated outside of OpenSearch.

Index 1:
ef_construction: 256
ef_search: 100
m: 16
space type: l2

Index 2:
ef_construction: 1024
ef_search: 1024
m: 64

On k-NN search with k=100, we fetch 100 results from both indexes, for the same queries the results are always the same with the same score.

Why the parameters ef_construction, ef_search and m don’t change the results? How to improve the search relevance?

Configuration:

Relevant Logs or Screenshots:

Hi @Garance

On k-NN search with k=100, we fetch 100 results from both indexes, for the same queries the results are always the same with the same score.

If same documents are retrieved then score of the documents will be same as they have same vectors.

Why the parameters ef_construction, ef_search and m don’t change the results? How to improve the search relevance?

This is a very good question. The simple answer here is, if with lower values of efs and m you are getting a very high recall then even when you increase the values for efs and m you won’t see a change in accuracy. So, can you please clarify what recall you are getting with different values of efs.

Hi @Navneet, thank you for the response. After some tests I found that efs and m don’t change the result score, as your explanation.
Otherwise we haven’t measured the recall, I think the recall is high, because I don’t find a relevant document outside of the result list. By the way, how to measure the recall?

I tested the faiss engine with the same vectors, the search results are very similar to HNSW ones.

I continue to look for the ways to improve accuracy and relevance for k-NN search, such as change LLM models, space type, k… Are there any efficient methods?

In your case, taking manual way or setting relevance score of retrived documents from search API can be used as measurement.

Thanks, I read these documents and I will calcul relevance score.