Skip to content

research(nightly): 2026-05-08 Locally-Adaptive Vector Quantization (LVQ)#446

Draft
CrossGen-ai wants to merge 1 commit intoruvnet:mainfrom
CrossGen-ai:research/nightly/2026-05-08-lvq-locally-adaptive-vq
Draft

research(nightly): 2026-05-08 Locally-Adaptive Vector Quantization (LVQ)#446
CrossGen-ai wants to merge 1 commit intoruvnet:mainfrom
CrossGen-ai:research/nightly/2026-05-08-lvq-locally-adaptive-vq

Conversation

@CrossGen-ai
Copy link
Copy Markdown

Summary

Adds a working Rust PoC for Locally-Adaptive Vector Quantization (LVQ)
the per-vector 8-bit scalar compression scheme from Intel's Scalable Vector
Search
(Aguerrebere et al., VLDB 2024) — as a new workspace crate
`crates/ruvector-lvq`. Includes a two-level residual variant (LVQ-8x8) that
matches fp32 recall at half the memory.

Real benchmarks (Apple M4 Max, n=200K, d=128, k=10)

Variant Memory Recall@10 QPS
fp32 baseline 97.66 MB 1.000 148
LVQ-8 26.70 MB (27.3%) 0.942 120
LVQ-8x8 reranked 10× 53.41 MB (54.7%) 1.000 121

Test plan

  • `cargo build -p ruvector-lvq --release` — succeeds
  • `cargo test -p ruvector-lvq --release` — 10/10 pass (3 unit + 4 module + 3 integration)
  • `cargo run -p ruvector-lvq --release --bin ruvector-lvq-bench` — prints real numbers
  • `LVQ_N=200000 cargo run …` — confirms recall holds at 4× scale
  • Wire `lvq8_l2sq` into `ruvector-core::hnsw` (follow-up)
  • DiskANN block format integration (follow-up)
  • `ruvector-lvq-wasm` and `-node` mirror crates (follow-up)

Notes

This branch is on a fork (`CrossGen-ai/RuVector`) because the nightly
research bot does not have push access to `ruvnet/RuVector`. PR is opened
draft so the upstream maintainers can decide whether to merge or rebase.

Single-level (LVQ-8) and two-level residual (LVQ-8x8) per-vector scalar
quantization with asymmetric L2/dot kernels and a reranking-friendly flat
index. Pure-Rust, #![forbid(unsafe_code)], all files <500 LOC.

Real benchmark (200K x 128 on Apple M4 Max):
  - LVQ-8:           27.3% memory, recall@10 = 0.942
  - LVQ-8x8 (10x):   54.7% memory, recall@10 = 1.000

10/10 tests pass under cargo test -p ruvector-lvq --release.

See ADR-193 and docs/research/nightly/2026-05-08-lvq-locally-adaptive-vq/.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant