Asymmetric Distance Computation (ADC) is a method for estimating the distance between a raw, uncompressed query vector and a database vector that has been compressed via quantization. This asymmetric approach, where only the database vectors are compressed, yields more accurate distance approximations than symmetric computation between two compressed vectors. It is a fundamental component of high-performance indices like IVFADC.
Glossary
Asymmetric Distance Computation (ADC)

What is Asymmetric Distance Computation (ADC)?
A core technique in approximate nearest neighbor search for efficiently comparing vectors when database entries are compressed.
The technique's accuracy stems from using the full-precision query to calculate distances to the quantization centroids representing the compressed database vectors. By avoiding the error of compressing the query, ADC preserves fidelity, directly improving recall in similarity search. This makes it essential for balancing high accuracy with the massive memory savings offered by compression methods like Product Quantization (PQ) in billion-scale vector databases.
Key Characteristics of ADC
Asymmetric Distance Computation (ADC) is a core technique for efficient similarity search on compressed vectors. It is defined by its asymmetric distance function, quantization-based compression, and its role in balancing speed, memory, and accuracy.
Asymmetric Distance Function
The defining characteristic of ADC is its asymmetric distance function. It computes the distance between a raw, uncompressed query vector and a compressed database vector. This is more accurate than symmetric distance computation (SDC), which compares two compressed vectors, because it avoids the quantization error on the query side. The raw query retains its full precision, leading to a better approximation of the true distance to the original, uncompressed database point.
Built on Vector Quantization
ADC is not a standalone algorithm but a computation method applied on top of vector quantization techniques, most commonly Product Quantization (PQ). The database vectors are compressed during index building by being mapped to codes from a set of learned codebooks. ADC uses these codes and the original codebook centroids to reconstruct an approximation of the database vector for distance calculation against the raw query.
- Core Dependency: Requires a pre-trained quantizer (e.g., PQ codebooks).
- Storage Benefit: Database vectors are stored as short integer codes, drastically reducing memory footprint.
Accuracy vs. Symmetric Computation
ADC provides a higher fidelity distance approximation compared to Symmetric Distance Computation (SDC). In SDC, both the query and database vectors are compressed, compounding quantization errors. ADC's preservation of the raw query vector eliminates one source of error. For a given compression level (e.g., PQ with 8 bits per subspace), using ADC typically yields higher recall@K for the same search scope compared to SDC, or allows for more aggressive compression to achieve a target recall level.
Computational Overhead Trade-off
The improved accuracy of ADC comes with a computational cost. Calculating an asymmetric distance is more expensive than a symmetric one. For Product Quantization, an ADC distance involves:
- Looking up centroid vectors from codebooks using the database vector's codes.
- Computing the distance between the raw query and the reconstructed approximation. This requires more arithmetic operations and memory lookups than simply comparing two short codes. This trade-off is managed by combining ADC with a coarse quantizer (like in IVFADC) to limit the number of compressed vectors evaluated.
Primary Use in IVFADC
ADC is most famously implemented within the IVFADC (Inverted File with Asymmetric Distance Computation) index structure, popularized by the Faiss library. In this composite index:
- An Inverted File (IVF) acts as a coarse quantizer, selecting a shortlist of candidate vectors (a Voronoi cell).
- The vectors within that shortlist are compressed using Product Quantization.
- ADC is used to rank this shortlist by computing distances between the raw query and each compressed candidate. This architecture exemplifies ADC's role in the second-stage, fine-grained ranking of a pre-filtered set.
Enabling Billion-Scale Search
ADC is a key enabler for billion-scale vector databases. By allowing database vectors to be highly compressed (to just a few bytes each) while maintaining search accuracy, it makes holding massive datasets in RAM feasible. The memory efficiency of PQ combined with the accuracy of ADC allows systems to trade modest increases in CPU computation for massive reductions in memory footprint and I/O, which is often the limiting factor at scale. This makes it a cornerstone technique for practical, large-scale similarity search in production.
ADC vs. Symmetric Distance Computation
This table contrasts the core operational and performance characteristics of Asymmetric Distance Computation (ADC) with Symmetric Distance Computation (SDC) in the context of Product Quantization (PQ) for approximate nearest neighbor search.
| Feature / Metric | Asymmetric Distance Computation (ADC) | Symmetric Distance Computation (SDC) |
|---|---|---|
Core Principle | Distance is computed between a raw (uncompressed) query vector and a compressed database vector. | Distance is computed between two compressed vectors (both query and database vectors are quantized). |
Query Vector State | Raw, full-precision vector (e.g., FP32). | Compressed using the same Product Quantization codebooks as the database. |
Distance Calculation | Asymmetric: d(q, x) ≈ d(q, PQ(x)). Uses pre-computed lookup tables (LUTs) of distances between the raw query's subvectors and all PQ centroids. | Symmetric: d(PQ(q), PQ(x)). Uses a pre-computed distance table between all possible PQ centroid pairs. |
Accuracy (Recall) | Higher. Avoids quantization error on the query side, leading to a more accurate approximation of the true distance. | Lower. Suffers from double quantization error, as both vectors are approximated. |
Query-Time Compute Cost | Higher. Requires computing distances from the raw query's subvectors to all M*ks centroids to populate the LUTs, where M is the number of subspaces and ks is the number of centroids per subspace. | Lower. The symmetric distance table between centroids is static and can be fully pre-computed during index training. |
Memory Overhead at Query Time | Higher. Must store M*ks distances in LUTs in memory for the active query. | Lower. Only needs to store the single, static Mksks symmetric distance table, amortized across all queries. |
Primary Use Case | Standard search scenarios where query accuracy is paramount and queries are processed sequentially or in small batches. | Extreme performance scenarios, such as re-ranking a shortlist from a coarse quantizer (IVF), where the query must also be compressed to minimize overhead. |
Typical Integration | IVFADC (Inverted File with ADC) for main search. | Often used for fast, lower-accuracy distance calculations within a refined candidate list. |
Where is ADC Used?
Asymmetric Distance Computation (ADC) is a core technique for accelerating similarity search in large-scale vector databases. Its primary use is to enable fast and accurate retrieval when database vectors are compressed, a common requirement for production AI systems.
Large-Scale Recommendation Systems
ADC is fundamental to real-time personalization engines in platforms like e-commerce and streaming services. It enables sub-millisecond retrieval of similar items or content from catalogs containing hundreds of millions of product or media embeddings. By compressing the database vectors with Product Quantization (PQ) and using ADC for querying, these systems balance high recall with stringent latency and memory constraints. For example, a video service might use an IVFADC index to find similar shows based on a user's watch history embedding.
Retrieval-Augmented Generation (RAG)
In RAG architectures, ADC is used within the vector database backend to swiftly retrieve the most relevant document chunks or facts to ground a large language model's response. The knowledge base's embeddings are heavily compressed to fit into memory, while incoming query embeddings from the LLM are processed in their raw, high-dimensional form. This asymmetric search provides more accurate distance approximations than symmetric compressed-compressed comparison, directly improving the factual correctness and relevance of the generated answer by retrieving better context.
Multimodal Semantic Search
Search engines that allow queries across images, text, and audio rely on ADC for cross-modal retrieval. A unified embedding space (e.g., from a CLIP model) encodes all media types. The massive database of pre-computed image and text embeddings is compressed and indexed. When a user submits a text query (or vice-versa), its raw embedding is compared asymmetrically against the compressed database, enabling fast, semantically accurate cross-modal results. This is critical for applications in digital asset management, scientific research, and e-commerce.
Biometric Identification & Deduplication
Systems for facial recognition, speaker verification, and biometric deduplication use ADC to match a probe sample against a enrolled gallery of millions of identities. Template protection and storage efficiency require gallery embeddings (face, voice, fingerprint) to be stored in a compressed, often irreversible format. The live probe sample is compared using ADC, which provides a more reliable similarity score than comparing two compressed templates, maintaining high True Acceptance Rates while minimizing storage costs and search latency in security-critical environments.
Anomaly Detection in High-Throughput Logs
For IT observability and security, ADC enables real-time anomaly detection across high-dimensional log and metric embeddings. Normal operational patterns are indexed in a compressed form. Incoming raw log stream embeddings are continuously queried against this compressed baseline using ADC. Vectors that are distant from the compressed normals are flagged as anomalies. The memory efficiency of the compressed index allows a long history of normal behavior to be kept in RAM, enabling instantaneous deviation detection crucial for preventing outages or security breaches.
Drug Discovery & Molecular Similarity
In computational biology and cheminformatics, ADC accelerates the screening of massive virtual compound libraries. Molecular structures are encoded as high-dimensional vectors. The library of billions of compound embeddings is compressed and indexed. Researchers query with a raw embedding of a target molecule to find structurally or functionally similar candidates. ADC allows this similarity search to be performed on standard hardware by drastically reducing the memory footprint of the compound database while preserving the accuracy necessary for identifying viable drug leads.
Frequently Asked Questions
Asymmetric Distance Computation (ADC) is a core technique in approximate nearest neighbor search that enables accurate similarity comparisons between compressed and uncompressed vectors. These FAQs address its mechanics, trade-offs, and role in modern vector databases.
Asymmetric Distance Computation (ADC) is a method for estimating the distance between a raw, uncompressed query vector and a database vector that has been compressed using quantization. Unlike symmetric distance computation, which compares two compressed vectors and amplifies error, ADC calculates distance using the original query against the quantized approximation of the database vector, yielding a more accurate approximation. This technique is fundamental to memory-efficient Approximate Nearest Neighbor (ANN) search in billion-scale vector databases, as it allows high-dimensional embeddings to be stored in a compressed format (e.g., using Product Quantization) while maintaining higher search accuracy. The 'asymmetric' label stems from the differing representations of the two operands in the distance calculation.
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 approximate nearest neighbor (ANN) search ecosystem. It is most commonly paired with vector compression methods like Product Quantization. The following terms define the algorithms, metrics, and systems that form its operational context.
Product Quantization (PQ)
Product Quantization is the primary compression method used with ADC. It is a lossy compression technique that:
- Decomposes a high-dimensional vector (e.g., 128D) into several lower-dimensional subvectors.
- Learns a separate codebook of centroids for each subspace via k-means.
- Represents a database vector by a short code: the concatenation of centroid indices for each subvector. ADC calculates the distance between a raw query vector and this PQ-compressed database vector by summing precomputed distances from the query's subvectors to the indexed centroids, avoiding full decompression.
IVFADC (Inverted File with ADC)
IVFADC is a composite, two-level indexing structure that combines an Inverted File (IVF) with Product Quantization and Asymmetric Distance Computation.
- First Level (Coarse Quantizer): An IVF index (e.g., based on k-means) partitions the dataset into Voronoi cells. For a query, only vectors in the nearest cell(s) are searched.
- Second Level (Fine Quantizer): Vectors within those cells are compressed using PQ. During search, ADC is used to compute distances between the raw query and the PQ-compressed vectors within the selected cells. This architecture provides a major speed-up by restricting the search scope while maintaining accuracy through asymmetric distances.
Symmetric Distance Computation (SDC)
Symmetric Distance Computation is the alternative to ADC. In this paradigm:
- Both the query vector and the database vectors are compressed using the same quantization method (e.g., Product Quantization).
- The distance is approximated by calculating the distance between the two compressed representations. While faster than ADC (as distances between codewords can be fully precomputed), SDC is typically less accurate. The error is higher because the query compression introduces additional quantization noise. ADC's key advantage is keeping the query in its raw, high-fidelity form for the distance calculation.
Recall@K
Recall@K is the critical evaluation metric for assessing the effectiveness of an ANN system using ADC.
- It measures the fraction of the true, exact top-K nearest neighbors that are successfully retrieved in the approximate top-K results.
- Formula:
Recall@K = (|Approximate Top-K ∩ Exact Top-K|) / K. Because ADC introduces approximation error through compression and asymmetric calculation, achieving high recall (e.g., >0.95) is a primary tuning goal. Engineers balance recall against query latency by adjusting parameters like the number of IVF cells to probe (nprobe) and the PQ codebook size.
Maximum Inner Product Search (MIPS)
Maximum Inner Product Search is a common search objective in recommendation systems and neural network inference where vectors are not L2-normalized. ADC can be adapted for MIPS:
- Standard ADC for Euclidean distance relies on the decomposition of the squared distance.
- For MIPS, the inner product between a raw query
qand a PQ-compressed vectorxcan be computed asymmetrically by precomputing lookup tables for the inner products betweenq's subvectors and the PQ centroids. This Asymmetric Maximum Inner Product Search is a key feature in libraries like Google's ScaNN, which extends ADC principles to optimize directly for the inner product objective.

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