Repository navigation
fix: keep the query weight at 1.0 for colliding miniCOIL OOV words - #1
Merged
joein merged 1 commit intoDec 2, 2026
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR targets the branch of qdrant#881 and changes how queries weight colliding out-of-vocabulary (OOV) words.
When two OOV words in a query hash to the same index, the query now keeps weight 1.0 there. qdrant#881 sums them to 2.0. Documents already sum the two words' tf at the shared index, so with 1.0 a query that has both words scores the same as it would without the collision. With 2.0 the shared index counts twice.
Bm25.query_embedalso gives 1.0 to an index that two tokens share.An example with
Qdrant/minicoil-v1: the document "bats screech token49516 at night token56101 token56101" has 1.6467 + 1.8836 = 3.5303 at index 1433372619. The query "token49516 token56101" scores 3.53 there with weight 1.0 and 7.06 with weight 2.0.Other changes:
tests/test_sparse_vectors_converter.pyto match the module name. fix: preserve miniCOIL inputs when merging normalized words qdrant/fastembed#878 adds a file with the same name, so the second of the two PRs to land has to merge its tests into that file.test_minicoil_colliding_oov_wordstotests/test_sparse_embeddings.py. It checks documents and queries throughSparseTextEmbedding("Qdrant/minicoil-v1").# since miniCOIL IDs start with 1comments and explained the merge in the OOV comments.I also rebased qdrant#881 on the latest main. The rebase had no conflicts.
The converter tests and the miniCOIL tests in
tests/test_sparse_embeddings.pypass locally. Ruff and mypy pass, and pyright reports nothing new.