Asymmetric Distance Computation (ADC) is a distance approximation technique used with Product Quantization (PQ) where the distance is calculated between an uncompressed (full-precision) query vector and compressed database vectors. This asymmetry yields a more accurate approximation than symmetric computation between two compressed vectors. The method is fundamental to the IVFADC index in libraries like Faiss, enabling high-recall nearest neighbor search at a fraction of the memory cost of storing full vectors.
Glossary
Asymmetric Distance Computation (ADC)

What is Asymmetric Distance Computation (ADC)?
A core technique in vector database indexing that enables fast, accurate similarity search on compressed data.
ADC operates by pre-computing a lookup table of distances between the uncompressed query subvectors and all centroids in the PQ codebook for each subspace. The approximate distance to a compressed database vector is then efficiently computed by summing the looked-up values for its assigned centroid IDs. This provides a superior distance estimation compared to symmetric lookup, directly improving search recall without sacrificing the memory efficiency and speed gains of vector compression.
Key Characteristics of ADC
Asymmetric Distance Computation (ADC) is a core technique for accelerating similarity search in compressed vector spaces. It is primarily used with Product Quantization to enable fast, approximate distance calculations with higher accuracy than symmetric alternatives.
Asymmetry in Distance Calculation
The defining feature of ADC is the asymmetric nature of its distance computation. Unlike symmetric methods, ADC calculates distances between an uncompressed query vector and compressed database vectors. This asymmetry is crucial because the original, high-fidelity query vector is compared against a quantized approximation of the database vector. This preserves more information from the query side, leading to a more accurate distance approximation than if both vectors were compressed (symmetric computation).
Integration with Product Quantization
ADC is not a standalone compression method; it is the distance calculation protocol used with Product Quantization (PQ). In this system:
- Database vectors are compressed offline using PQ, splitting them into subvectors and replacing each with a codebook centroid index.
- At query time, the uncompressed query vector is split into the same subvectors.
- Distances are computed by looking up pre-computed distance tables between the query's subvectors and the PQ codebook centroids, then summing these partial distances. This lookup-table approach is the engine of ADC's speed.
Memory Efficiency vs. Query Accuracy Trade-off
ADC enables a favorable operational trade-off. By storing only compact PQ codes (e.g., 8 bytes per vector instead of 128 bytes for a full-precision vector), it achieves massive memory footprint reduction, often 10x or more. This allows billion-scale vector datasets to reside in RAM. The cost is a loss in distance calculation precision versus an exhaustive search. However, ADC's asymmetric design minimizes this accuracy loss compared to symmetric PQ, making it a preferred choice for high-recall, memory-constrained applications.
Use in Multi-Stage Indexes (IVFADC)
ADC is commonly deployed in hybrid, multi-stage indexes to balance speed and accuracy. The most prominent example is the IVFADC index in Facebook AI Similarity Search (Faiss). This architecture combines:
- A coarse quantizer (Inverted File, IVF) that narrows the search to a subset of promising database vectors.
- A fine quantizer using PQ with ADC to compute precise distances within that subset. This structure provides fast candidate retrieval via IVF and accurate re-ranking via ADC, making it a production-standard for large-scale similarity search.
Computational Overhead at Query Time
While ADC saves memory, it introduces computational overhead during a query. The system must perform multiple table lookups and additions—one for each PQ subspace—to reconstruct the approximate distance. This is more expensive than computing a simple dot product or L2 distance between two full vectors. However, this cost is fixed and predictable (O(m) for m subspaces), and is dramatically offset by the reduced number of comparisons needed due to efficient indexing structures like IVF.
Contrast with Symmetric Distance Computation (SDC)
ADC's advantages are clearest when contrasted with Symmetric Distance Computation (SDC). In SDC, both the query and database vectors are compressed using the same PQ codebooks before distance calculation. This double compression amplifies quantization error, leading to less accurate distance estimates. ADC avoids this by keeping the query in its original, high-dimensional space. The trade-off is that SDC can have even faster query times if its distance tables can be precomputed, but this is typically at a significant cost to search recall and accuracy.
ADC vs. Symmetric Distance Computation (SDC)
A comparison of the two primary methods for calculating distances when using Product Quantization (PQ) for vector compression, highlighting the trade-offs between accuracy and computational cost.
| Feature / Metric | Asymmetric Distance Computation (ADC) | Symmetric Distance Computation (SDC) |
|---|---|---|
Core Definition | Calculates distance between an uncompressed (full-precision) query vector and compressed database vectors. | Calculates distance between two compressed vectors (both query and database vectors are quantized). |
Query Vector Representation | Uncompressed, full-precision (e.g., 32-bit float). | Compressed using the same Product Quantization codebooks as the database. |
Distance Calculation Accuracy | Higher accuracy. Avoids quantization error on the query side, leading to better approximations of true distances. | Lower accuracy. Suffers from double quantization error, as both vectors in the comparison are approximated. |
Pre-Computation Potential | Low. Distances must be computed at query time via lookup table (LUT) operations, as the query is unique. | High. Distances between compressed codes can be fully pre-computed into a static lookup table, enabling extremely fast table lookups. |
Memory Overhead at Query Time | Moderate. Must store and compute a distance lookup table (LUT) for the specific query subvectors. | Minimal. Uses a single, static distance table pre-computed for all possible codebook centroid pairs. |
Typical Query Latency | Higher than SDC due to on-the-fly LUT computation, but lower than brute-force search on uncompressed data. | Extremely low. Distance reduces to a single lookup in a pre-computed matrix of centroid distances. |
Primary Use Case | Standard vector search where query accuracy is paramount and queries are unique. The default mode for IVFADC and similar indices. | Extremely high-throughput scenarios where queries are also quantized and some accuracy loss is acceptable (e.g., batch processing, re-ranking stages). |
Impact on Recall@K | Higher recall for a given compression level and candidate list size. | Lower recall compared to ADC at equivalent settings, due to query-side quantization error. |
ADC in Libraries and Databases
Asymmetric Distance Computation (ADC) is a core technique for efficient similarity search, implemented in major vector databases and libraries to balance accuracy with performance.
Frequently Asked Questions
Asymmetric Distance Computation (ADC) is a core technique in vector database optimization that enables fast and accurate similarity search on compressed data. These questions address its mechanics, trade-offs, and role in modern retrieval systems.
Asymmetric Distance Computation (ADC) is a distance approximation technique used with Product Quantization (PQ) where distances are calculated between an uncompressed (full-precision) query vector and compressed database vectors. It works by splitting both the query and database vectors into subvectors. A codebook of centroids is learned for each subspace. During search, the uncompressed query subvectors are compared to all centroids in each codebook, and the resulting partial distance lookup tables are pre-computed. The distance to any compressed database vector—which is stored as a tuple of centroid indices—is then approximated by summing the pre-computed partial distances fetched from these tables. This asymmetric approach (full-precision query vs. compressed database) yields more accurate distance estimates than Symmetric Distance Computation (SDC), where both vectors are compressed.
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 the Product Quantization family. These related terms define the ecosystem of methods and metrics for optimizing high-dimensional vector search.
Product Quantization (PQ)
Product Quantization (PQ) is the foundational lossy compression technique that enables ADC. It works by:
- Splitting a high-dimensional vector into multiple subvectors.
- Quantizing each subspace independently using a separate, learned codebook.
- Representing the original vector by a tuple of codebook indices (codes). ADC specifically refers to the distance calculation between an uncompressed query and these PQ-compressed database vectors, which is more accurate than symmetric PQ-to-PQ distance computation.
Symmetric Distance Computation (SDC)
Symmetric Distance Computation (SDC) is the alternative to ADC where both the query vector and the database vectors are compressed using the same Product Quantization codebooks. Distance is then approximated using pre-computed lookup tables of distances between codewords.
- Key Difference: SDC is faster but less accurate than ADC because it introduces quantization error on both sides of the distance calculation.
- Use Case: Often used for re-ranking a very small candidate set where speed is paramount and the query can be compressed offline.
IVFADC Index (Faiss)
IVFADC is a canonical composite index structure in Facebook AI Similarity Search (Faiss) that combines two techniques for hierarchical search:
- Inverted File (IVF) for coarse quantization: Partitions the dataset into clusters (Voronoi cells) and performs a non-exhaustive search by probing only the nearest clusters.
- Asymmetric Distance Computation (ADC) for fine quantization: Compresses the residual vectors (original vector minus cluster centroid) using Product Quantization. This architecture provides a practical balance, using IVF for fast candidate generation and ADC for accurate, memory-efficient distance calculation within those candidates.
Residual Quantization
Residual Quantization is a refinement technique often used with PQ and ADC to improve accuracy. The process is:
- Calculate the residual vector by subtracting a coarse approximation (e.g., a cluster centroid from IVF) from the original vector.
- Apply Product Quantization to this residual vector instead of the original.
- The ADC distance is then computed between the query's residual and the PQ-compressed database residuals. This multi-stage approach allows the quantization to focus on the error from the first stage, leading to a more precise overall approximation.
Distance Approximation Error
Distance Approximation Error is the numerical difference between the true distance (e.g., exact L2) and the approximated distance calculated by a method like ADC or SDC. This error directly impacts search quality metrics like Recall.
- ADC vs. SDC: ADC typically has lower approximation error than SDC because the query vector remains uncompressed.
- Trade-off: The error is influenced by PQ parameters (number of subvectors, codebook size). Reducing error improves recall but increases memory for codebooks and computation for distance lookup tables.
Lookup Table (LUT) Precomputation
Lookup Table (LUT) Precomputation is the critical optimization that makes ADC fast at query time. For a given uncompressed query vector:
- For each Product Quantization subspace, the distance between the query's subvector and every codeword in that subspace's codebook is precomputed.
- This results in
msmall lookup tables (wheremis the number of subvectors). - To compute the ADC distance to a database vector, the system simply sums the values fetched from these
mtables using the vector's code indices. This replaces expensive floating-point operations with efficient table lookups and addition.

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