RaBitQ

Rotation-based binary vector quantization algorithm. Gao & Long, SIGMOD 2024 (arXiv:2405.12497). Shares the same “rotate then quantize” foundation as TurboQuant but with different choices: pure binarization instead of Lloyd-Max codebook, and asymmetric 1-bit scoring.

Core Ideas

  1. Random orthogonal rotation before quantization — same as TurboQuant; equalizes coordinate variance
  2. Per-vector length rescaling — store one scalar per vector recording how much quantization shrank the length; multiply back at score time. Fixes the systematic length bias of rotation-based methods at cost of 4 bytes/vector (one multiplication). More efficient than TurboQuant PROD’s full QJL projection.
  3. 1-bit asymmetric scoring — data stored as one bit/coordinate (sign after rotation); query stored as B-bit scalar quantization transposed into B bit-planes. Inner product = AND + popcount per bit-plane, weighted by 2^b

Relationship to TurboQuant

TurboQuant (MSE)RaBitQ
RotationRandom orthogonalRandom orthogonal
QuantizationLloyd-Max codebook (universal, no training)Pure binarization (sign)
Length correctionPROD variant (QJL, expensive)Per-vector scalar (4 bytes, cheap)
1-bit scoringCodebook lookupBit-plane AND + popcount

Qdrant’s TurboQuant implementation borrows RaBitQ’s length renormalization and 1-bit bit-plane scoring, combining them with TurboQuant’s MSE codebook and anisotropy compensation.

Where Used

  • Qdrant borrows length renormalization and 1-bit scoring for the TurboQuant 1.18 implementation

Articles