Skip to content

fix: exclude all-zero-vector points from ANN Recall sample - #444

Open
itsevezhao wants to merge 1 commit into
qdrant:masterfrom
itsevezhao:fix/exclude-zero-vector-points-ann-recall
Open

fix: exclude all-zero-vector points from ANN Recall sample#444
itsevezhao wants to merge 1 commit into
qdrant:masterfrom
itsevezhao:fix/exclude-zero-vector-points-ann-recall

Conversation

@itsevezhao

Copy link
Copy Markdown

All-zero-vector points (e.g. bookkeeping markers) score 0.0 against every query, skewing the recall average in "Check Index Quality".

Over-fetches 2x and filters out all-zero vectors before taking SAMPLE_SIZE.

Testing evidence: verified against a live Qdrant cluster (6-shard test collection, 2000 points, 20 seeded all-zero vectors) that all-zero-vector points are returned in raw sample results and not excluded server-side — 10/20 appeared across 20 sample draws, confirming client-side filtering is required.

Added a test asserting a zero-vector point never reaches the recall-checking query. npm run lint, npm run format:check, and npm test (190/190) all pass.

All-zero-vector points (e.g. bookkeeping markers) score 0.0 against
every query, skewing the recall average in "Check Index Quality".
Over-fetches 2x and filters them out before taking SAMPLE_SIZE.
@itsevezhao

Copy link
Copy Markdown
Author

@generall could you take a look? Same panel you reviewed/merged in #373 and #377 — this fixes all-zero-vector points (bookkeeping markers) skewing the recall average in "Check Index Quality".

@itsevezhao

Copy link
Copy Markdown
Author

The "Check the source code" failure is unrelated to this diff — npm audit --production is failing on a high-severity js-yaml advisory (GHSA-2883-xcg3-v3hh) published 2026-09-08, two days after master's last green run of this job. package.json/package-lock.json are untouched here; master would fail the same way if CI reran on it today.

@generall

Copy link
Copy Markdown
Member

What problem exactly are you trying to solve?

@itsevezhao

itsevezhao commented Sep 10, 2026

Copy link
Copy Markdown
Author

What problem exactly are you trying to solve?

All-zero-vector points (e.g. bookkeeping/marker points) score 0.0 against every query vector — using one as the query for the per-point recall check produces a degenerate result, which skews the panel's average. We hit this in production: a real collection had marker points with zero vectors, and "Check Index Quality" reported artificially lower recall because of them.

Verified Qdrant doesn't exclude these server-side: seeded a test collection with known all-zero-vector points, and they show up in raw scroll/sample results every time. So the panel needs to filter them client-side — that's what this PR does.

@generall

Copy link
Copy Markdown
Member

why do you have zero-vectors in the collection in the first place? What are bookkeeping/marker points?

I don't think we will include ad-hoc exclusion of arbitrary vectors based on this example. Maybe having low recall in this case is expected and we want to let users know that something is wrong with their collection

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants