Database / Qdrant Vector DB Interview questions
Explain the internal working of binary quantization and why it's fast?
Binary quantization compresses each dimension of a vector down to just one or two bits, typically by checking whether that dimension's value falls above or below a threshold (often zero, for centered embeddings), turning a vector of floats into a compact bit string.
Comparing two binary-quantized vectors then reduces to a bitwise XOR followed by a population count (popcount) — counting how many bits differ between the two — both of which map directly onto dedicated, highly optimized CPU instructions available on modern hardware, making each individual distance computation extremely cheap compared to floating-point arithmetic.
Because this compression discards a meaningful amount of information from each dimension (down to a single bit), the initial ranking from pure binary-quantized comparison is much coarser than the true distance; Qdrant compensates by using it as a fast first-pass filter, then rescoring the top candidates using the original, uncompressed vectors to recover final ranking accuracy — this is the oversampling and rescoring pattern that makes binary quantization practical despite its aggressive compression.
More Related questions...