lucene icon indicating copy to clipboard operation
lucene copied to clipboard

Allow for different query bit sizes for asymmetric quantized vector indices

Open benwtrent opened this issue 10 months ago • 5 comments

Description

I have noticed some interesting results where:

  • 4 bit queries are actually way too much information and even single bit is good enough
  • having 8 bit queries can really help refine results, kick starting a refining process.

I wonder if we can expose a parameter or something at query time?

It gets tricky as it pre-supposes there is an "optimized" way to do variable bit queries of certain sizes. I also suspect we will want to restrict it to 1, 2, 4, 8 query bits against a quantized index.

Would we also want to restrict it to where the query bits are always larger than the encoding bits? (I would suspect so...).

It SEEMS the best place to have this configuration would be within the "SearchStrategy" interface. This can give hints from the query to the format on how things should be done.

benwtrent avatar Jan 26 '26 17:01 benwtrent

Hello maintainers 👋,

I’d like to work on this issue — PLEASE ASSIGN THIS ISSUE TO ME

Proposed direction

It seems the best place for this configuration would be the SearchStrategy interface, allowing the query layer to provide hints to the format about:

desired query bit width

whether the query is intended for coarse recall vs refinement

This would keep the logic centralized, avoid leaking query-specific tuning into lower-level components, and allow future experimentation without API churn.

If this direction sounds reasonable, I’m happy to prototype an API shape, validate constraints, and report back with benchmarks and follow-up PRs.

Thanks!

ML-dev-crypto avatar Feb 04 '26 18:02 ML-dev-crypto

@ML-dev-crypto I enjoy your eagerness, but one item at a time is perfect. Simply taking all open issues seems unfair to all other potential contributors.

benwtrent avatar Feb 04 '26 21:02 benwtrent

Hey @benwtrent, would it be ok if I worked on this?

This seems really interesting, but being mindful of the scope, I’d like to keep it incremental across a couple of small PRs.

As a first step, I just wanted to ask: would it make sense to start with passing an optional “query bit size” hint through SearchStrategy (without changing scoring yet), or is there a specific scorer/format path you’d recommend starting with?

Happy to begin with whatever smallest useful piece makes sense.

arup-chauhan avatar Feb 11 '26 02:02 arup-chauhan

@arup-chauhan I do think the "SearchStrategy" is the place to dig into first.

benwtrent avatar Feb 11 '26 11:02 benwtrent

@arup-chauhan I do think the "SearchStrategy" is the place to dig into first.

Hey @benwtrent, thank you. I will create a draft PR and get started. Also, I will keep reaching out to you for the feedback, hope that is ok.

arup-chauhan avatar Feb 11 '26 12:02 arup-chauhan