Asymmetric Distance Computation (ADC) is a technique for approximating distances between vectors where the query vector is kept in its original, full-precision form while the database vectors are quantized (compressed). This asymmetry yields more accurate distance estimates than Symmetric Distance Computation (SDC), where both vectors are quantized, because it minimizes the quantization error introduced on the query side. It is a core component of efficient Approximate Nearest Neighbor Search (ANNS) in systems like FAISS and is often paired with Product Quantization (PQ).
Glossary
Asymmetric Distance Computation (ADC)

What is Asymmetric Distance Computation (ADC)?
A method for approximating vector distances in similarity search that prioritizes query accuracy by treating query and database vectors differently.
The primary advantage of ADC is its improved accuracy-for-memory trade-off. By calculating distances between a full-precision query and quantized database vectors, the system avoids compounding errors. This is implemented by pre-computing lookup tables of distances between the query's subvectors and all quantization centroids. During search, distances are approximated via efficient table lookups rather than expensive full-precision calculations. ADC is fundamental to the IVFPQ index, enabling fast, high-recall search in billion-scale vector databases.
Key Characteristics of ADC
Asymmetric Distance Computation (ADC) is a core technique in vector search that optimizes the trade-off between memory, speed, and accuracy by applying quantization asymmetrically between stored and query vectors.
Asymmetric Quantization Principle
The defining mechanism of ADC is its asymmetric treatment of query and database vectors. Database vectors are compressed (quantized) for storage efficiency, while the query vector remains in its original, full-precision form during distance calculation. This contrasts with Symmetric Distance Computation (SDC), where both query and database vectors are quantized, leading to compounded quantization error. By keeping the query vector pristine, ADC provides a more accurate approximation of the true distance to each compressed database point.
Accuracy vs. Symmetric Computation
ADC is explicitly designed to deliver higher search accuracy than its symmetric counterpart for the same level of compression. The error in distance estimation comes solely from quantizing the database vector, not the query. This is critical for maintaining high Recall@k in production systems. For example, in a Product Quantization (PQ) setup, using ADC instead of SDC can improve recall by a significant margin (e.g., 5-15 percentage points) without increasing memory usage, as the compressed database representation remains identical.
Integration with Composite Indexes (IVFPQ)
ADC is most famously employed within the IVFPQ (Inverted File with Product Quantization) index architecture. Here, it operates on the residual vectors within each Voronoi cell:
- The Inverted File (IVF) acts as a coarse quantizer, narrowing the search to a few candidate cells.
- Product Quantization (PQ) compresses the residual vectors within those cells.
- ADC is then used to compute the approximate distance between the full-precision query residual and each PQ-compressed database residual. This combination makes IVFPQ a powerhouse for billion-scale searches, balancing speed, memory efficiency, and accuracy.
Computational and Memory Trade-off
ADC introduces a specific cost-benefit profile:
- Memory Efficiency: Database vectors are heavily compressed (e.g., to 8-32 bytes per vector using PQ), enabling massive datasets to reside in RAM.
- Computational Overhead: Distance calculations are more expensive than with SDC. ADC requires reconstructing an approximation of the database vector from codes and computing the distance to the full-precision query. This is often accelerated via precomputed lookup tables that store partial distances between query subvectors and quantization centroids.
- The Trade-off: You exchange some CPU cycles for significantly higher accuracy at a fixed memory budget, which is almost always the preferred trade-off in large-scale retrieval.
Lookup Table (LUT) Optimization
A key performance optimization for ADC, especially with Product Quantization, is the use of precomputed lookup tables (LUTs). Since the query is full-precision and known at search time:
- For each subsegment (subvector) of the query, the distance to every possible centroid in the PQ codebook for that segment is precomputed.
- To compute the distance to a compressed database vector, the system simply fetches and sums the precomputed distances for each of its subvector codes from the LUTs.
- This transforms a complex floating-point operation into efficient memory-bound table lookups and additions, making ADC searches remarkably fast despite the asymmetric calculation.
Application in Maximum Inner Product Search (MIPS)
ADC is not limited to Euclidean (L2) distance. It is equally crucial for Maximum Inner Product Search (MIPS), a common operation in recommendation systems. The asymmetric principle remains: the full-precision query vector's inner product is approximated with quantized database vectors. Libraries like Google's SCANN use advanced variants of anisotropic vector quantization specifically designed for ADC in the MIPS context, demonstrating the technique's fundamental importance across different similarity metrics.
ADC vs. Symmetric Distance Computation (SDC)
A comparison of two fundamental distance approximation methods used in vector search, focusing on their quantization strategies, accuracy, and computational trade-offs.
| Feature / Metric | Asymmetric Distance Computation (ADC) | Symmetric Distance Computation (SDC) |
|---|---|---|
Core Principle | Query vector is full-precision; database vectors are quantized. | Both query and database vectors are quantized to the same representation. |
Quantization Error Source | Error originates only from the quantization of database vectors. | Error is compounded from the quantization of both the query and database vectors. |
Typical Accuracy (Recall@10) | Higher (e.g., 95-99% for same memory budget) | Lower (e.g., 85-92% for same memory budget) |
Query-Time Compute Cost | Higher (requires computing distances to quantized centroids or codebooks) | Lower (pre-computed lookup tables can be used for quantized distances) |
Memory Footprint for Vectors | Lower for database; query vector stored in memory at full precision. | Lower for both database and query vectors. |
Primary Use Case | Prioritizing high search accuracy and recall. | Prioritizing ultra-low latency and maximum query throughput. |
Common Implementation | Used as the fine quantizer in IVFPQ and similar composite indexes. | Used in standalone Product Quantization (PQ) for in-memory search. |
Distance Calculation | Asymmetric distance: d(q, x) ≈ d(q, q(x)) where q(x) is quantized x. | Symmetric distance: d(q, x) ≈ d(q(q), q(x)) where both are quantized. |
Where is ADC Implemented?
Asymmetric Distance Computation (ADC) is a core algorithmic technique integrated into vector search libraries and database engines to balance accuracy with memory efficiency. Its primary implementation is within multi-stage indexing architectures that separate coarse and fine quantization.
Vector Databases (e.g., Pinecone, Weaviate, Milvus)
Commercial and open-source vector databases implement ADC under the hood when using IVF-PQ composite indexes. The database engine handles:
- Transparent quantization of ingested vectors into PQ codes.
- Asymmetric distance calculation at query time, where the incoming query vector is not quantized.
- Integration with filtering, ensuring ADC works seamlessly with metadata filters. This abstraction allows developers to benefit from ADC's memory savings and accuracy without managing the low-level complexity of distance computations.
IVFPQ Index Architecture
ADC is fundamentally the distance computation layer within an IVFPQ (Inverted File with Product Quantization) index. The implementation follows a two-stage process:
- Coarse Quantizer (IVF): The query is compared to cluster centroids using full-precision distances to select the nearest Voronoi cells.
- Fine Quantizer (PQ) with ADC: For each candidate vector in the selected cells, the distance is computed asymmetrically between the full-precision query and the PQ-compressed database vector. This involves looking up pre-computed distance tables between the query's subvectors and the PQ codebooks, a process far faster than reconstructing the database vector.
Maximum Inner Product Search (MIPS)
ADC is critically adapted for Maximum Inner Product Search (MIPS), a common similarity metric in recommendation systems. The asymmetric computation for MIPS involves:
- Transforming the database vectors via asymmetric transformation (e.g., adding a sufficiently large constant to make all entries non-negative).
- Quantizing the transformed database vectors.
- Computing the inner product between the full-precision query and the quantized, transformed database vector. Libraries like ScaNN from Google Research implement specialized anisotropic quantization techniques that are inherently asymmetric to optimize for MIPS accuracy.
Two-Stage Search with Exact Re-ranking
ADC is often deployed as the first, fast retrieval stage in a two-stage search pipeline.
- Stage 1 (ADC): A compressed index (like IVFPQ) uses asymmetric distances to rapidly produce a shortlist of candidate vectors (e.g., top 1000).
- Stage 2 (Exact Re-ranking): The shortlist is re-scored using exact, full-precision distances between the original query and the original, uncompressed database vectors fetched from a separate store. This hybrid approach combines ADC's scalability with the perfect accuracy of exact search for the final result set.
Custom Search Kernels & Hardware
For ultimate performance, ADC logic is implemented in low-level, optimized kernels:
- GPU Kernels: Libraries like FAISS write CUDA kernels that parallelize the ADC distance table lookups and accumulations across thousands of threads.
- Neural Processing Units (NPUs): Custom compilers for AI accelerators can map ADC's operations to specialized matrix multiplication and lookup units.
- CPU SIMD Instructions: Optimized C++ implementations use AVX-512 or Neon instructions to accelerate the subvector distance computations that underpin ADC. This hardware-level implementation is key to achieving low-latency search at scale.
Frequently Asked Questions
Asymmetric Distance Computation (ADC) is a core technique in vector search that optimizes the trade-off between memory, speed, and accuracy. These questions address its mechanics, advantages, and practical applications.
Asymmetric Distance Computation (ADC) is a method for approximating the distance between vectors where the query vector is kept in its original, full-precision form while the database vectors are stored in a compressed, quantized representation. This asymmetry yields a more accurate distance estimate than Symmetric Distance Computation (SDC), where both query and database vectors are quantized. The technique is foundational to efficient Approximate Nearest Neighbor Search (ANNS) in large-scale vector databases, as it dramatically reduces memory usage and accelerates search while preserving high recall.
ADC operates by pre-computing and storing quantized representations of database vectors (e.g., using Product Quantization). During a search, the system calculates distances between the full-precision query and these pre-computed quantized forms using lookup tables for speed. This approach is central to composite indexes like IVFPQ (Inverted File Index with Product Quantization).
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Asymmetric Distance Computation (ADC) is a core technique within vector indexing for efficient similarity search. It operates within a broader ecosystem of algorithms and metrics designed to balance speed, accuracy, and memory usage.
Product Quantization (PQ)
Product Quantization (PQ) is the foundational compression technique that enables ADC. It splits a high-dimensional vector into subvectors and quantizes each subvector using a separate, learned codebook. The original vector is represented by a short code composed of the indices of the nearest centroid for each subsegment.
- Core Mechanism: Enables massive memory reduction by storing codes instead of full-precision vectors.
- Relation to ADC: In ADC, database vectors are compressed using PQ, while the query remains uncompressed for the distance calculation.
Symmetric Distance Computation (SDC)
Symmetric Distance Computation (SDC) is the alternative to ADC where both the query vector and the database vectors are quantized using the same method (e.g., Product Quantization). Distances are approximated using only the quantized representations.
- Key Difference: SDC is faster but less accurate than ADC because it introduces quantization error on both sides of the distance calculation.
- Trade-off: ADC sacrifices some speed for significantly higher accuracy by keeping the query in full precision, making it preferable for applications where recall is critical.
IVFPQ (Inverted File with Product Quantization)
IVFPQ is a composite indexing algorithm that combines an Inverted File (IVF) for coarse partitioning with Product Quantization (PQ) for fine compression. It is the most common practical framework where ADC is deployed.
- Two-Stage Search: 1) The IVF coarse quantizer selects a few relevant partitions (Voronoi cells). 2) ADC is performed within those cells using PQ-compressed residuals.
- Industry Standard: This architecture, implemented in libraries like FAISS, provides an optimal balance of speed, accuracy, and memory efficiency for billion-scale datasets.
Quantization Error
Quantization Error is the distortion or loss of information introduced when a continuous-valued vector is compressed into a discrete representation (e.g., via PQ or Scalar Quantization). This error directly impacts the accuracy of approximate distance calculations.
- Impact on Search: Higher quantization error lowers recall, as the compressed representation may not accurately preserve true distances.
- ADC's Advantage: By keeping the query vector in full precision, ADC mitigates the compounding effect of quantization error, leading to a more accurate approximation of the true distance compared to SDC.
Fine Quantizer
In a multi-stage vector index like IVFPQ, the Fine Quantizer is the component responsible for the high-resolution compression of vectors within a coarse partition. Product Quantization is the quintessential fine quantizer.
- Role: Compresses the residual vectors (the difference between the original vector and its coarse centroid) to enable dense, memory-efficient storage.
- ADC Execution: The fine quantizer's codebooks are used during ADC to compute the asymmetric distance between a full-precision query and the PQ-compressed database vector.
Recall@k
Recall@k is the primary evaluation metric for the accuracy of an Approximate Nearest Neighbor (ANN) search. It measures the proportion of the true k-nearest neighbors (found via exact search) that are present in the top k results returned by the approximate index.
- Formula:
Recall@k = (Number of true neighbors in retrieved top k) / k. - ADC's Objective: The design goal of ADC is to maximize Recall@k for a given memory budget and query latency by providing more accurate distance approximations than symmetric alternatives.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us