[FEA] Strongly filtered IVF methods
Nobody has claimed this yet.
- Dominant language
- Cuda
- Stars
- 854
- Forks
- 236
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 62
Description
IVF-Flat and IVF-PQ have been observed to yield low recall when the ratio of filtered-out values is high. The most likely reason for this is the fixed n_probes parameter: both methods cannot return more valid elements than available in the probed clusters.
One obvious workaround from the user side is to set a very large n_probes parameter when they anticipate a high filtering ratio. A rule of thumb could be as follows n_probes = C * k * (n_lists / n_rows) / (1 - filtered_out_ratio), where C is a constant reflecting an expected number of processed dataset rows per candidate.
Alternatively, we can change the behavior of our IVF methods to adjust n_probes based on the number of found candidates.
- For this, rather than selecting
n_probesclusters during the coarse search, we can simply sort all clusters by their distance to queries. - Change the loop condition in the fine search to allow stopping based on the number of topk sort iterations performed (as an indirect indication of number of rows processed).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with cpp/src/neighbors/ivf_pq/ivf_pq_search.cuh around the coarse search and cpp/src/neighbors/ivf_pq/ivf_pq_compute_similarity_impl.cuh around the fine-search loop. Compare the fixed n_probes behavior with the proposed cluster sorting and stopping approaches, then determine how filtered IVF-Flat and IVF-PQ searches should adapt. Done means the selected behavior addresses low recall under high filtering ratios.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- performance, search
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100