Manuscript Offprint

arXiv:2608.30384

RSLM: Training-Free Vector Quantization for Approximate Nearest Neighbor Search

Rastislav Lenhardt, Teodora Dobos, Thomas Vecchiato, Jiri Isa, Igor Ginzburg

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

Rastislav Lenhardt

Google

Zurich, Switzerland

lenhardt@google.com

Teodora Dobos

Technical University of Munich

Munich, Germany

Google

Zurich, Switzerland

teodora.dobos@tum.de

Thomas Vecchiato

University of Copenhagen

Copenhagen, Denmark

Google

Zurich, Switzerland

thomas.vecchiato@di.ku.dk

Jiří Iša

Google

Zurich, Switzerland

jisa@google.com

Abstract

By introducing Rslm (Rotated Scaled Lloyd-Max), a family of training-free vector quantization codecs compressing embeddings to 1–4 bits per dimension, we reduce memory cost and memory bandwidth of a typical large-scale Approximate Nearest Neighbor (ANN) search system, while reducing its complexity and keeping or improving recall across multiple benchmark datasets. State-of-the-art systems filter candidates using coarse partitions, approximately score them to narrow the set, and then rescore the best with higher precision representations (often ≥\geq8 bits per dimension). Our relativized codecs can bring this down to 2–4 bits per dimension.

We use the properties of the ANN system to encode residual vectors instead of full vectors, both for the approximate scoring phase and the rescoring phase. Since Maximum Inner Product Search (MIPS) is very sensitive to vector norms, we correct the L2L_{2} norms of quantized vectors. Our major innovation is that we correct the L2L_{2} norm of the final reconstructed vector rather than just the residual. Our rescaling replaces more complicated schemes, such as Anisotropic loss. The residualization scheme gives us a more favorable quality vs size trade-off than generic quantization methods.

Our high-performance implementation leverages a block-wise cascaded Fast Walsh-Hadamard Transform (FWHT) with linear-like complexity, AVX SIMD-optimized codebooks, and a steganographic encoding of scaling factors for perfect cache-line alignment.

1 Introduction

High-dimensional vector embeddings serve as the foundational representation for capturing unstructured semantic information across various modern domain pipelines, including search [28, 33, 34], recommendation [31, 37], and Retrieval-Augmented Generation (RAG) [20, 38]. Approximate Nearest Neighbor (ANN) search systems are often used to locate relevant vectors within billion-scale databases with high throughput and low latency [9]. In modern high-throughput database systems, search index design is fundamentally dictated by tight hardware constraints: DRAM-to-CPU memory bandwidth limits and physical DRAM capacity [25].

High-scale database architectures rely on clustering-based [27] and tree-based partitioning indexes [7, 16]. These paradigms divide

Igor Ginzburg

Google

San Jose, CA, USA

igorginzburg@google.com

Figure

Figure 1: Geometric interpretation of residual quantization with both local and global scaling fixing the norm.

the vector space into localized Voronoi cells or spatial nodes, restricting online distance evaluations to a pruned subset of candidate vectors. For example, inverted file index (IVF) systems first identify spatially clustered candidate partitions and subsequently perform exhaustive Maximum Inner Product Search (MIPS) candidate re-ranking of candidates within the selected partitions [6, 43].

Within this second stage, vector quantization serves as an important technique to compress embeddings into compact representations [27]. This compression delivers a multi-fold system advantage: it reduces the overall DRAM memory footprint — enabling billion-scale in-memory indexes — while simultaneously cutting end-to-end query latency and boosting queries per second throughput by reducing DRAM-to-CPU transfer.

Traditional data-dependent quantization techniques, such as product quantization [27] (see Section 2), rely on offline training to construct dataset-specific codebooks. While data-oblivious quantizers eliminate this offline complexity and overhead, they suffer from recall degradation in aggressive low-bitwidth regimes below 3 bits per dimension [18]. To address this, a recently emerging class of rotation-based data-oblivious quantizers, such as EDEN [42], TurboQuant [52] and BlockQuant [3], leverages randomized orthogonal transforms to homogenize coordinate variance prior to quantization. By mapping embedding dimensions to known analytical distributions and using a fixed codebook, these frameworks enable accurate, training-free quantization.

Our Motivation and Positioning. We improve on the existing generic data-oblivious quantizers by respecting ANN-specific constraints and leveraging ANN-specific opportunities. First, dense orthogonal projections (such as the Haar-distributed random orthogonal matrices employed in TurboQuant [52] and RaBitQ [19]) scale quadratically with vector dimensionality D, incurring large matrix storage overhead and query transformation latency. Second, while Fast Walsh-Hadamard Transforms (FWHT) mitigate this computational cost by scaling in O(Dlog⁡D)O(D \log D), global full-vector FWHTs are strictly restricted to power-of-two dimensions. When deployed on arbitrary dimensionalities (e.g., D = 2049), global FWHT requires zero-padding up to the next power of two, significantly increasing both computational work and memory bandwidth requirements. Most importantly though, existing general-purpose data-oblivious codecs are traditionally designed as standalone, full-vector encoders optimized for coordinate-wise reconstruction rather than an integrated part of a vector search retrieval system.

References (21)