Skip to content

feat: add server-controlled MRL refinement ratio - #1904

Draft
jamesgao-jpg wants to merge 1 commit into
zilliztech:mainfrom
jamesgao-jpg:codex/mrl-refine-ratio
Draft

jamesgao-jpg wants to merge 1 commit into
zilliztech:mainfrom
jamesgao-jpg:codex/mrl-refine-ratio

Conversation

@jamesgao-jpg

@jamesgao-jpg jamesgao-jpg commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Add a server-controlled multiplier for the optional full-dimensional MRL rerank.

  • Configure it with KnowhereConfig::SetMRLRefineRatio, not request JSON or serialized index metadata.
  • With MRL refinement enabled, retrieve int(topk * ratio) prefix-index results, rerank those IDs using full-dimensional raw vectors, and return the original topk.
  • Use DVR's truncating conversion, guard integer overflow, default to 1.0, and reject non-finite values or values below 1.
  • Ignore the ratio when MRL refinement is disabled.
  • Keep SCANN's inner reorder count at least as large as the expanded requested result count. Ordinary request validation is unchanged.

Related issue and dependencies

issue: #1850

PR #1849 introduced the MRL wrapper. PR #1884 added nullable-ID mapping and search-scoped raw-data views; both have merged.

Milvus PR milvus-io/milvus#53822 initializes this setting from server configuration at QueryNode startup.

This draft is based on merged MRL revision 549a4367a8b0b61e7ad7c2978b93fdfe7af9cbf0. The later nullable API migration in PR #1890 remains separate from the accompanying Milvus dependency pin.

Validation

On the configured arm64 development machine:

  • CPU unit-test build completed.
  • [mrl]: 126 assertions passed across 9 test cases, including the SCANN regression.
  • FLAT/HNSW coverage includes truncation, full-dimensional neighbor recovery, filtering, reload, disabled refinement, and overflow rejection.
  • Nullable-ID mapping and per-search raw-data scope tests passed.
  • Request-level ratio values cannot change the server setting.
  • Pre-commit formatting and whitespace checks passed.

This remains a draft for additional MRL/DVR refactors as they are agreed.

@sre-ci-robot

Copy link
Copy Markdown
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: jamesgao-jpg
To complete the pull request process, please assign alexanderguzhva after the PR has been reviewed.
You can assign the PR to them by writing /assign @alexanderguzhva in a comment when ready.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Signed-off-by: jamesgao-jpg <james.gao@zilliz.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants