shrinkvec report
sift-128. SIFT image descriptors, 1M vectors (ann-benchmarks). Public research dataset (INRIA TEXMEX).
vectors 1,000,000dimensions 128metric l2queries 1,000k 10seed 42
Recommendation for recall@10 ≥ 0.95
tq-mse-3>tq-mse-8 keeps recall@10 at 0.983 with 56 bytes per vector to search (9.1x smaller than float32). The rerank reads more precise data for each candidate, so 192 bytes per vector stay stored; only the searched part has to be in memory. In Postgres: pg_turbovec.
Codec lab: what the codes can do
Every option scans all codes exactly, so recall reflects the compression itself, not an index. Ground truth is exact search in float64. Hollow markers rerank the best candidates with a more precise codec.
| pipeline | what it is | recall@10 | true top-10 in candidates | bytes/vector searched | bytes/vector stored | vs float32 | in Postgres |
|---|---|---|---|---|---|---|---|
float32 | Full precision (float32) | 1.000 | 512 | 512 | 1.0x | pgvector vector | |
halfvec | Half precision (float16) | 1.000 | 256 | 256 | 2.0x | pgvector halfvec | |
int8 | 8-bit scalar, per-dimension range | 0.990 | 128 | 128 | 4.0x | not in pgvector | |
tq-mse-4 | TurboQuant 4-bit (mse) | 0.814 ± 0.001 | 72 | 72 | 7.1x | pg_turbovec | |
tq-prod-4 | TurboQuant 4-bit (prod) | 0.339 ± 0.005 | 72 | 72 | 7.1x | pg_turbovec | |
tq-mse-3 | TurboQuant 3-bit (mse) | 0.671 ± 0.003 | 56 | 56 | 9.1x | pg_turbovec | |
tq-mse-2 | TurboQuant 2-bit (mse) | 0.456 ± 0.005 | 40 | 40 | 12.8x | pg_turbovec | |
rabitq-4 | RaBitQ 4-bit (extended) | 0.858 ± 0.001 | 72 | 72 | 7.1x | VectorChord vchordrq | |
rabitq-1 | RaBitQ 1-bit | 0.252 ± 0.002 | 24 | 24 | 21.3x | VectorChord vchordrq | |
binary | 1 sign bit per dimension, Hamming distance | 0.022 | 16 | 16 | 32.0x | pgvector binary_quantize | |
tq-mse-3>tq-mse-8 | TurboQuant 3-bit (mse), rerank top 100 with TurboQuant 8-bit (mse) | 0.983 ± 0.001 | 0.997 | 56 | 192 | 9.1x | pg_turbovec |
rabitq-1>float32 | RaBitQ 1-bit, rerank top 100 with Full precision (float32) | 0.704 ± 0.006 | 0.704 | 24 | 536 | 21.3x | VectorChord vchordrq |
binary>float32 | 1 sign bit per dimension, Hamming distance, rerank top 100 with Full precision (float32) | 0.055 | 0.055 | 16 | 528 | 32.0x | pgvector binary_quantize |
Reproduce
pip install 'shrinkvec[pg,datasets]'
shrinkvec lab --dataset sift-128 --repeats 3 --out docs/results/sift-128