To search through massive collections of high-dimensional vectors efficiently, modern vector databases rely on compression techniques like quantization. By mapping continuous, high-dimensional vectors into compact discrete codes, systems can drastically reduce memory footprints and accelerate similarity computations.
However, compressing a continuous space into discrete bins fundamentally alters its geometry. Standard quantization approaches often introduce a subtle but destructive flaw: systematic estimation bias. When we use these compressed codes to approximate distances or inner products, the errors do not simply cancel out. Instead, they skew the geometric relationships between vectors, degrading search accuracy.
A prominent line of research addresses this challenge by developing methods for unbiased distance estimation. By understanding the geometric origins of quantization bias, researchers have designed coding schemes and mathematical estimators where approximation errors average out to exactly zero, unlocking high-accuracy search without the need for expensive full-precision data.
The Geometric Origin of Quantization Bias
Why does standard quantization distort distances? The issue lies in how compression algorithms optimize for individual vector reconstructions versus how they preserve pairwise relationships.
As observed by Babenko et al. in Pairwise Quantization, traditional vector quantization frameworks focus heavily on minimizing the reconstruction error of individual points. While this makes the compressed vector look as close to the original as possible in isolation, it introduces a systematic bias when calculating distances between two compressed points: it consistently underestimates their squared Euclidean distance.
A similar phenomenon occurs when compressing vectors using random projections. As Li et al. demonstrate in Random Projections with Asymmetric Quantization., mapping continuous projections to low-bit representations introduces a systematic "shrinkage" effect. This shrinkage distorts the perceived inner product (or cosine similarity) between vectors. If every distance estimate is systematically shrunk or skewed, the relative ordering of nearest neighbors changes, causing retrieval algorithms to miss the true closest matches.
Why Naive Estimators and Random Offsets Fail
Quantization bias typically creeps into systems in two ways: treating discrete codes as continuous numbers, or introducing artificial randomness during the binning process.
The Non-Linearity of Discrete Bins
In Quantized Random Projections and Non-Linear Estimation of Cosine Similarity, Li et al. point out that standard linear estimation methods treat multi-bit quantized values as ordinary continuous numbers. This assumption ignores the inherent non-linearity of the quantization process. When a continuous projection is forced into a coarse discrete bin (e.g., using 2 to 6 bits), a naive linear inner product fails to reflect the true underlying distribution, creating severe statistical bias and inefficiency at low bit depths.
The Hidden Cost of Random Offsets
To combat binning artifacts, traditional Locality Sensitive Hashing (LSH) frameworks historically added a random offset (a random shift) to the quantization windows. The intuition was that randomizing the bin boundaries would smooth out errors.
However, a series of papers by Li et al., including Coding for Random Projections and Coding for Random Projections and Approximate Near Neighbor Search, proved that this conventional wisdom is incorrect. The authors demonstrated that random offsets introduce unnecessary variance into similarity estimators.
With Random Offset (Standard LSH):
Continuous Value ----[ + Random Shift ]----> Round to Bin ----> High Variance / False Collisions
Deterministic Uniform Quantization (Offset-Free):
Continuous Value --------------------------> Round to Bin ----> Low Variance / Capped Collisions
More damagingly, as the quantization bin width increases, a random offset causes the collision probability of completely unrelated or orthogonal vectors to approach 100%. By removing the random offset and sticking to simple, deterministic uniform quantization, the authors showed that the collision probability for orthogonal vectors caps at 50%. Eliminating the offset optimizes the "locality gap"—the contrast between how close neighbors and distant points behave—which directly lowers the computational complexity of the search.
Correcting the Bias: Non-Linearity and Normalization
If the mapping from continuous space to discrete bits is inherently biased and non-linear, how do we recover the true geometric distances? Researchers have proposed two primary strategies on the estimation side: modeling the non-linearity explicitly, or applying geometric corrections that cancel out the bias.
Maximum Likelihood Estimation
Instead of using a simple linear formula to calculate similarity from quantized bits, we can use statistical models that understand the binning process. In 2-Bit Random Projections, NonLinear Estimators, and Approximate Near Neighbor Search, Li et al. utilize a non-linear Maximum Likelihood Estimator (MLE). Because the MLE mathematically accounts for the discrete boundaries of the bins, it can accurately reconstruct cosine similarities from coarse 2-bit projections, finding a practical "sweet spot" between low storage and high search accuracy.
The Normalization Shortcut
While effective, statistical estimators like MLE can be computationally expensive. In Simple strategies for recovering inner products from coarsely quantized random projections, the authors discovered a surprisingly simple alternative. Although applying a standard linear inner product directly to coarsely quantized bit-strings introduces massive bias due to geometric shrinkage, simply normalizing the resulting vectors effectively cancels out this distortion. This normalization step allows cheap, fast linear operations to achieve the same accuracy as complex statistical models without the computational overhead.
Designing Unbiased Quantization Frameworks
Rather than fixing the distances after quantization, a more robust approach is to design the quantization framework itself to be inherently unbiased. An estimator is considered unbiased if its expected value matches the true value exactly.
An early example of this design philosophy appears in Pairwise Quantization, where the authors apply a data-driven linear transformation to the vectors before they are quantized. This transformation is optimized specifically to counteract and eliminate the systematic underestimation of squared Euclidean distances.
Randomized Geometry and RaBitQ
More recently, this concept has culminated in randomized quantization frameworks that offer strict theoretical guarantees. As detailed by Long et al. in RaBitQ: Quantizing High-Dimensional Vectors with a Theoretical Error Bound for Approximate Nearest Neighbor Search, instead of relying on heuristic codebooks (like Product Quantization), vectors can be quantized using randomly rotated hypercube vertices. This randomized geometric structure yields an exact, mathematically provable unbiased estimator for both inner products and squared Euclidean distances directly from the quantized bit strings.
Heuristic Quantization (e.g., PQ):
True Distance ───> [ Quantization ] ───> Biased Estimate (Systematic Underestimation)
Unbiased Quantization (e.g., RaBitQ):
True Distance ───> [ Random Rotation + Hypercube Binning ] ───> Unbiased Estimate (Errors average to 0)
Why Unbiasedness Changes Everything
The practical implications of an unbiased distance estimator are profound. As explained by Gao et al. in Practical and Asymptotically Optimal Quantization of High-Dimensional Vectors in Euclidean Space for Approximate Nearest Neighbor Search, when an estimator is unbiased, the approximation errors across multiple dimensions and queries are guaranteed to average out to zero.
In a comprehensive overview, Gao et al. note in High-Dimensional Vector Quantization: General Framework, Recent Advances, and Future Directions that this property prevents systematic drift and stabilizes performance across highly diverse datasets. Because the average estimated distance perfectly aligns with the true Euclidean distance, vector search engines can achieve near-perfect recall during candidate retrieval. This completely eliminates the industry-standard requirement of keeping the original, full-precision vectors in memory for a final re-ranking phase, leading to massive savings in both memory and time.
Key Foundational Work
Coding for Random Projections (2014) — contributed 3 concept elements to this direction.
Coding for Random Projections and Approximate Near Neighbor Search (2014) — contributed 3 concept elements to this direction.
Pairwise Quantization (2016) — contributed 2 concept elements to this direction.