-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Add new experimental rank_vectors mapping for late-interaction second order ranking #118804
base: main
Are you sure you want to change the base?
Conversation
Documentation preview: |
Pinging @elastic/es-search-relevance (Team:Search Relevance) |
Hi @benwtrent, I've created a changelog YAML for you. Note that since this PR is labelled |
.../src/main/java/org/elasticsearch/xpack/rank/vectors/script/RankVectorsPainlessExtension.java
Show resolved
Hide resolved
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
private final DenseVectorFieldMapper.ElementType elementType; | ||
private final int dims; | ||
|
||
RankVectorsDVLeafFieldData(LeafReader reader, String field, DenseVectorFieldMapper.ElementType elementType, int dims) { |
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 really should make ElementType
its own class. We should start some refactoring of DenseVectorFieldMapper
after this PR lands.
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.
LGTM
…asticsearch into feature/rank-vectors-plugin
Late-interaction models are powerful rerankers. While their size and overall cost doesn't lend itself for HNSW indexing, utilizing them as second order "brute-force" reranking can provide excellent boosts in relevance. At generally lower inference times than large cross-encoders.
This commit exposes a new experimental
rank_vectors
field that allows for maxSim operations. This unlocks the initial, and most common use of late-interaction dense-models.For example, this is how you would use it via the API:
Then to index:
For querying, scoring can be exposed with scripting:
Of course, the initial ranking should be done before re-scoring or combining via the
rescore
parameter, or simply passing whatever first phase retrieval you want as the inner query inscript_score
.