olanokhin/hnsw-turboquant-glove
TurboQuant x HNSW: GloVe scaling curve
This Space benchmarks a TurboQuant-style vector compression pipeline on real GloVe-200 embeddings:
- randomized Hadamard rotation
- Lloyd-Max scalar quantization
- HNSW cosine search
- Recall@10 vs compression across 1, 2, 4, 6, and 8 bits
Default benchmark setup:
- dataset:
olanokhin/glove-6b-200d-vectors - native dimension:
200 - encoded dimension:
256after Hadamard padding - corpus vectors:
25,000 - queries:
500 - HNSW:
ef_construction=200,M=16
The point is not to claim a production implementation. The app reconstructs float32 vectors from compressed codes and builds a standard HNSW index. A production vector database would store codes directly and score through codebook lookup with SIMD kernels.
Dataset
For Hugging Face Spaces, set these environment variables:
HF_DATASET_ID=olanokhin/glove-6b-200d-vectors
HF_DATASET_SPLIT=train
HF_VECTOR_COLUMN=vectorExpected dataset schema:
- split:
train - vector column: list of 200 floats
- optional word column: ignored by the benchmark
For a local real-GloVe run before uploading the dataset, download and unzip Stanford glove.6B.200d.txt, then launch with:
GLOVE_TXT_PATH=/path/to/glove.6B.200d.txt python app.pyResume bullet
Benchmarked TurboQuant (Google ICLR 2026) on GloVe-200: mapped Recall@10 vs compression across 1-8 bit quantization; identified 8-bit as safe sweet spot (3.12x smaller, -0.7pp Recall@10) and 6-bit as aggressive sweet spot (4.17x smaller, -1.9pp).
