[Feature]: IVF_TIEREDQ index type, with a learned variable-bit codec (25–44% less index memory than `IVF_RABITQ` at equal recall)
I maintainer di solito rispondono entro 1 giorno
@richyreachy ci sta già lavorando.
Dal 17/11/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
Problem / Motivation
I wrote TieredQ (MIT), a new vector quantizer that learns a rotation from the data (PCA) and spreads a bit budget unevenly over the rotated dimensions, from 0 to 8 bits each. The budget can be any number of bits per vector, not only whole bits per dimension. Its codes are scanned with fast-scan lookup kernels (AVX-512, AVX2 and NEON), and it ships its own IVF index. TieredQ codec can save up to ~50% RAM usage compared to RaBitQ or TurboQuant and thus is a good candidate for local setups with limited RAM or large scale setups.
I'd like to know whether you'd consider an IVF index type based on it for zvec, next to IVF_RABITQ, and how you'd want it integrated.
Proposed Solution
Results against zvec 0.8.0 IVF_RABITQ
Setup:
- DBpedia Gemini-768: 99,000 base rows, 1,000 held-out queries, inner-product top-10 truth.
- 256 coarse lists. Each engine trains its own through its shipped Python API.
- zvec:
IvfRabitqIndexParam(metric_type=IP, nlist=256, total_bits=1..7), no refiner. - TieredQ:
TieredQIVFIndexat fractional budgets close to zvec's sizes. - One query per Python call, pinned to one core.
- Index memory is each index's compressed size: zvec's
*.qindex.*files against TieredQ'sstorage_bytes. These are
index sizes, not measured process RAM. zvec's full FP32 copy is not counted.
On an AVX-512 host (Skylake-X), the least index memory reaching each recall@10 target:
| recall@10 | zvec bits/vector | TieredQ bits/vector | ratio |
|---|---|---|---|
| 0.80 | 1,953 | 1,084 | 0.56× |
| 0.90 | 2,721 | 1,879 | 0.69× |
| 0.95 | 3,490 | 2,498 | 0.72× |
| 0.97 | 4,259 | 3,215 | 0.75× |
| 0.98 | 5,027 | 3,282 | 0.65× |
| 0.99 | 5,794 | 4,082 | 0.70× |
- At equal memory, TieredQ has equal or higher recall at every nprobe. At full probe: 1 bit 0.860 against 0.741,
2 bits 0.941 against 0.862, 3 bits 0.969 against 0.924. - Speed at equal recall is mixed. TieredQ is faster at recall ≤ 0.85 (1.6×) and at 0.99 (1.5×). zvec's fastest
configurations are 1.1–1.25× faster from 0.90 to 0.98, using more memory. - On a 4-vCPU AVX2 VM (AMD EPYC Milan), the memory saving held (25–46%), but zvec was 1.4–3.8× faster from recall 0.90
up. Those runs predate TieredQ's current scan kernels, and I haven't remeasured them yet. - On Faiss, at the same partition, TieredQ's IVF needs 16–40% less RAM than
IndexIVFRaBitQat matched recall, on
1.34M × 768 and 8.84M × 1024 sets
(results).
How it would differ from IVF_RABITQ
- Trained codec. RaBitQ is data-oblivious; TieredQ learns a model (PCA basis, bit allocation, a small set of
centroids) from a sample, about 32K rows. A collection, or each segment, would train once and store the model with
the index. Rows added later are encoded with the existing model. - No residuals. Codes don't depend on their list, so moving, merging or compacting rows doesn't re-encode them.
- Fractional budgets. A user can pick a memory budget (e.g. 1.25 bits/dim) instead of whole bits.
Questions
- Would you consider a TieredQ-based IVF index type in zvec? If so, as part of the core library, or through an
extension point? - How should a trained codec fit zvec's segments: one model per collection, or one per segment, retrained when a
segment is rebuilt? - Which benchmarks would you want to see before a PR: larger collections, measured process RAM, or specific
hardware?
I'm happy to answer any questions and do the integration and to maintain it.
Alternatives Considered
Alternatives are RaBitQ and TurboQuant as mentioned above.
Affected Area
{"label" => "C++ Core (storage, indexing)"}
- Lingua principale
- C++
- Stelle
- 16.3k
- Fork
- 1k
- Merge medio
- 2g 10h
- PR unite (30g)
- 32
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di alibaba/zvec
-
Support an opt-in portable x86 FastPFOR build without SSE4.1Forse già presa @egolearner l’ha presa 20 giorni fa. Aperta
alibaba/zvec#875 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
[Enhance]: Reduce vector index block fragmentation caused by frequent flushesForse già presa @feihongxu0824 l’ha presa 22 giorni fa. Apertaenhancement
alibaba/zvec#869 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
[Performance]:High-selectivity range filter materializes a full bitmap — `bitset_set_list` ~49% CPU, dwarfing the ANN searchForse già presa @zhourrr l’ha presa 22 giorni fa. Apertaenhancement
alibaba/zvec#868 · 13 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
[Performance] Warm-query latency on small collections with query() and query_internal_ids() in v0.8.0Forse di nuovo libera @egolearner l’ha presa 33 giorni fa e non c’è nessuna pull request aperta. Aperta
alibaba/zvec#841 · 2 assegnatari ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: Read-only collection concurrent query triggers permanent futex deadlock (process hangs, never recovers)Forse di nuovo libera @richyreachy l’ha presa 34 giorni fa e non c’è nessuna pull request aperta. Apertabug
alibaba/zvec#837 · 2 assegnatari ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di alibaba/zvec
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
-
deprecation internal refactor
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno
-
realloc(ptr, 0) on glibc leaves the freed block in the capture as a leakForse già presa @ADAMAMZAR l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
bloomberg/memray#1097 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
new-compilers request
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
compiler-explorer/compiler-explorer#9640 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
deepseek-ai/DeepEP#839 ·
I maintainer di solito rispondono entro 6 giorni