ruvector 2026: SOAR-IVF — High-Performance Rust Vector Search with Orthogonality-Amplified Residual Spilling
ruvector is a high-performance Rust vector database. This nightly research
note introduces ruvector-soar: the first Rust implementation of SOAR-IVF
(Spilling with Orthogonality-Amplified Residuals), the NeurIPS 2023 algorithm
deployed in Google Cloud Vertex AI Vector Search. SOAR-IVF improves recall@10
by up to +10.4pp at the same query cost versus standard IVF-PQ — a
critical improvement for production embedding search and RAG pipelines.
Keywords: approximate nearest neighbor search, IVF, vector search Rust, SOAR algorithm, embedding search, vector database, ANN benchmark, product quantization, NeurIPS 2023, ruvector
Inverted File Index (IVF) is the most widely deployed approximate nearest
neighbor algorithm in production (FAISS, Milvus, LanceDB all rely on it). It
partitions n vectors into nlist Voronoi clusters via k-means. At query
time, only the nearest nprobe clusters are scanned — achieving 10–1000× QPS
over brute-force at the cost of recall.
The fundamental weakness: vectors near Voronoi boundaries live in one cluster but are missed when the query lands in the adjacent cluster. The standard fix (increase nprobe) linearly increases search cost.
SOAR (Sun et al., Google Research, NeurIPS 2023) solves this with a principled secondary-cluster assignment at build time, requiring zero extra work at query time.
- Three-variant design under one
SoarIndexstruct:IndexKind::Flat— exact brute-force baselineIndexKind::IvfPq— standard IVF + Product Quantization (ADC)IndexKind::SoarIvfPq— IVF + PQ + SOAR orthogonality-amplified spilling
- Pure Rust — no C/C++ FFI, no BLAS, no unsafe blocks required
- Product Quantization ADC — precomputed query lookup table, O(M) per candidate
- K-means++ initialisation — better centroid quality vs random init
- Configurable λ — tune the orthogonality penalty for your data distribution
- Cargo workspace member —
cargo build -p ruvector-soarandcargo test -p ruvector-soarwork out of the box
| Benefit | Detail |
|---|---|
| Better recall at low nprobe | +10.4pp recall@10 at nprobe=1 vs IVF-PQ |
| Memory-efficient | Only +17% overhead for secondary lists |
| Complementary to HNSW/DiskANN | First IVF-based index in ruvector |
| Zero external C dependencies | Pure Rust, workspace-internal deps only |
| Production pedigree | Deployed in Google Cloud Vertex AI, AlloyDB |
| System | IVF support | SOAR / boundary spilling | Rust-native |
|---|---|---|---|
| ruvector-soar | ✅ IVF-PQ + ADC | ✅ SOAR orthogonality-amplified | ✅ Pure Rust |
| FAISS (Meta) | ✅ IVF-PQ, IVF-SQ | ❌ nprobe only | ❌ C++ |
| Milvus 2.x | ✅ IVF-PQ | ❌ | ❌ Go + C++ |
| Qdrant | ❌ HNSW only | ❌ | ✅ Rust |
| Weaviate | ❌ HNSW only | ❌ | ❌ Go |
| Pinecone | Unknown | Unknown | ❌ |
| LanceDB | ✅ IVF-PQ (basic) | ❌ | ✅ Rust |
ruvector-soar is the first open-source Rust implementation of SOAR.
| Variant | nprobe | Recall@10 | QPS | mem/KB | build/ms |
|---|---|---|---|---|---|
| Flat-Exact (baseline) | — | 100.0% | 9,203 | 0 | 0 |
| IVF-PQ | 1 | 49.5% | 70,301 | 28.4 | 233 |
| SOAR-IVF-PQ | 1 | 59.9% | 53,100 | 36.2 | 236 |
| IVF-PQ | 4 | 69.4% | 44,021 | 28.4 | 232 |
| SOAR-IVF-PQ | 4 | 70.1% | 38,082 | 36.2 | 238 |
| IVF-PQ | 8 | 71.0% | 29,481 | 28.4 | 233 |
| SOAR-IVF-PQ | 8 | 70.9% | 24,935 | 36.2 | 237 |
| Variant | nprobe | Recall@10 | QPS | mem/KB | build/ms |
|---|---|---|---|---|---|
| Flat-Exact (baseline) | — | 100.0% | 1,060 | 0 | 0 |
| IVF-PQ | 2 | 41.1% | 22,886 | 227.3 | 4,245 |
| SOAR-IVF-PQ | 2 | 42.9% | 20,938 | 266.4 | 4,272 |
| IVF-PQ | 8 | 46.0% | 14,004 | 227.3 | 4,207 |
| SOAR-IVF-PQ | 8 | 46.0% | 10,342 | 266.4 | 4,292 |
Key takeaway: SOAR delivers +10.4pp recall at nprobe=1 (2K vectors), 5.8× faster than flat-exact, with only 17% more memory and <2% longer build time. At nprobe=4, SOAR reaches 70.1% recall while IVF-PQ reaches 69.4% at the same cost.
The PoC uses single-stage PQ. Production-ready improvements (roadmap in ADR-193):
- Residual reranking: exact L2 on top-2k candidates removes the PQ recall ceiling
- SIMD ADC: AVX2 batch lookups → 4–8× scan QPS improvement
- Minibatch k-means: SGD centroid updates for n > 100K
- λ auto-tuning: held-out validation to pick λ without manual tuning
- Streaming inserts: append vectors to primary lists, background secondary reassignment
- HNSW centroid search: O(log nlist) centroid assignment during search
# Clone ruvector
git clone https://github.com/ruvnet/ruvector
cd ruvector
# Check out the SOAR research branch
git checkout research/nightly/2026-05-08-soar-ivf
# Build and test
cargo build --release -p ruvector-soar
cargo test -p ruvector-soar
# Run the benchmark harness (produces the table above)
cargo run --release -p ruvector-soar
# (add --fast for a 5-second smoke run)Research branch: research/nightly/2026-05-08-soar-ivf
Research doc: docs/research/nightly/2026-05-08-soar-ivf/README.md
ADR: docs/adr/ADR-193-soar-ivf.md
Crate: crates/ruvector-soar/
Repo: https://github.com/ruvnet/ruvector
Sun, P., Simcha, D., Dopson, D., Guo, R., & Kumar, S. "SOAR: Improved Indexing for Approximate Nearest Neighbor Search." NeurIPS 2023. arXiv:2404.00774.