[Feature]: Integrate OMEGA adaptive early termination into zvec

オープン
#300 コメント 0 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@richyreachy がすでに取り組んでいます。

2026年4月7日 から。

  • #301 @driPyf による — オープン

評価

この issue はまだ評価されていません。

説明

feature
Problem / Motivation

HNSW usually depends on a fixed ef_search budget. In real workloads, that budget often has to be tuned
conservatively, which means many easy queries still pay unnecessary traversal and comparison cost.

OMEGA is designed to turn this fixed budget into adaptive early termination: it monitors the current HNSW search
state and decides whether the target recall has already been reached.

More importantly, OMEGA is not just another learned stopping heuristic. Its key advantage is one-model for multi-K: it reduces an arbitrary top-K ANN query into repeated top-1 ANN decisions, so a single learned model can be reused across different K values and different recall targets. This avoids the need to retrain separate models or repeatedly retune search parameters for each K.

Proposed Solution
Integrate OMEGA into zvec as a built-in capability on top of HNSW.

This includes:

- OMEGA index and query parameters
- integration with the HNSW search loop through hooks
- offline training and model persistence
- support for one-model-for-multi-K query serving
- runtime fallback to plain HNSW when OMEGA is unavailable or not applicable
Alternatives Considered
  • Keep using only fixed-budget HNSW tuning:
    this is simple, but it still relies on a single global budget such as ef_search, which does not address query-level variation and cannot provide one-model-for-multi-K behavior.

  • Build a separate OMEGA-specific search path:
    this would duplicate the existing HNSW search implementation and increase long-term maintenance cost. We prefer integrating OMEGA as a query-time control layer on top of the current HNSW path.

  • Train or tune separate learned/search configurations for different K values:
    this increases offline cost and operational complexity. One of OMEGA's main advantages is that a single model can serve multiple K values and recall targets.

Affected Area

{"label" => "C++ Core (storage, indexing)"}, {"label" => "Python API / Bindings"}, {"label" => "Testing / CI / Coverage"}

主要言語
C++
スター
16.3k
フォーク
1k
平均マージ
2日 10時間
マージ済み PR(30日)
32

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

alibaba/zvec のほかの issue

alibaba/zvec の issue をすべて見る

似ている issue

C++ の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。