arXiv:2611.08306cs.IRNov 2026

Manuscript Offprint

arXiv:2611.08306

GINGER: Spicing Up Graph-Based Vector Search

Daniel Salwasser, Lars Gottesbüren, Laxman Dhulipala, Jakub Łącki, Guy Blelloch, Rajesh Jayaram, Tobias Rubel, Kshiteej Sheth, Amir Zandieh, Vahab Mirrokni

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Daniel Salwasser Google Research & KIT Karlsruhe, Germany dsalwasser@google.com

Lars Gottesbüren Google Research Zürich, Switzerland gottesbueren@google.com

Laxman Dhulipala Google Research & UMD College Park, USA laxmand@google.com

Jakub Łacki Google Research New York City, USA jlacki@google.com

Guy Blelloch Google Research & CMU Pittsburgh, USA gbleloch@google.com

Rajesh Jayaram Google Research New York City, USA rkjayaram@google.com

Tobias Rubel Google Research & UMD College Park, USA rubelato@google.com

Kshiteej Sheth Google Research & EPFL Zürich, Switzerland kshiteejsheth@google.com

Amir Zandieh Google Research Zürich, Switzerland zandieh@google.com

Vahab Mirrokni Google Research New York City, USA mirrokni@google.com

ABSTRACT

We present GINGER, a state-of-the-art open-source C++ library for graph-based approximate nearest neighbor search (ANNS). We developed GINGER at Google to push the speed and memory efficiency of graph search on large and high-dimensional embedding datasets. GINGER surpasses existing ANNS libraries with regards to query throughput and indexing time while matching the memory footprint of the most space-efficient competitors.

GINGER builds upon recent advances in proximity graph construction (PiPNN) and vector quantization (TurboQuant). We introduce Nested TurboQuant (NTQ), a two-level quantizer which supports low precision graph navigation and high precision reranking in a single code. This representation achieves near floating point precision with 2.6x less memory. We also compress the size of our proximity graphs by up to 2.5x without impacting query throughput. We combine graph reordering with a new lossless compression codec called AdaptiveGap, which builds upon StreamVByte. At 95% recall, GINGER speeds up query throughput by an average of 1.8x over each dataset's fastest competitor and by at least 2.3x over any single library. This lead grows to 2.9x over compact libraries on high-dimensional embeddings.

1 INTRODUCTION

The rapid progress in deep learning has placed Approximate Nearest Neighbor Search (ANNS) at the center of information retrieval and data analysis [31, 49, 50, 62, 72, 88, 93]. Today's workloads are marked by a sharp increase in both the number of indexed entities and the dimensionality of the embeddings used to represent them.

Proximity graphs have been shown to perform well in very high dimensions, and are thus the dominant technique for ANNS indexing whenever high recall is paramount. A proximity graph represents each entity as a vertex and connects it to nearby and further directionally diverse neighbors. Queries route through the graph via greedy beam search, which iteratively expands the closest unexplored vertices until converging to the query neighborhood. Prominent proximity-graph algorithms include HNSW [57], Vamana (DiskANN) [41], NSG [26], and PiPNN [73, 74]. Compared to cluster-based inverted-file (IVF) indexes such as Faiss [22] and ScaNN [37, 81], proximity graphs achieve high recall with many fewer distance evaluations on modern embeddings.

Still, graph indexes face three bottlenecks in practice: (1) memory bandwidth at search time, (2) memory footprint to host the index, and (3) indexing time. Our prior work PiPNN [73, 74] effectively resolved the issue of index construction, building high-quality

Figure

Figure 1: Query throughput relative to Hnswlib at 95% 10@10 recall (top left, higher is better) and memory footprint (graph and compressed vectors) relative to raw vectors (top right, lower is better) as the geometric mean across 14 datasets, alongside index construction time on MS-MARCO (bottom, lower is better). SymphonyQG and ScaNN fail on some datasets, which are excluded in their aggregate.

billion-scale indexes in 10s of minutes instead of hours. This paper addresses the other two bottlenecks: search throughput and memory footprint. Moreover, we introduce the first production-grade implementation of PiPNN.

To this end we present and open-source GINGER¹, an in-memory C++ library for graph-based ANNS. It was developed internally at Google to solve a variety of large-scale retrieval problems with a primary focus on efficiency. We developed GINGER from the ground up as a standalone C++ library with portable SIMD kernels written in Highway [87]. GINGER also serves as the official open-source implementation of PiPNN II [73], thus combining SOTA query speed, memory efficiency and indexing time in one package.

Many industrial-grade vector search libraries exist, including Faiss [22], ScaNN [37, 81], DiskANN [41], SVS [1], and Hnswlib [58]. Given this high bar, it might be expected that there exists little room for improvement over these widely adopted and well-optimized systems. Surprisingly, we find that a combination of algorithmic improvements in vector quantization as well as careful performance engineering yields significant speedups over the prior state of the

¹https://github.com/google/ginger art. Across all 14 benchmarks in our evaluation, GINGER is on average 1.8× faster than the fastest competitor at 95% recall (up to 2.7×). The gap is largest on high-dimensional datasets (d≥768d \geq 768), where GINGER is 2.0× faster on average. Our results come from both designing every step of our beam search implementation around reducing memory traffic as well as reducing the index footprint by way of lossless graph compression. We make the following contributions.

  • Nested TurboQuant (Section 3). We introduce Nested TurboQuant (NTQ), an extension of TurboQuant in which a single code per vector serves both graph navigation and reranking. The beam search operates on the leading 4 bits per coordinate, which form a valid TurboQuant code [85, 92]. The remaining kk bits refine each 4-bit interval with a nested Lloyd–Max codebook, using the full code to rerank the search results. With 12 bits per coordinate, NTQ nearly matches the accuracy of 32-bit floats while using 2.6× less memory.

  • Fast graph search (Sections 3 and 4). We contribute an extremely fast SIMD kernel for one-to-many scoring of the 4-bit codes. On high-dimensional embeddings, we offer two ways to further speed up the search. We either project vectors to a lower dimension with PCA, or apply a tuning-free prefilter called TurboSlice [17] to discard unpromising candidates early.

  • Graph compression (Section 5). On low-dimensional datasets, the graph adjacency lists of prior libraries consume as much memory as the quantized vectors themselves. We introduce AdaptiveGap, a lossless codec that packs small gaps into fewer than eight bits while retaining the single-shuffle SIMD decoding of StreamVByte. On the same vertex ordering, AdaptiveGap uses on average 5.4% less graph memory (up to 7.6%) than StreamVByte. We combine this codec with graph partitioning to assign nearby IDs to neighboring vertices. Together, these techniques shrink the graph by an average of 2.1× (up to 2.5×) relative to an uncompressed CSR layout without slowing down queries.

  • Extensive evaluation (Section 6). We compare GINGER with seven state-of-the-art graph and IVF libraries on 14 public benchmarks with up to one billion vectors and 4096 dimensions. GINGER achieves the highest query throughput at 90% and 95% recall on 13 of the 14 benchmarks. At 95% recall, GINGER outperforms the fastest competitor by 2.0× on average (up to 2.7×) on high-dimensional data and by 1.45× (up to 2.1×) on low-dimensional data. At 90% recall, the corresponding speedups are 1.8× (up to 2.3×) and 1.55× (up to 2.0×). The complete GINGER index for the billion-point DEEP dataset occupies approximately 288 GB of memory with 12-bit NTQ (Figure 5).

GINGER’s modular design and portable SIMD kernels make it easy to integrate state-of-the-art ANNS into new search and data management systems. Our results demonstrate that we can simultaneously deliver state-of-the-art memory footprint, search performance, and indexing time through a mix of algorithmic improvements and performance engineering.

References (28)