Manuscript Offprint

arXiv:2608.25185

Analyzing and Reducing Search Quality Differences in Vector Similarity Search

Sara Mahdizadeh Shahri, Martin Prammer, Jignesh M. Patel, Akshitha Sriraman

Abstract

Modern database services scalably search over large data collections via Approximate Nearest Neighbor Search, which improves search performance at the cost of search quality, measured by recall. In practice, a database operator seeks to achieve a target mean recall while maximizing throughput across search queries. We show that optimizing for mean recall masks significant differences in recall across queries even when target recall is met. As a result, numerous queries face (1) below-target recall, hurting user experience and revenue and (2) above-target recall, wasting computation to deliver unnecessarily high search quality. Thus, it is critical to detect and reduce recall differences across queries.

We design RCheck, a light-weight run-time system that identifies low-recall queries and reduces recall differences while achieving high throughput. RCheck's key design principle is to dynamically, efficiently adapt search effort by increasing effort for queries below target recall and decreasing effort for those above it. RCheck tunes available search effort parameters, making it readily deployable. We evaluate RCheck using the widely-used production-style pgvector [6] database. At the same throughput, RCheck improves mean recall by 11–93% and enables 8–47% more queries to meet target recall compared to the state-of-the-art globally-tuned configuration.

1 Introduction

Modern data management services perform embedding-based similarity search over large collections of data items, such as text, images, and videos [12, 28, 29, 33, 37, 42, 46, 59, 62, 66]. To enable such search, data items are encoded as high-dimensional embedding vectors [38, 47, 50] and stored in a vector database [6, 8, 24, 61]. These vectors form an embedding space, where nearby vectors map to similar items [38, 47, 50].

To search similar items for a query, the service encodes the query as an embedding vector and finds the closest stored vectors, i.e., nearest neighbors. In principle, we can find nearest neighbors by comparing the query vector against all stored vectors in the database. But, such exhaustive search is computationally expensive at modern scales [38, 55].

In practice, to enable scalable search, vector databases construct index structures that organize vectors via graphs, trees, hashmaps, or partitions [16, 35, 45, 51, 52, 60]. These indices enable Approximate Nearest Neighbor Search (ANNS), which searches only a subset of stored vectors. ANNS is often controlled by a global search parameter that governs search effort, i.e., the number of stored vectors scanned per query. Thus, ANNS improves search performance while potentially

Figure

Figure 1. Recall distribution across all queries and within two query groups corresponding to different regions of the embedding space. Although the overall mean recall meets the target, recall varies substantially across groups, indicating uneven search quality across queries.

missing some true nearest neighbors, compromising search quality [16, 31, 32, 55]. Search quality loss is measured by recall, defined as the fraction of true nearest neighbors retrieved; recall closer to 1 indicates better search quality [15].

Typically, database operators tune indices to achieve a target mean recall (e.g., 0.85) while maximizing throughput across queries [8, 55, 63]. We find that optimizing for mean recall can mask a critical problem: search quality can differ substantially across queries even when target recall is met.

To illustrate recall differences across queries, Fig. 1 shows overall recall distribution for a pgvector database [6] with a graph-based index [51] built on a Twitter dataset [49] with GloVe-100 embeddings [50]. We split the dataset into index and query sets. While overall mean recall of 0.87 exceeds the 0.85 target, the distribution is wide rather than concentrated, indicating significant difference in recall across queries.

To better study recall differences across queries, we organize stored vectors into groups based on their location in the embedding space using popular k-means clustering [2]. We show that computing such groups offline, independent of the index structure, provides a logical characterization of the embedding space without modifying the index, which enables efficiently studying recall differences across queries.

Fig. 1 shows significant recall differences among real-world Twitter queries [49] that naturally map to different groups based on their embeddings: queries in group A average 0.21 recall while those in B average 0.99, despite similar cluster sizes. Thus, even when net mean recall meets the target, search quality can differ greatly across query groups. We show that recall differences persist across index configurations, index types, and embedding models [43, 57].

Such recall differences have adverse consequences. Queries that belong to low-recall groups experience poor search quality, which hurts (1) user experience, increasing user abandonment and reducing engagement [10, 13, 40, 64] and (2) user trust and reliable service operation, hurting revenue [21, 23, 27, 63]. Thus, it is crucial to detect and reduce recall differences across queries.

Reducing recall differences is challenging. One option is to modify the index offline (e.g., by increasing graph connectivity for low-recall groups). But, such approaches are expensive and disruptive, making them challenging to deploy in production [45]. An alternative is to configure the global search parameter that controls search effort [6, 51, 60]. In current practice, this parameter is set coarsely and the same search effort is applied across all queries. Thus, increasing this parameter improves recall for queries in low-recall groups (e.g., group A), but, also increases search effort for queries that already meet the target recall, reducing net throughput.

Our key insight is that we can reduce recall differences while achieving high throughput by tuning search effort at a finer granularity, i.e., increasing effort for groups below target recall and decreasing it for those above it. Such tuning “takes from the rich and gives to the poor” by reallocating computation from high-recall groups to low-recall groups, reducing recall differences while ensuring high throughput.

Using this insight, we design RCheck, a lightweight runtime system that (1) identifies low-recall queries and (2) reduces recall differences while achieving high throughput. RCheck introduces several novel design principles. First, as computing recall differences across individual queries is expensive at modern scales, RCheck efficiently captures such differences by introducing per-group recall measurement. Second, unlike the modern coarse-grained practice of applying uniform search effort across queries, RCheck dynamically adapts effort per-group in a way that reduces recall difference while ensuring high throughput. Third, for quick adaptation, RCheck includes control-loop feedback to monitor recall and performance metrics and suitably adapt search effort at run time. Fourth, RCheck tunes available search effort parameters, requiring no expensive, intrusive index changes, making it index independent and readily deployable.

We evaluate RCheck using pgvector [6], a widely-used PostgreSQL extension with production-style ANNS [3–5, 15]. Across multiple datasets and index types, RCheck consistently improves recall-throughput trade-off. At the same target recall, RCheck improves throughput by 7–41% compared to the best globally-tuned configuration. At the same throughput, RCheck tightens the recall distribution, improving mean recall by 11–93% and enabling 8–47% more queries to meet target recall target.

In summary, we contribute:

  • A demonstration that ANN recall can differ significantly across queries, despite meeting the target recall.

  • A characterization of this recall difference across index types, index configurations, and embedding models.

  • RCheck: A light-weight run-time system that reduces recall differences across queries without hurting throughput.

  • A detailed evaluation of RCheck, demonstrating that it shifts the recall-performance tradeoff closer to the ideal.

References (16)