[Enhance]: Integrate TurboQuant/PolarQuant zero-overhead vector quantization for compressed ANNS indexing
维护者通常 1 天内回复
@richyreachy 已经在做这个了。
开始于 2026年4月7日。
评估
这个 Issue 还没有评估数据。
描述
Affected Component
HNSW index, vector quantization layer, index builder, Python API
Current Behavior
zvec currently relies on standard vector quantization approaches (e.g., scalar or product quantization) that carry unavoidable memory overhead. Traditional quantization methods must compute and store full-precision quantization constants (scale/zero-point) for every small block of data, adding 1–2 extra bits per value. This overhead partially defeats the compression goal: a 4-bit quantization scheme in practice consumes closer to 5–6 bits per dimension, increasing memory footprint and slowing down index building and similarity search. There is no built-in support for theoretically-optimal, data-oblivious quantizers that eliminate this overhead while preserving recall accuracy.
Desired Improvement
Integrate support for TurboQuant and its constituent algorithms (PolarQuant and QJL) as a quantization backend option within zvec's index building and search pipeline.
Proposed changes:
-
PolarQuant quantizer: Add a quantization codec that converts Cartesian vector coordinates to polar form, applying recursive polar transforms so that the angular component can be quantized without storing per-block normalization constants. This eliminates the memory overhead associated with scale factors.
-
QJL residual correction: After primary quantization with PolarQuant, apply the Quantized Johnson-Lindenstrauss 1-bit residual pass to the remaining error. This step requires zero memory overhead and removes quantization bias, producing more accurate inner-product / dot-product estimates for ANNS scoring.
-
TurboQuant codec: Expose a unified
TurboQuantquantization option that chains PolarQuant + QJL, configurable via abitsparameter (e.g., 3-bit, 4-bit). -
Python API: Surface the new codec through the existing Python API, e.g.:
index = zvec.Index(quantization="turboquant", bits=4) -
No training / fine-tuning requirement: The implementation must be data-oblivious — no dataset-specific codebook training should be required.
Reference: TurboQuant (ICLR 2026) — https://arxiv.org/abs/2504.19874; PolarQuant (AISTATS 2026) — https://arxiv.org/abs/2502.02617; QJL — https://arxiv.org/abs/2406.03482
Impact
- Lower memory usage: Quantizing vectors to 3–4 bits with zero overhead (no stored scale constants) reduces index memory by 6× or more compared to 32-bit storage, enabling larger datasets to fit in RAM.
- Faster queries: By operating at lower bit-widths, inner-product computations over compressed vectors are significantly cheaper. Benchmarks show up to 8× speedup in attention-logit throughput on H100 GPUs at 4-bit vs 32-bit.
- No accuracy loss: TurboQuant achieves near-lossless recall (matching full-precision results on standard ANNS benchmarks such as GloVe d=200) without any dataset-specific codebook training, making it immediately usable on arbitrary embedding spaces.
- Faster index building: The data-oblivious design eliminates the expensive training phase required by methods like PQ or RaBitQ, dramatically reducing time-to-index for large collections.
- Drop-in adoption: Exposing TurboQuant as a named codec in the Python API allows existing zvec users to opt in with a single parameter change, lowering the barrier for adoption in production RAG and semantic search pipelines.
- 主要语言
- C++
- 星标
- 16.3k
- 派生
- 1k
- 平均合并
- 2 天 10 小时
- 30 天内合并 PR
- 32
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
alibaba/zvec 的其他 Issue
-
[Feature]: IVF_TIEREDQ index type, with a learned variable-bit codec (25–44% less index memory than `IVF_RABITQ` at equal recall)可能已有人在做 @richyreachy 于 7 天前认领。 未关闭feature
维护者通常 1 天内回复
-
Support an opt-in portable x86 FastPFOR build without SSE4.1可能已有人在做 @egolearner 于 20 天前认领。 未关闭
alibaba/zvec#875 · 1 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
[Enhance]: Reduce vector index block fragmentation caused by frequent flushes可能已有人在做 @feihongxu0824 于 22 天前认领。 未关闭enhancement
维护者通常 1 天内回复
-
[Performance]:High-selectivity range filter materializes a full bitmap — `bitset_set_list` ~49% CPU, dwarfing the ANN search可能已有人在做 @zhourrr 于 22 天前认领。 未关闭enhancement
alibaba/zvec#868 · 13 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
[Performance] Warm-query latency on small collections with query() and query_internal_ids() in v0.8.0可能重新可做 @egolearner 于 33 天前认领,目前没有进行中的 PR。 未关闭
维护者通常 1 天内回复
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 80/100
维护者通常 1 天内回复
-
compatibility difficulty:easy prio:low
难度 2/5 1-3 小时 新手友好度 72/100
NatronGitHub/openfx-misc#390 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 72/100
-
deprecation internal refactor
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复