SpecStream's picture
Publish 5 Dec 1 2026 technical & empirical papers and wiki-vector-bench
f2c824d verified
|
Raw History Blame Contribute Delete
1.14 kB

Binary Hamming + Int8 Rescore Vector Retrieval Benchmark

Clean, standalone C + Python reproduction benchmark accompanying SpecStream's engineering paper: "Millisecond semantic retrieval over 47 million Wikipedia paragraphs in 6 GB of RAM" Canonical paper: https://specstream.ai/blog/millisecond-semantic-retrieval-47m-wikipedia-6gb-ram

What this benchmark demonstrates

At 47,018,430 paragraphs x 1,024 dimensions (BAAI/bge-m3, from Upstash/wikipedia-2024-06-bge-m3):

  • Raw float32: 192.59 GB (179.36 GiB)
  • Stage 1 binary sign bits (128 B/vec, 16 x uint64_t little-endian): 6.018 GB (5.605 GiB), 32x RAM compression, mlock() pinned in RAM
  • Stage 2 scalar int8 (1,024 B/vec, clip(round(v * 127), -127, 127)): 48.147 GB (44.840 GiB), mmap() on local NVMe, read only for the top cand Hamming candidates (default 3,000 = 3.07 MB read per query)

Build and run

make
python3 bench.py --n 1000000 --dim 1024 --cand 3000 --k 10 --queries 20

Set --n to match available RAM (1,000,000 vectors = 128 MB binary + 1 GB int8; 10,000,000 vectors = 1.28 GB binary + 10 GB int8).

License

MIT