IVFADC (Inverted File with Asymmetric Distance Computation) is a composite approximate nearest neighbor (ANN) search algorithm that integrates an Inverted File (IVF) index for coarse partitioning with Product Quantization (PQ) for vector compression, using asymmetric distance computation to compare a raw query against compressed database vectors. The IVF stage uses a coarse quantizer (e.g., k-means) to partition the dataset into Voronoi cells, restricting the search to a few promising clusters. The PQ stage then compresses the residual vectors within each cell into short codes, dramatically reducing the memory footprint.
Glossary
IVFADC (Inverted File with Asymmetric Distance Computation)

What is IVFADC (Inverted File with Asymmetric Distance Computation)?
IVFADC is a high-performance, memory-efficient algorithm for approximate nearest neighbor search that combines coarse partitioning with fine-grained vector compression.
The asymmetric distance computation (ADC) is the key innovation, allowing the system to compute the approximate distance between an uncompressed query vector and a PQ-compressed database vector. This asymmetric comparison is more accurate than symmetric distance computation between two compressed vectors. By searching only within selected IVF cells and using precomputed lookup tables for ADC, IVFADC achieves an optimal balance of high recall, low search latency, and minimal memory usage, making it a foundational technique in billion-scale vector databases like Faiss.
Key Features and Characteristics of IVFADC
IVFADC combines coarse partitioning via an Inverted File (IVF) with high compression via Product Quantization (PQ), using asymmetric distance computation to enable fast, memory-efficient similarity search at scale.
Two-Stage Indexing Architecture
IVFADC employs a hierarchical search strategy for efficiency.
- Coarse Quantizer (IVF): A k-means model partitions the dataset into Voronoi cells (clusters). For a query, only vectors in the most promising cell(s) are considered, drastically reducing the search space.
- Fine Quantizer (PQ): Within each cell, vectors are compressed using Product Quantization. A vector is split into subvectors, each quantized to a centroid from a learned codebook, resulting in a compact PQ code.
This architecture decouples search scope reduction (IVF) from memory footprint reduction (PQ).
Asymmetric Distance Computation (ADC)
This is the core distance estimation method that gives IVFADC its name and accuracy advantage.
- Symmetric Distance (SDC): Compares two compressed PQ codes. Less accurate as both vectors lose information.
- Asymmetric Distance (ADC): Compares the raw, uncompressed query vector against the compressed database vector. The query's subvectors are compared directly to the centroid vectors stored in the PQ codebooks.
Key Benefit: ADC uses the full precision of the query, yielding a significantly more accurate distance approximation than SDC, which improves recall for a given compression level.
Memory Efficiency via Product Quantization
PQ enables storing billion-scale vector datasets in RAM.
- A 128-dimensional float32 vector typically requires 512 bytes.
- Using PQ with 8 subspaces and 256 centroids per subspace (an
m=8, k*=256setup), the same vector is represented by an 8-byte code (one byte per subspace index). - This achieves a 64x reduction in memory footprint, allowing massive datasets to be searched entirely in memory.
The trade-off is a loss of information (lossy compression), which ADC mitigates.
Configurable Speed-Accuracy Trade-offs
IVFADC exposes key parameters for tuning performance.
nlist(IVF): Number of Voronoi cells. Highernlistmeans smaller, more focused cells → faster but potentially lower recall if the query's true neighbors span multiple cells.nprobe: Number of cells searched per query. Increasingnprobesearches more cells → higher recall but slower speed.- PQ Dimensions (
m): Number of subspaces. More subspaces (higherm) means less quantization error per subspace → higher accuracy but longer distance computation time.
Engineers balance these to meet specific latency and recall (@K) Service Level Objectives.
Primary Use Cases and Applications
IVFADC is optimized for specific large-scale retrieval scenarios.
- Billion-Scale Image Retrieval: Finding similar images in massive catalogues.
- Recommendation Systems: Candidate retrieval from pools of millions of items.
- Dense Text Retrieval: Semantic search over large document collections where memory constraints are paramount.
Ideal Fit: Applications where the dataset is static or batch-updated, memory efficiency is critical, and queries per second (QPS) are high. It is less suited for rapidly changing, streaming data without index rebuilds.
IVFADC vs. Other ANN Indexing Methods
A technical comparison of IVFADC's composite architecture against other core ANN algorithms, highlighting trade-offs in accuracy, speed, memory, and update characteristics.
| Feature / Metric | IVFADC (IVF + PQ + ADC) | HNSW (Graph-Based) | IVF (Inverted File Only) | Product Quantization (PQ Only) |
|---|---|---|---|---|
Core Algorithm Type | Composite (Partitioning + Compression) | Graph-Based | Partitioning-Based | Compression-Based |
Primary Search Mechanism | Coarse quantizer (IVF) cell selection, then ADC on PQ codes | Greedy graph traversal on hierarchical layers | Search within nearest Voronoi cell(s) | Exhaustive scan of compressed codes (Symmetric or ADC) |
Typical Query Speed (Relative) | Very Fast | Extremely Fast | Fast | Slow (linear scan) |
Memory Efficiency | Very High (stores compact PQ codes) | Low (stores full vectors + graph edges) | Medium (stores full vectors + centroid list) | Highest (stores only PQ codes) |
Index Build Time | High (requires k-means + PQ training) | Very High (multi-layer graph construction) | Medium (requires k-means training) | Medium (requires PQ codebook training) |
Supports Incremental Updates | ||||
Optimal Distance Metric | Squared L2 / Euclidean | Cosine, L2, Inner Product | Squared L2 / Euclidean | Squared L2 via ADC |
Typical Use Case | Billion-scale, memory-constrained similarity search | High-recall, low-latency search on datasets up to ~100M vectors | Medium-scale datasets where full vectors can be stored | Extreme memory compression for archival or very large datasets |
Where is IVFADC Used?
IVFADC is a cornerstone algorithm for large-scale, high-throughput similarity search. Its hybrid architecture makes it the index of choice in production systems where balancing memory efficiency, query speed, and accuracy is non-negotiable.
Billion-Scale Image & Video Retrieval
IVFADC is fundamental to modern visual search engines. Platforms like Pinterest or e-commerce sites use it to find similar products from user-uploaded images.
- Key Driver: The massive scale of image embeddings (often 512+ dimensions) makes exhaustive search impossible. IVFADC's Product Quantization (PQ) compresses these embeddings by 96-98%, allowing billions of vectors to reside in RAM.
- Workflow: A user's photo is encoded into a query vector. The Inverted File (IVF) stage identifies the most relevant cluster(s). The Asymmetric Distance Computation (ADC) then accurately compares the raw query to the compressed database vectors within those clusters, returning visually similar results in milliseconds.
Semantic Text Search & RAG Systems
Retrieval-Augmented Generation (RAG) and semantic search platforms rely on IVFADC for the critical retrieval step. It finds the most relevant text chunks from a corporate knowledge base to ground an LLM's response.
- Key Driver: Need for low-latency retrieval over millions of document chunks to keep user-facing chat applications responsive. IVFADC's two-stage search provides this speed.
- Precision Requirement: Asymmetric Distance Computation is crucial here. Comparing a raw query embedding (from the user's question) against compressed document embeddings yields more accurate similarity scores than symmetric PQ distance, leading to better context retrieval and reduced LLM hallucinations.
Recommendation Systems
Large-scale recommendation engines for content (videos, articles) or products use IVFADC for candidate retrieval. It efficiently finds users or items similar to a target.
- Key Driver: The memory footprint. Storing compressed user/item embeddings enables real-time personalization for hundreds of millions of users without exorbitant hardware costs.
- MIPS Adaptation: While designed for L2 distance, IVFADC can be adapted for Maximum Inner Product Search (MIPS), the core operation of many recommendation models (e.g., matrix factorization). The coarse IVF stage prunes irrelevant candidates, and ADC approximates the inner product.
Deduplication & Anomaly Detection
IVFADC is used to identify near-duplicate entries in massive datasets (e.g., user-generated content, log files) or to flag anomalous data points.
- Key Driver: The ability to perform fast all-pairs similarity search within a dataset. By querying the index with each vector (or a sample), systems can quickly find clusters of near-duplicates.
- Efficiency: The compressed domain search enabled by PQ means the entire dataset can be scanned for neighbors much faster than with raw vectors. Anomalies are identified as vectors with no or very few close neighbors in the IVFADC index.
Trade-offs and System Design Choice
Choosing IVFADC over other ANN indices like HNSW involves explicit engineering trade-offs.
- Choose IVFADC when: Memory efficiency is the primary constraint (PQ compression). Query throughput (QPS) is critical—IVFADC's inverted file allows for highly parallelized searches. The dataset is static or batch-updated (IVFADC supports incremental adds but may require retraining).
- Consider alternatives when: Ultra-low latency (<1ms) is required for a single query (HNSW may be faster). The dataset has extremely high dimensionality where PQ reconstruction error is too great. The index must support frequent real-time updates (dynamic graph-based indices are more suitable).
Frequently Asked Questions
IVFADC (Inverted File with Asymmetric Distance Computation) is a high-performance, composite index for approximate nearest neighbor search. It combines coarse partitioning with fine-grained compression to enable fast, memory-efficient similarity search at billion-vector scale.
IVFADC is a composite Approximate Nearest Neighbor (ANN) index that combines an Inverted File (IVF) for coarse partitioning with Product Quantization (PQ) for vector compression, using Asymmetric Distance Computation (ADC) to compare queries to compressed data. It works in three stages: first, a coarse quantizer (like k-means) partitions the dataset into Voronoi cells (the IVF). Second, all vectors within a cell are compressed using PQ, which splits them into subvectors and replaces each with a centroid index. During a query, the system finds the nearest cell(s), then uses ADC to efficiently compute approximate distances between the raw query vector and the PQ-compressed database vectors within those cells.
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
IVFADC combines several core ANN techniques. These cards detail its constituent algorithms, related search paradigms, and key performance concepts.
Inverted File Index (IVF)
The Inverted File Index (IVF) is the coarse partitioning stage of IVFADC. It uses a coarse quantizer (like k-means) to divide the vector dataset into partitions called Voronoi cells. For a query, the system:
- Identifies the nearest cell(s) to the query vector.
- Searches only the vectors within those promising cells. This drastically reduces the search space from the entire database to a few partitions, enabling fast, approximate search.
Product Quantization (PQ)
Product Quantization (PQ) is the compression engine within IVFADC. It is a lossy compression technique that:
- Splits a high-dimensional vector into multiple independent subspaces.
- Learns a separate set of centroids (a codebook) for each subspace via k-means.
- Represents each original vector by a short code composed of the indices of its nearest centroid in each subspace. This reduces memory footprint by orders of magnitude, allowing billion-scale vector datasets to reside in RAM.
Asymmetric Distance Computation (ADC)
Asymmetric Distance Computation (ADC) is the distance calculation method that gives IVFADC its name and accuracy advantage. Instead of comparing two compressed vectors (symmetric distance), ADC computes the distance between:
- A raw, uncompressed query vector.
- A compressed database vector (represented by PQ codes). This asymmetric approach uses the full precision of the query, leading to a more accurate distance approximation than symmetric PQ distance, which improves recall without sacrificing the memory benefits of compression.
Coarse Quantizer
The Coarse Quantizer is the first-stage model in the IVF component. Typically implemented as a k-means clustering algorithm, its role is to:
- Learn a set of coarse centroids that partition the vector space.
- Assign each database vector to its nearest centroid's partition (cell). During search, it acts as a router, directing the query to the most relevant partition(s). The number of centroids is a critical hyperparameter, balancing search speed (fewer cells to probe) against recall (more cells reduce the risk of missing neighbors).
Recall-Precision Trade-off
The Recall-Precision Trade-off is the fundamental engineering compromise in ANN search. In IVFADC, it is managed by several parameters:
- nprobe: The number of Voronoi cells (IVF partitions) to search. Higher
nprobeincreases recall and search latency. - PQ Parameters: The number of subspaces and centroids per subspace affect the fidelity of compression. More centroids improve accuracy but increase memory and distance calculation cost. Tuning these parameters allows engineers to dial in the optimal balance between search accuracy (recall) and system performance (latency, throughput) for their specific application.

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