仓库已归档,后续开发需转到 RaBitQ-Library 仓库;依赖 Eigen 必须为 3.4.0 且需手动解压到 ./src/ 目录;运行前需按 ./data/README.md 自行下载并预处理数据集
RaBitQ
gaoj0017Apache-2.0更新放缓RaBitQ 是 SIGMOD 2024 提出的高维向量量化方法,为近似最近邻搜索提供理论误差上界,适合构建向量检索系统时做有精度保证的压缩索引。
The repo has been moved to https://github.com/VectorDB-NTU/RaBitQ-Library. [SIGMOD 2024] RaBitQ: Quantizing High-Dimensional Vectors with a Theoretical Error Bound for Approximate Nearest Neighbor Search
wget https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.tar.gz && tar -xzf eigen-3.4.0.tar.gz && mv eigen-3.4.0/Eigen ./src/
./script/index.sh
./script/search.shREADME 未说明
SIGMOD 2024 的 RaBitQ 量化算法论文代码,把高维向量压成比特串做近似最近邻搜索
RaBitQ 是 SIGMOD 2024 提出的高维向量量化方法,为近似最近邻搜索提供理论误差上界,适合构建向量检索系统时做有精度保证的压缩索引。
核心能力
- 将 D 维向量量化为 D-bit 字符串
- 提供带理论误差界的距离估计
- 支持位运算与 SIMD 两种距离估计实现
- 基于 IVF 索引流程组织建库与查询
容易踩的坑
暂无 release 数据(可能没有发版,或尚未同步)。
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
[SIGMOD 2024] RaBitQ: Quantizing High-Dimensional Vectors with a Theoretical Error Bound for Approximate Nearest Neighbor Search
News and Updates
-
The repo has been archived. Please refer to the RaBitQ-Library for further development.
-
A library with more practical implementation techniques about RaBitQ is released at the RaBitQ-Library.
-
A new blog - Quantization in The Counterintuitive High-Dimensional Space - to provide the key insights behind RaBitQ and its extension (corresponding to optimized approaches to binary quantization and scalar quantization respectively).
We are open to address any questions regarding the RaBitQ project. Please feel free to drop us an email at GAOJ0017 [at] e.ntu.edu.sg and c.long [at] ntu.edu.sg.
Organization
- The index phase of RaBitQ:
./data/rabitq.py. - The query phase of RaBitQ:
./src/ivf_rabitq.hincludes the general workflow../src/space.hincludes the bitwise implementation of RaBitQ../src/fast_scan.hincludes the SIMD-based implementation of RaBitQ.
- Comments are provided in these files.
Prerequisites
- Eigen == 3.4.0
- Download the Eigen library from https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.tar.gz.
- Unzip it and move the
Eigenfolder to./src/.
Reproduction
-
Download and preprocess the datasets. Detailed instructions can be found in
./data/README.md. -
Index the datasets.
./script/index.sh -
Test the queries of the datasets. The results are generated in
./results/../script/search.sh
Please cite our paper using the following bibtex if it is used in your research.
@article{10.1145/3654970,
author = {Gao, Jianyang and Long, Cheng},
title = {RaBitQ: Quantizing High-Dimensional Vectors with a Theoretical Error Bound for Approximate Nearest Neighbor Search},
year = {2024},
issue_date = {June 2024},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
volume = {2},
number = {3},
url = {https://doi.org/10.1145/3654970},
doi = {10.1145/3654970},
abstract = {Searching for approximate nearest neighbors (ANN) in the high-dimensional Euclidean space is a pivotal problem. Recently, with the help of fast SIMD-based implementations, Product Quantization (PQ) and its variants can often efficiently and accurately estimate the distances between the vectors and have achieved great success in the in-memory ANN search. Despite their empirical success, we note that these methods do not have a theoretical error bound and are observed to fail disastrously on some real-world datasets. Motivated by this, we propose a new randomized quantization method named RaBitQ, which quantizes D-dimensional vectors into D-bit strings. RaBitQ guarantees a sharp theoretical error bound and provides good empirical accuracy at the same time. In addition, we introduce efficient implementations of RaBitQ, supporting to estimate the distances with bitwise operations or SIMD-based operations. Extensive experiments on real-world datasets confirm that (1) our method outperforms PQ and its variants in terms of accuracy-efficiency trade-off by a clear margin and (2) its empirical performance is well-aligned with our theoretical analysis.},
journal = {Proc. ACM Manag. Data},
month = may,
articleno = {167},
numpages = {27},
keywords = {Johnson-Lindenstrauss transformation, approximate nearest neighbor search, quantization}
}
Please provide a reference of our paper if it helps in your system.
Jianyang Gao and Cheng Long. 2024. RaBitQ: Quantizing High-Dimensional Vectors with a Theoretical Error Bound for Approximate Nearest Neighbor Search. Proc. ACM Manag. Data 2, 3, Article 167 (June 2024), 27 pages. https://doi.org/10.1145/3654970