In an Inverted File Index (IVF), nprobe is the search-time parameter that specifies the number of nearest Voronoi cells (clusters) to examine for a given query vector. By limiting the search to a subset of clusters rather than the entire dataset, it directly reduces the number of distance computations required, which is the primary determinant of query latency. A lower nprobe value yields faster searches but lower recall, while a higher value increases accuracy at the cost of higher latency.
Glossary
nprobe (IVF Parameter)

What is nprobe (IVF Parameter)?
A critical search-time parameter for the Inverted File Index (IVF) algorithm that governs the fundamental trade-off between retrieval speed and result accuracy.
Tuning nprobe is essential for optimizing the recall-latency trade-off in production Retrieval-Augmented Generation (RAG) systems. Engineers calibrate it based on dataset characteristics and performance Service-Level Agreements (SLAs), often in conjunction with other Approximate Nearest Neighbor (ANN) parameters. It is a core configuration in libraries like Faiss and Milvus, where it works with compression methods like Product Quantization (PQ) in an IVFPQ index to enable billion-scale semantic search.
Key Characteristics of nprobe
nprobe is the primary search-time parameter controlling the accuracy-latency trade-off in an Inverted File Index (IVF). It determines how many Voronoi cells (clusters) are examined for each query.
Definition & Core Function
In an Inverted File Index (IVF), nprobe specifies the number of nearest Voronoi cells (clusters) to search for a given query vector. The IVF index pre-partitions the dataset into nlist clusters using a coarse quantizer like k-means. At search time, instead of exhaustively scanning all vectors, the system:
- Computes distances from the query to all
nlistcluster centroids. - Selects the
nprobeclosest centroids. - Exhaustively searches only the vectors assigned to those selected clusters. This mechanism is the foundation of the IVF's speed, as it drastically reduces the number of distance computations required per query.
The Accuracy-Latency Trade-off
The value of nprobe directly governs the fundamental recall-latency trade-off in ANN search.
- Low
nprobe(e.g., 1-10): Searches very few clusters. This results in low latency and low recall, as the true nearest neighbors might reside in a cluster whose centroid is not among thenprobeclosest. This is a fast, approximate search. - High
nprobe(e.g., 50-200): Searches many clusters. This increases recall (accuracy) but also query latency linearly, as more vectors must be scanned. Atnprobe = nlist, the search becomes exhaustive. Tuningnprobeis the primary method for moving a system along its accuracy-latency curve to meet specific application SLAs.
Interaction with Other IVF Parameters
nprobe does not operate in isolation; its effect is modulated by other IVF construction parameters.
nlist(Number of Clusters): The total number of Voronoi cells. A largernlistcreates finer-grained clusters. For a fixednprobe, a largernlistmeans searching a smaller percentage of the total dataset, which can reduce latency but also recall if the distribution is uneven.- Cluster Balance: In real datasets, clusters are rarely perfectly balanced. A query may select
nprobeclusters that contain a vastly different number of vectors, causing latency spikes. Some systems implement cluster size limits to mitigate this. - Quantizer Choice: The accuracy of the coarse quantizer (e.g., k-means) in partitioning the space affects how well the
nprobeclosest centroids correlate with the true nearest neighbor cells.
Tuning in Production Systems
Selecting the optimal nprobe is an empirical process driven by evaluation metrics and service-level agreements (SLAs).
- Benchmarking: Measure recall@k (e.g., recall@10, recall@100) against a ground truth dataset across a range of
nprobevalues. - Latency Profiling: Simultaneously measure P50, P95, and P99 query latency for each
nprobesetting under expected load. - Setting the SLA: Choose the
nprobevalue that meets the minimum required recall while staying under the maximum allowable P95 or P99 latency. For example, a chatbot may requirenprobe=32to achieve 95% recall@5 with <100ms P99 latency. - Dynamic Adjustment: Advanced systems may adjust
nprobeper query based on complexity or use multi-stage retrieval where a lownprobeprovides candidates for a more accurate re-ranker.
IVFPQ: nprobe with Compressed Vectors
In the IVFPQ (Inverted File Index with Product Quantization) index, nprobe plays the same role, but the distance calculations within each probed cluster are accelerated via asymmetric distance computation (ADC).
- The residual vectors (original vector minus cluster centroid) are stored as compact PQ codes.
- When probing a cluster, distances are approximated using lookup tables instead of full-precision math.
- This means increasing
nprobein IVFPQ increases latency, but the cost per vector is much lower than in a flat IVF index. The memory-footprint vs. accuracy-latency trade-off becomes multi-dimensional, managed bynlist,nprobe, and PQ parameters (m,bits).
Comparison to HNSW's efSearch
nprobe in IVF is functionally analogous to efSearch in the HNSW graph index. Both control the breadth of the search to manage the accuracy-latency trade-off.
nprobe(IVF): Controls the number of clusters to search. Latency increases ~linearly withnprobeas more lists of vectors are scanned.efSearch(HNSW): Controls the size of the dynamic candidate list during graph traversal. Latency increases as more graph nodes are visited and compared.- Key Difference: IVF's performance is more predictable and linear, while HNSW's graph traversal can have less deterministic performance but often achieves higher recall at lower latency for the same dataset size. The choice between tuning
nprobeorefSearchdepends on the underlying index structure.
nprobe: Performance Trade-offs
This table quantifies the direct trade-offs between retrieval accuracy (recall) and query latency when tuning the nprobe parameter in an Inverted File Index (IVF).
| Performance Dimension | Low nprobe (e.g., 1-5) | Medium nprobe (e.g., 10-50) | High nprobe (e.g., 100+) |
|---|---|---|---|
Clusters Searched | Very Few | Moderate | Most/All |
Recall @ 10 | 60-80% | 85-98% |
|
Query Latency | < 1 ms | 1-10 ms | 10-100+ ms |
CPU/GPU Compute | Minimal | Moderate | High |
Memory Bandwidth Pressure | Low | Medium | High |
Suitability for Pre-filtering | Excellent | Good | Poor |
Impact of Poor Clustering | High (Missed Results) | Moderate | Low |
Throughput (QPS) | 10k-100k+ | 1k-10k | 100-1k |
Implementation and Tuning Context
nprobe is a critical runtime parameter for the Inverted File Index (IVF) that directly governs the fundamental trade-off between retrieval accuracy and query speed. Tuning it requires understanding your dataset, performance requirements, and the underlying IVF structure.
Core Trade-Off: Recall vs. Latency
The primary function of nprobe is to control the accuracy-latency trade-off inherent to IVF search.
- Low
nprobe(e.g., 1-5): Searches only the closest 1-5 clusters to the query. This is extremely fast but risks missing relevant vectors that reside in neighboring clusters, resulting in lower recall. - High
nprobe(e.g., 50-100): Searches many more clusters. This increases the probability of finding all nearest neighbors (higher recall) but requires computing distances to all vectors in those clusters, leading to higher query latency. The optimal value is found empirically by plotting a recall-latency curve for your specific dataset and workload.
Relationship with IVF Clusters (`nlist`)
nprobe cannot be tuned in isolation; its effect is intrinsically linked to nlist, the number of clusters built during index training.
nlistdefines the granularity of the coarse partition (e.g., 1024, 4096, or 16384 clusters).nprobeis expressed as a number of these clusters to search at query time. A key ratio isnprobe/nlist. Searching 10 clusters (nprobe=10) is a very broad search ifnlist=100(10% of all cells), but a very narrow search ifnlist=100,000(0.01% of cells). For stable performance,nlistis typically set based on dataset size (e.g., sqrt(N)), andnprobeis tuned for the target operating point.
Tuning Methodology & Best Practices
Effective tuning follows a systematic, data-driven approach:
- Establish a Baseline: Fix
nlist(e.g., 4 * sqrt(N)). Start with a conservativenprobe(e.g., 10-20). - Define Target Metrics: Determine required recall@k (e.g., recall@10 > 0.95) and P95 latency SLA (e.g., < 50ms).
- Run a Parameter Sweep: Measure recall and latency for
nprobevalues across a range (e.g., 1, 5, 10, 20, 50, 100). - Analyze the Curve: Identify the point where increasing
nprobeyields diminishing returns in recall for a large latency cost. - Validate on a Hold-Out Set: Confirm the chosen parameter generalizes. Best Practice: Automate this sweep and integrate it into your CI/CD pipeline for retrieval components.
Impact of Data Distribution & Query Difficulty
The optimal nprobe is not static; it depends on data characteristics.
- Uniform, Well-Clustered Data: Vectors are tightly packed around centroids. A low
nprobemay suffice, as the nearest neighbor is likely in the query's own cell. - High-Dimensional, Noisy Data: Vectors are spread out, and the true nearest neighbor may be in a distant Voronoi cell. Requires a higher
nprobefor adequate recall. - "Hard" vs. "Easy" Queries: In a production system, some queries land near cluster boundaries and need more cells searched. A fixed
nprobeis a global compromise. Advanced systems can implement adaptive probing, wherenprobeis adjusted dynamically based on query characteristics or using a learned heuristic.
Integration with Product Quantization (IVFPQ)
In the widely used IVFPQ index, nprobe interacts with Product Quantization parameters.
- The IVF stage uses
nprobeto select clusters. - For each vector in those clusters, an asymmetric distance computation (ADC) is performed using the PQ codes.
Latency Formula (Approximate):
Latency ∝ nprobe * (avg_vectors_per_list) / (parallelization_factor). Because PQ makes distance calculations cheap, you can often afford a highernprobecompared to a flat IVF index, improving recall without a linear latency increase. Tuning involves balancingnprobewith PQ parameters like the number of subquantizers (m) and bits per subquantizer.
Production Deployment Considerations
When deploying an IVF-based retriever, nprobe has operational implications:
- Performance Predictability: A higher
nprobeincreases latency variance, as queries that hit densely populated clusters will be slower. Monitor P99 latency closely. - Resource Scaling: Throughput (queries per second) is inversely related to
nprobe. Scaling to meet demand may require more replicas or more powerful hardware ifnprobeis high. - Dynamic Tuning: For systems with cyclical or shifting traffic/query patterns, consider a control plane that can adjust
nprobe(within bounds) to maintain SLAs. For example, lowernprobeduring peak load to preserve latency, accepting a temporary recall dip. - A/B Testing: Any change to
nprobeshould be validated through canary deployments and A/B tests measuring end-to-end application success metrics, not just recall.
Frequently Asked Questions
The `nprobe` parameter is a critical tuning knob in Inverted File Index (IVF) systems, directly governing the trade-off between retrieval accuracy and query speed. These FAQs address its technical function, optimization strategies, and impact on production RAG systems.
nprobe is a search-time parameter for an Inverted File Index (IVF) that controls the number of nearest clusters (Voronoi cells) to search for a given query vector. During the IVF indexing phase, the vector dataset is partitioned into nlist clusters using a clustering algorithm like k-means. At search time, the system uses a coarse quantizer to find the cluster whose centroid is nearest to the query vector. The nprobe parameter determines how many of the next nearest clusters beyond the first are also searched. A higher nprobe value searches more clusters, examining a larger fraction of the total dataset, which increases recall but also computational cost and latency. The search is then performed exhaustively within the selected clusters.
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
The nprobe parameter operates within a broader ecosystem of techniques and trade-offs for optimizing vector search performance. These related concepts define the engineering landscape for balancing speed, accuracy, and resource consumption in large-scale retrieval.
Inverted File Index (IVF)
An Inverted File Index (IVF) is the foundational indexing structure that makes nprobe relevant. It partitions the vector dataset into clusters (Voronoi cells) using a coarse quantizer like k-means. During search, the system identifies the nearest cluster centroids to the query, and nprobe determines how many of these clusters are subsequently scanned exhaustively. This cluster pruning is the core mechanism for reducing search latency compared to a brute-force scan.
Recall-Latency Trade-off
The recall-latency trade-off is the fundamental engineering compromise governed by parameters like nprobe. Increasing nprobe searches more clusters, which increases the probability of finding the true nearest neighbors (higher recall) but requires more distance computations (higher latency). Conversely, a low nprobe speeds up queries but risks missing relevant results. System architects tune this trade-off based on application-specific requirements for speed versus accuracy.
Approximate Nearest Neighbor Search (ANN)
Approximate Nearest Neighbor Search (ANN) is the overarching problem domain. Algorithms like IVF, HNSW, and LSH all provide approximate solutions, sacrificing perfect accuracy for orders-of-magnitude reductions in search time and memory. nprobe is a critical knob within the IVF family of ANN algorithms, allowing precise control over where a system operates on the accuracy-speed Pareto frontier.
efSearch (HNSW Parameter)
efSearch is the direct analog to nprobe but for the Hierarchical Navigable Small World (HNSW) graph-based index. It controls the size of the dynamic candidate list during the greedy graph traversal. A higher efSearch value explores more neighbors at each layer, improving recall at the cost of latency. While nprobe controls cluster exploration in IVF, efSearch controls path exploration in HNSW—both are primary levers for the same fundamental trade-off.
Product Quantization (PQ)
Product Quantization (PQ) is a compression technique often combined with IVF in the IVFPQ index. PQ compresses vectors into short codes, drastically reducing memory footprint and accelerating distance calculations via lookup tables. When used with IVF, nprobe determines how many compressed clusters are searched. This combination enables billion-scale search on a single server by optimizing both the search space (via nprobe) and the per-vector computation cost (via PQ).
Multi-Stage Retrieval
Multi-stage retrieval is a cascaded architecture that contextualizes the role of nprobe. A first-stage, high-recall retriever (e.g., an ANN index with a conservative nprobe) fetches a broad candidate set (e.g., 100-1000 documents). A slower, more precise second-stage model (like a cross-encoder reranker) then processes this smaller set. Here, nprobe is tuned not for final precision, but to ensure the high-recall candidate set contains the relevant documents for the reranker to identify.

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