Asymmetric Distance Computation (ADC) is a technique for approximating the distance between a query vector and database vectors where only the database vectors are compressed via product quantization (PQ), while the query vector remains in full precision. This asymmetry yields higher accuracy than symmetric distance computation (SDC) because the query is not subjected to quantization error, preserving its fine-grained information during the distance calculation.
Glossary
Asymmetric Distance Computation (ADC)

What is Asymmetric Distance Computation (ADC)?
A distance approximation method in vector search where the query vector remains uncompressed while database vectors are quantized, improving accuracy over symmetric approaches.
In practice, ADC pre-computes distance lookup tables between the full-precision query subvectors and each codebook entry. During search, the distance to a compressed database vector is reconstructed by summing the pre-computed distances corresponding to its PQ codes, avoiding decompression overhead. This approach is fundamental to IVFPQ indices and libraries like FAISS, balancing the memory savings of compression with superior recall compared to fully symmetric quantization.
Key Characteristics of ADC
A vector compression and distance approximation strategy where only the database vectors are quantized, while the query vector remains in full precision. This asymmetry yields higher accuracy than symmetric methods by eliminating query-side quantization error.
Asymmetric vs. Symmetric Computation
The fundamental distinction lies in which vectors undergo quantization:
- Symmetric Distance Computation (SDC): Both the query vector and the database vectors are compressed via product quantization. Distance is approximated between two quantized representations, introducing error on both sides.
- Asymmetric Distance Computation (ADC): Only the database vectors are compressed. The query vector remains in full floating-point precision.
The result: ADC eliminates the quantization error on the query side entirely. The distance between a precise query and an approximate database vector is inherently more accurate than the distance between two approximations.
Distance Computation Mechanics
ADC leverages pre-computed lookup tables to accelerate the distance calculation between a full-precision query and product-quantized database vectors.
The process:
- The database vector is decomposed into
Msubvectors, each quantized to a centroid index from its sub-codebook. - For the incoming query, the distance from the query subvector to every centroid in each sub-codebook is computed once and stored in an
M × Klookup table (whereKis the number of centroids per sub-codebook). - The approximate distance to any database vector is then computed by summing
Mtable lookups, avoiding expensive high-dimensional distance calculations.
This makes ADC both memory-efficient for storage and computationally fast during search.
Role in Product Quantization (PQ)
ADC is the standard distance computation method paired with Product Quantization for nearest neighbor search.
- Encoding Phase: Database vectors are compressed using PQ. Each vector is represented by a short code (a sequence of centroid indices), not its original floating-point values.
- Search Phase: For a query vector, the ADC lookup table is built. The distance to every compressed database code is approximated by summing the pre-computed partial distances.
This pairing is the engine behind indices like IVFPQ, where an Inverted File Index first prunes the search space, and ADC computes the fine-grained residual distances to the remaining candidates.
Accuracy-Recall Tradeoff
The primary benefit of ADC is a superior accuracy-speed tradeoff compared to symmetric computation at the same memory footprint.
- Higher Recall@K: By preserving the query's full precision, ADC more reliably ranks true nearest neighbors at the top of the result list. The quantization error is isolated to the database side.
- Negligible Speed Overhead: The cost of building the lookup table for a full-precision query is a small, one-time overhead per search, making it the default operational mode in libraries like FAISS for virtually all PQ-based indices.
In practice, ADC provides a 'free' accuracy boost over SDC with no meaningful increase in query-time latency.
Memory Footprint and Storage
ADC enables massive compression of the database while retaining high search fidelity:
- Database Storage: Only the short PQ codes (typically 8-64 bytes per vector) need to be stored in memory, not the original high-dimensional vectors. For a billion-scale dataset, this can reduce storage from terabytes to gigabytes.
- Codebook Storage: The full-precision sub-codebooks must be retained to reconstruct the lookup table distances for each query. These codebooks are small relative to the database size.
- Query Handling: The query vector itself is ephemeral and processed in full precision, requiring no persistent storage beyond the duration of the search.
This asymmetry is ideal for read-heavy workloads where the database is static or infrequently updated but queries arrive in real-time.
Implementation in FAISS
The Facebook AI Similarity Search (FAISS) library provides a canonical implementation of ADC within its product quantization indices.
- The
IndexPQclass stores database vectors as compressed PQ codes. - During a search, the
search()method automatically performs asymmetric distance computation by default, computing exact query-to-centroid distances and using them to approximate query-to-database distances. - For composite indices like
IndexIVFPQ, ADC operates on the residual vectors—the difference between the query and the coarse cluster centroid—further improving accuracy by quantizing only the local distribution.
This built-in behavior makes ADC the standard, high-accuracy mode for any engineer using FAISS for large-scale vector search.
ADC vs. Symmetric Distance Computation (SDC)
Comparison of asymmetric and symmetric distance computation approaches for quantized vector search, highlighting accuracy, speed, and memory tradeoffs.
| Feature | Asymmetric (ADC) | Symmetric (SDC) |
|---|---|---|
Query vector precision | Full precision (uncompressed) | Quantized (compressed) |
Database vector precision | Quantized (compressed) | Quantized (compressed) |
Distance computation | Query-to-codebook centroid | Code-to-code centroid |
Search accuracy (recall) | Higher | Lower |
Distance table precomputation | ||
Query-time compression overhead | ||
Typical recall@10 improvement | 2-5% | Baseline |
Memory footprint | Identical | Identical |
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.
Frequently Asked Questions
Clarifying the mechanics and trade-offs of Asymmetric Distance Computation (ADC), a core technique for efficient, high-accuracy similarity search in compressed vector spaces.
Asymmetric Distance Computation (ADC) is an efficient distance approximation technique where only the database vectors are compressed via quantization, while the query vector remains in full precision. The process works by first encoding all database vectors into short codes using a technique like Product Quantization (PQ). At query time, the uncompressed query vector is compared against the codebooks to pre-compute a distance lookup table. The approximate distance to any database vector is then reconstructed by summing the pre-computed distances corresponding to its stored codes. This asymmetry—full-precision query, compressed database—yields higher accuracy than Symmetric Distance Computation (SDC), where both query and database vectors are quantized, because the query's fine-grained information is preserved without distortion.
Related Terms
Core concepts that define the asymmetric computation paradigm, where query precision is preserved while database vectors are compressed to optimize memory and speed.
Product Quantization (PQ)
The foundational compression mechanism enabling ADC. High-dimensional vectors are decomposed into subvectors, each quantized independently using a distinct codebook.
- Mechanism: The original vector is split, and each subvector is mapped to its nearest centroid.
- ADC Role: During search, the query vector remains full-precision, and distances are computed using pre-calculated lookup tables.
- Trade-off: Compression ratio vs. quantization error.
Symmetric Distance Computation (SDC)
The contrasting approach where both the query and database vectors are compressed via quantization before distance calculation.
- Accuracy Loss: Introduces quantization error on the query side, degrading recall compared to ADC.
- Use Case: Preferred only when query-side compute or transmission bandwidth is severely constrained.
- Key Distinction: ADC retains full query precision, yielding strictly higher accuracy for the same compression ratio.
IVFPQ
A composite indexing strategy that directly leverages ADC. An Inverted File Index provides coarse partitioning, while Product Quantization compresses residual vectors.
- Pipeline: Coarse quantizer assigns query to nearest partitions, then ADC computes precise distances to compressed database vectors within those cells.
- Benefit: Balances high recall from IVF with low memory footprint from PQ, using ADC to maximize final accuracy.
Residual Vector Encoding
The specific vector representation compressed in ADC-based indices. The coarse centroid is subtracted from the original vector, leaving a residual that encodes fine-grained local information.
- Process:
residual = original_vector - coarse_centroid - ADC Application: The residual is compressed via PQ, and the query computes distances to these compressed residuals, adding back the coarse distance.
- Advantage: Reduces the variance of the data being quantized, minimizing quantization error.
Quantization Error
The primary accuracy bottleneck that ADC mitigates. This distortion is introduced when mapping a continuous vector to its nearest discrete codebook centroid.
- ADC Mitigation: By keeping the query uncompressed, ADC eliminates query-side quantization error entirely.
- Measurement: Mean squared error between original and reconstructed vectors.
- Impact: Directly determines the recall ceiling of the compressed index.

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