Skip to main content

Module vector_quant

Module vector_quant 

Source
Expand description

Vector quantization codec family — binary, ternary, 4-bit scalar, residual, and unified layout types shared across HNSW hot-path, IVF-PQ, and BBQ.

Modules§

bbq
BBQ — Better Binary Quantization (Elasticsearch 9.1, mid-2025).
codec
Dual-phase VectorCodec trait — the seam that makes future quantization algorithms drop-in additions rather than engine rewrites.
hamming
Shared SIMD Hamming-distance kernel with runtime CPU-feature dispatch.
layout
Unified Quantized Vector layout — the cache-aligned superset format that absorbs binary / ternary (BitNet 1.58) / 4-bit scalar / residual codecs without polymorphic indirection in the hot path.
opq
Optimized Product Quantization (OPQ) — Non-Para OPQ via iterative SVD-Procrustes rotation that minimizes PQ reconstruction error, yielding 10–20% recall improvement over vanilla PQ at equal memory.
opq_kmeans
Lloyd’s k-means for OPQ codebook training.
opq_rotation
Shared utilities for OPQ codebook training.
rabitq
RaBitQ — 1-bit quantization with O(1/√D) MSE error bound (SIGMOD 2024).
ternary
BitNet b1.58 ternary quantization codec.