Database / Qdrant Vector DB Interview questions
Define scalar quantization in Qdrant?
Scalar quantization is a vector compression technique that converts each 32-bit floating-point component of a vector into an 8-bit integer, achieving roughly 4x memory reduction with typically minimal accuracy loss, at the cost of some precision in similarity scoring.
client.update_collection( collection_name="documents", quantization_config=models.ScalarQuantization( scalar=models.ScalarQuantizationConfig( type=models.ScalarType.INT8, quantile=0.99, always_ram=True, ) ), )
The conversion isn't a naive rounding operation: Qdrant analyzes the actual distribution of values in each vector dimension (typically using quantiles to avoid letting rare outliers stretch the mapping range too far) and computes a linear mapping from the float32 range down to the int8 range, which can later be approximately reversed to recover float values with a small, bounded loss of precision.
Beyond the memory savings, scalar quantization also tends to improve raw search speed, since int8 arithmetic benefits from SIMD instructions and is computationally cheaper than the equivalent float32 operations for distance calculations like dot product and cosine similarity, which dominate the cost of a vector search.
More Related questions...