-
Notifications
You must be signed in to change notification settings - Fork 25.6k
[Docs] kNN vector rescoring for quantized vectors #118425
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Docs] kNN vector rescoring for quantized vectors #118425
Conversation
Documentation preview: |
10c98d3
to
09a9156
Compare
…ased DoubleValueSource
…r of results from each shard
09a9156
to
8ade227
Compare
Pinging @elastic/es-docs (Team:Docs) |
Pinging @elastic/es-search-relevance (Team:Search Relevance) |
There are two main ways to oversample and rescore. The first is to utilize the <<rescore, rescore section>> in the `_search` request. | ||
[discrete] | ||
[[dense-vector-knn-search-reranking-rescore-section]] | ||
===== Use the `rescore_vector` section for top-level kNN search |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The following example doesn't use rescore_vector
, instead it utilizes the top-level rescore
.
I am not sure we need to specifically call out ALL the ways that you can rescore. There are 3 ways now (rescore_vector, script score, and "rescore" at the top level). All have their uses, but our docs should be "normal user" prescriptive. Let's focus on rescore_vector
as that is the easiest for oversampling and rescoring vectors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should keep the existing ways of rescoring until we make rescore_vector
GA.
We can group the other ways under a "other ways of doing rescoring" kind of section, but I think it's worth keeping them until rescore_vector
is out of tech preview.
WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose calling these out is ok, we just need to be perfectly clear what each one means and when to use each one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've set rescore_vector
as the way to do it, and an additional section for the other methods, along with when you should use them, in ff7f906.
LMKWYT!
|
||
[discrete] | ||
[[dense-vector-knn-search-reranking-script-score]] | ||
===== Use a `script_score` query to rescore per shard | ||
|
||
You can rescore per shard with the <<query-dsl-knn-query, knn query>> and <<query-dsl-script-score-query, script_score query >>. | ||
Generally, this means that there will be more rescoring per shard, but this can increase overall recall at the cost of compute. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's not bother calling out script_score. I say remove this section and focus on "rescore_vector"
There are three main ways to oversample and rescore: | ||
|
||
* <<dense-vector-knn-search-reranking-rescore-parameter>> | ||
* <<dense-vector-knn-search-reranking-rescore-section>> | ||
* <<dense-vector-knn-search-reranking-script-score>> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's focus on rescore_vector
and remove the other sections.
+ | ||
include::{es-ref-dir}/rest-api/common-parms.asciidoc[tag=knn-similarity] | ||
|
||
include::{es-ref-dir}/rest-api/common-parms.asciidoc[tag=knn-rescore-vector] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we also need to put it in search-api-knn
in search.asciidoc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the catch - done in 9c00564
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Carlos, nice addition!
@benwtrent this is ready for review, it includes the latest changes for vector rescoring in #119835 |
💚 Backport successful
|
Follow up to #116663.
Adds docs for vector rescoring.
Search your data / knn search section:
knn query / knn retriever parameters section: