Default Retriever to weighted hybrid search - #2427
Open
jioffe502 wants to merge 6 commits into
Open
Conversation
Signed-off-by: Jacob Ioffe <jioffe@nvidia.com>
Contributor
Greptile SummaryThis PR makes weighted hybrid retrieval the default for newly created indexes while preserving the physical mode of existing tables.
|
| Filename | Overview |
|---|---|
| nemo_retriever/src/nemo_retriever/service/vectordb_app.py | Adds service index-mode resolution, FTS creation and maintenance, weighted hybrid search, and exception-safe index health telemetry. |
| nemo_retriever/src/nemo_retriever/common/vdb/lancedb.py | Extends LanceDB retrieval to apply the shared weighted hybrid-fusion policy. |
| nemo_retriever/src/nemo_retriever/common/vdb/hybrid_fusion.py | Defines the shared weighted-RRF policy used by hybrid retrieval paths. |
| nemo_retriever/src/nemo_retriever/ingest/index_mode.py | Centralizes index-mode resolution for new, overwritten, and appended tables. |
| nemo_retriever/src/nemo_retriever/ingest/plan.py | Integrates automatic index-mode selection into local and batch ingest planning. |
| nemo_retriever/helm/templates/configmap.yaml | Validates and renders the configurable VectorDB index mode. |
| nemo_retriever/src/nemo_retriever/harness/retrieval_comparison.py | Adds replay tooling for comparing retrieval modes against an existing hybrid-capable index. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Ingest request] --> B{Requested index mode}
B -->|auto + new table| C[Create vector table and FTS index]
B -->|auto + existing table| D[Preserve physical index mode]
B -->|explicit hybrid + dense table| E[Add FTS index]
B -->|explicit dense| F[Use dense index]
C --> G{Query capabilities}
D --> G
E --> G
F --> G
G -->|Vector + FTS| H[Dense and BM25 candidate retrieval]
H --> I[Weighted RRF: 0.8 dense / 0.2 FTS]
G -->|Vector only| J[Dense retrieval]
Reviews (6): Last reviewed commit: "Merge branch 'main' into jioffe502/hybri..." | Re-trigger Greptile
Signed-off-by: Jacob Ioffe <jioffe@nvidia.com>
Signed-off-by: Jacob Ioffe <jioffe@nvidia.com>
Signed-off-by: Jacob Ioffe <jioffe@nvidia.com>
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.
Summary
This PR makes weighted hybrid retrieval the accuracy-oriented default for new NeMo Retriever indexes. Each query combines:
The selected policy retrieves 50 candidates from each search leg, uses 0.8 dense / 0.2 FTS with RRF k=10, and returns the requested top results without a model reranker.
The key finding is that adding FTS is not automatically an accuracy win. LanceDB's equal-weight RRF can disrupt strong semantic rankings. Dense-favoring fusion preserves the semantic baseline while adding useful exact-match recall.
Evidence
We evaluated 16,283 queries across the full ViDoRe v3, BO767, Earnings/Consulting, and FinanceBench datasets. Every comparison reused the same extracted rows and index; no subsets or model reranker were used.
Weighted hybrid improved both reported metrics on three evaluations and remained effectively dense-equivalent on FinanceBench. In contrast, equal-weight RRF regressed ViDoRe by 4.66 pp Recall@5 / 6.02 pp nDCG@10 and FinanceBench by 3.34 pp / 6.31 pp. The fusion policy—not merely the presence of FTS—is what makes hybrid a safe default.
Actual dense, equal-RRF, and weighted-RRF scores
Why this configuration
The initial full-ViDoRe sweep evaluated 56 configurations over all 14,514 queries: candidate depths 10, 25, 50, and 100; dense weights from 0.5 through 0.975; and RRF k values 10 and 60.
Selection gate and finalists
The selection gate required positive macro nDCG@10, non-negative macro Recall@10, a positive paired-confidence-interval lower bound for query-weighted nDCG@10, wins on at least six of eight ViDoRe corpora, and no corpus worse than -0.5 pp nDCG@10.
Product behavior
index_mode=autobecome hybrid.autopreserves the table's existing physical mode; persistent dense tables do not migrate silently.index_mode=hybridupgrades an existing dense table by adding FTS.retrieval_mode=autocontinues to resolve from the table's physical vector and FTS capabilities.Implementation scope
Latency
Weighted hybrid adds 37-80 ms at p50 and 43-75 ms at p95 versus dense in these warmed sequential passes. The modes were not interleaved, so this result is directional; explicit dense mode remains the latency-oriented option.
Latency results
Recommendation
Adopt the fixed weighted-hybrid policy as the default for new indexes, preserve existing physical modes during append, and retain explicit dense mode. The evidence supports a robust cross-dataset default, not a claim that hybrid wins every query or dataset.
Validation
uvx pre-commit run --all-files: all hooks passed.auto,dense, andhybridrender into service configuration and deployment arguments, and invalid modes are rejected.