00-START-HERE · 01-READING-ROUTES · 15_approximate_nearest_neighbor_search · 17_operating_a_vector_store Purpose: Build a defensible retrieval index budget from code length, scoring error, scan shape, and fleet multipliers without confusing a smaller stored vector with a smaller system.
TL;DR
- Quantization changes the stored description of a same-dimensional vector. Dimensionality reduction changes the representation; neither preserves retrieval quality automatically.
- For power-of-two , PQ stores bits per vector, addresses composite codes and stores centroid floats. Codebook capacity is not a recall guarantee.
- Residual IVF-PQ uses the coarse cell address as part of the reconstruction. Its bit-gain estimate is conditional on a high-rate source model, not an accuracy floor. Naive residual ADC builds a table per probed cell; precomputation trades storage for query work.
- Under an unclipped, independent uniform-rounding model, SQ8 has inner-product noise about in the worked unit-vector example. A -bit independent-hyperplane code has local cosine-estimator noise about at cosine . These are model-based deviations, not universal ranking-error rates.
- Fast scans combine block layouts, small lookup tables and hardware-specific kernels. Quantizing the lookup table introduces another approximation; scalar and SIMD instruction counts do not determine a speedup by themselves.
- Count identifiers, graph slots, fixed tables, refine storage, rebuild overlap, replicas, payload and metadata separately. Float16 refinement is not exact rescoring of an original float32 corpus.
- A fleet budget must identify where each physical copy resides. Smaller codes do not automatically shrink every RAM, SSD or payload term.
The story
Think of the index as a warehouse that must ship an answer under a strict space and time budget. The original warehouse stores every item as a full -number crate. Each crate takes bytes in float32. Ten million crates consume before identifiers, graph links, replicas, or source text. Product quantization stops storing whole crates. It divides each crate into compartments and gives each compartment a catalog number. With and , each compartment needs one byte. A -byte crate becomes a -byte catalog slip while still describing all dimensions. The catalog has enormous reach because every eye, nose, and mouth choice can combine with every other choice. The warehouse can address composite items while storing only sub-centroids. Since each sub-centroid has width , the stored catalog is only floats. The price is a rigid grid. The catalog cannot place every boundary freely. The IVF level acts like a regional depot. It routes an item to a coarse centroid. Residual encoding catalogs the difference from that address; when the fitted centroids represent the deployed distribution, this can pool a lower-variance source near the origin. That accuracy opportunity is not free or guaranteed: a naive query builds a cell-dependent table for each probed depot, while precomputed terms reduce that work at an explicit memory cost. Scalar quantization rounds shelf measurements to a finer or coarser ruler. The small SQ8 noise calculated here assumes values remain inside the calibrated range and the rounding errors behave as modeled. Binary hashing instead records which side of sampled hyperplanes contains an item. Hamming counts then estimate an angle under the stated random-hyperplane model. Full-vector rescoring can improve the order of the shortlist, but cannot recover a crate that the shortlist missed. The shelving pattern affects how efficiently workers fetch codes. A per-vector layout puts one subquantizer's codes bytes apart for eight-bit PQ. A block-interleaved layout groups that subquantizer across, for example, vectors. This supports compact loads and uniform lane work; alignment, unpacking, table precision, tail blocks and the actual kernel still matter. The final invoice includes identifiers, graph slots, centroids, codebooks, optional precomputed tables, rebuild overlap, replicas, refine vectors, source chunks and filtering structures. Compression primarily shrinks the code payload. Index economics carries every remaining term to the right physical copy and storage tier; a separate builder or shared payload store is not free.
Decoder table
| Symbol or term | Meaning | Role in the chapter |
|---|---|---|
| Retrieval-Augmented Generation (RAG) | Retrieval supplies external context to a generator | The book context for the index design problem |
| Stored database vector | The object being encoded | |
| or | Query vector | Original query precision under ADC, not a claim of exact real arithmetic |
| Embedding dimension | in the main examples | |
| Number of indexed vectors or chunks | , , or in worked examples | |
| Quantization | Fewer bits describing the same-dimensional vector | Reduces storage without changing |
| Dimensionality reduction | Fewer vector coordinates | Changes the representation |
| Codebook | A finite set of centroids | Maps a vector or subvector to a stored index |
| and | Flat codebook and nearest-centroid reconstruction | A fixed-width index needs bits |
| Distortion | Mean squared reconstruction error | A fitting objective; low distortion does not itself guarantee top- recall |
| Lloyd’s algorithm | The -means fitting procedure | A local codebook-training heuristic |
| Scalar or flat-code bit width | distinct levels for a full alphabet | |
| Product quantization (PQ) | Separate quantization of coordinate blocks | Product reconstruction need not imply statistically independent blocks |
| Number of subquantizers | Also equals bytes per vector when | |
| and | Subvector and its codebook | Each subvector has dimension |
| Centroids per subquantizer | Usually or here | |
| Tuple of sub-indices | Stored length bits for separately packed fixed-width subcodes | |
| Number of composite PQ codes | Exponential address space | |
| Number of stored sub-centroids | Linear stored count | |
| Total stored centroid floats | Independent of | |
| Bits per dimension | Equals at power-of-two | |
| Principal component analysis (PCA) | Dimensionality-reduction comparison | Changes the vector instead of its storage code |
| Optimized product quantization (OPQ) | Orthogonal transform before PQ | Can improve block quantization; equal variance and better recall are not guaranteed |
| as a matrix | OPQ rotation | Applied to before quantization |
| Asymmetric distance computation (ADC) | Quantized database reconstruction, original query | Exact error identity includes a cross term; positive additive bias needs assumptions |
| Symmetric distance computation (SDC) | Both query and database are coded | Error includes cross terms and covariance; can reuse symmetric code distances |
| Query-to-sub-centroid table | Has entries | |
| Inverted file (IVF) | Coarse partition into inverted lists | Routes a query to selected cells |
| Inverted file with ADC (IVFADC) | IVF plus residual PQ and ADC | Same structure the source calls IndexIVFPQ in its named library |
| and | Coarse quantizer and centroid | Define the assigned cell |
| or | Number of coarse cells | Controls routing, list lengths, fixed memory and cell-address capacity |
| Residual | Value encoded by residual PQ | |
| Within-cell total mean squared residual under the centroid condition | need not transfer unchanged to shifted data | |
| Intrinsic dimension in a high-rate source model | Cancels in the bit-gain approximation only under the stated assumptions | |
| and | Code bits per vector and high-rate distortion | Use for rate, distinct from rotation and replica count |
| and | Mean squared error energy and reconstruction error | Error energy alone does not determine ADC/SDC distance bias |
| or | Probed IVF cells | Multiplies table builds and scans |
| Table-build/scan count-proxy crossover | ; nominal FLOP model instead gives | |
| Precomputed table | Optional stored cell-dependent residual terms | Saves full-dimensional per-cell work, not all query table operations |
| Scalar quantization (SQ) | Per-dimension integer encoding | Reconstructs component values |
| SQ8 and SQ4 | Eight-bit and four-bit scalar codes | Use and at |
| Calibrated lower and upper endpoints, | Saturation is needed; clipped errors can exceed half a bin | |
| and | Bin step and modeled rounding deviation | requires a uniform-bin approximation |
| Binary quantization | Sign-bit code | Raw signs, independent hyperplanes and learned rotations have different guarantees |
| , , and | Pair angle, Hamming count and angle estimate | Binomial variance uses independent isotropic hyperplanes |
| Exclusive-or (XOR) and population count (POPCNT) | Bit difference and bit count | Implement binary distance |
| SimHash | Sign code tied to the random-hyperplane lemma | Source connection from angles to binary codes |
| Iterative Quantization (ITQ) | Learned rotation before sign coding | Its covariance and recall are not certified by the independent-hyperplane binomial model |
| Matryoshka Representation Learning | Leading coordinates are trained to be self-sufficient | Source example combining truncation and binarization |
| FAISS | Similarity-search library name not expanded on the permitted source pages | Provides IVF, PQ, fast-scan, and table options |
| Single instruction, multiple data (SIMD) | Parallel lanes with one instruction | Rewards uniform PQ scans |
| Graphics processing unit (GPU) warp | A lockstep thread group; threads in the NVIDIA-style example | Not a guarantee that every kernel fills all lanes |
vpshufb |
Byte-shuffle lookup instruction | A -entry table per -bit lane; precision and packing matter |
| WarpSelect | Register-resident top- selection | Avoids global-memory sorting |
| CAGRA | GPU graph method named by the source | Uses fixed out-degree for warp-shaped work |
| Hierarchical navigable small world (HNSW) | Multi-layer graph index | Adds links and ragged traversal |
| , , , , | HNSW degree and level variables | Derive expected link bytes |
| , , | Code/vector, identifier and allocated graph-slot bytes | Graph formula is an expectation under a stated layer allocator |
| One index copy, written below | Includes the structures actually present, not every index family at once | |
| Local rebuild-overlap fraction for counted index structures | means old and new copies coexist; separate-builder peaks remain additional | |
| Serving index-copy count, written | Refine and payload copies must be counted by their own topology | |
| and | Physical payload footprint and peak deployment capacity | Separate RAM/SSD tiers and include replication, builders and refine stores |
| Refine set | Higher-precision vectors for candidate rescoring | Float16 is not exact relative to original float32; reranking cannot restore missing candidates |
| Central processing unit (CPU) | General-purpose processor | Source default for graph indexes |
| Solid-state drive (SSD) | Storage for exact vectors | Trades RAM for access latency |
| Non-volatile memory express (NVMe) | SSD access path in the read example | Seven ideal waves at the stipulated concurrency are not a measured tail bound |
| Resident set size (RSS) | Measured process memory | Used to validate the formula |
| and out of memory (OOM) | Tail latency and capacity failure | Operational decision and failure measures |
Core mechanics
Mathematical conventions
Storage is decimal unless explicitly binary: , , and . Keep intermediate precision and round required integer resources upward. Equal-width PQ assumes and fixed-length subcodes; a separately stored sub-index needs bits, which equals for the powers of two used here. A multiply-accumulate (MAC) is conventionally two FLOPs; neither is interchangeable with a table lookup or SIMD instruction. Operation-count crossovers are illustrative, not measured latency. Memory-over-bandwidth figures are streaming floors, not guarantees. Quantization-noise formulas require their stated bias, clipping and covariance assumptions. Binary binomial formulas below use independent random hyperplanes, not arbitrary coordinate signs. Rescoring is exact only over the fetched candidates, relative to the stored precision and metric; it cannot restore candidates omitted by routing or compressed search. Reported experimental results remain source inputs, not results established by this chapter's arithmetic.
16.1 Product quantization and the argument
What
A flat quantizer chooses a nearest centroid from a finite codebook, with a tie rule:
A fixed-length index costs bits. Codebook fitting minimizes average squared reconstruction error, for example on a training sample:
Lloyd’s -means algorithm is a local heuristic. The source cites exact Euclidean sum-of-squares clustering as NP-hard even for in general dimension. A flat -bit code needs centroids. At and :
Against the modeled ten-million-vector corpus of , that flat codebook alone is about times larger. A library warning heuristic of training points per centroid would request:
PQ splits into equal contiguous subvectors when , and fits sub-centroids per block. Its separately stored fixed-width subcodes have length:
Its representable code count, stored sub-centroid count, and stored coordinates are:
At , , and :
Why
The factor cancels from codebook memory. Code reach grows exponentially with while the stored codebook remains floats. The vector remains -dimensional. OPQ learns an orthogonal transform , with , before quantizing . The rotation preserves Euclidean distances before quantization and can improve how variance and dependence fit the product blocks. It does not guarantee equal block variances or optimal recall. A dense transform stores and costs about MACs per query; training and preprocessing costs should be measured. Already whitened inputs do not prove OPQ is useless.
Failure without it
For the same -bit code, PQ can use . Its codebook uses , while the flat -centroid alternative uses approximately . The -per-centroid heuristic is training vectors per subspace, generally reusing the same training vectors across subspaces; it is not a theorem or disjoint training sets. The analogous flat heuristic is about vectors. The flat-to-product codebook-memory ratio at the same representable labels is:
PQ restricts reconstruction cells to products of subspace cells, so their boundaries cannot be placed independently in full space. The very large code count does not prove that all labels are useful or equally likely. Measure recall and reconstruction distortion against the embedding distribution, especially at low rates such as below bits per dimension; that value is a source heuristic, not a mathematical failure threshold.
Cost and complexity
ADC builds:
There are entries and coordinate accumulations. Direct squared-distance evaluation uses a subtraction, square and accumulation per coordinate; a norm-plus-dot-product implementation has a nominal MACs, about FLOPs, plus norm/combination terms. Each candidate needs table lookups and approximately additions. These are different work types. For , the table has entries, at float32. The nominal dot-product portion is MACs, or FLOPs. If one ignores table loads, norm terms, selection and bandwidth, a proxy comparing with gives:
SDC also quantizes the query. It saves no database-code bytes, but can exploit a query code and precomputed symmetric code distances in some workflows. Neither ADC nor SDC has a universal additive positive-bias formula for deterministic centroid quantization; the error algebra and assumptions are given below.
Worked numbers and decisions
- HNSW-Flat with float32 vectors and has of vectors plus approximately of allocated link slots under the layer convention below, or before other overhead. Base slots alone are ; this is four-byte slots per vector, not eight-byte links.
- PQ96 codes use and the shared codebook . The code-payload reduction is exactly times and the rate is one bit per dimension.
- A query's float32 PQ96 table is . Its nominal dot work is million MACs, or , before other terms.
- Scanning codes reads of codes. That may fit a particular last-level cache, but does not prove a cache hit, or include the lookup table, IDs and selection state.
- PQ32 codes use , times less code payload than float32, with labels and bit per dimension. This is not a -fold reduction of the entire index.
- At the same bytes, a PCA projection stores float32 principal coordinates, dropping principal directions. PQ96 reconstructs all coordinates approximately. Neither wins independently of the data spectrum and retrieval task.
- An IVF-PQ96 entry adds an eight-byte ID: bytes and of entries, above the code array. Add centroids, codebook, list metadata and optional precomputation separately.
- At , codes have bits and the codebook is . A flat -centroid float32 book would use decimal zettabytes.
- The commonly used makes bytes per code; gives one bit per dimension when integral. The listed choices , , , , and divide , but are not all its divisors.
- A fast-scan kernel trades smaller subcode alphabets and table quantization against quality; measure it at matched code bytes and recall. OPQ has separate rotation cost.
- Retrain or recalibrate after material encoder or corpus shift. Treat samples per subspace as a warning heuristic, not a proven sufficiency guarantee.
- Full float32 vectors can rescore a shortlist exactly in the original metric, but only within that shortlist. Keeping them on NVMe still requires of storage plus access, metadata and replication budgets. These budgets distinguish code payload, fixed structures, score error and the physical copies needed for a serving system. A smaller vector description is not automatically a smaller end-to-end deployment.
- HNSW-Flat: The scoped estimate is of vectors plus of expected allocated slots, including upper levels. It excludes allocator, label-map and runtime overhead.
- PQ96: The -byte code array is ; the shared book is . Rate and payload ratios do not establish recall.
- Query table: float32 entries use . A norm-plus-dot build has a nominal MACs, conventionally FLOPs, plus remaining terms. The -code stream is .
- PQ32: Codes use , labels and bit per dimension. Full-index savings are smaller when fixed and per-item non-code terms are counted.
- PCA comparison: retained principal coordinates cost bytes; principal directions are discarded. PQ96 describes all coordinates approximately, not losslessly.
- IVF entries: The ID changes to bytes, or before fixed terms; the increase over codes is . Use hardware measurements rather than byte counts alone to choose and . A smaller lookup table enables particular shuffle kernels, but table quantization and changed subspaces may alter recall. OPQ adds a transform, and a codebook-trained index must be reevaluated after material distribution shift. The -points-per-centroid heuristic is neither a training lower-bound theorem nor a quality guarantee. Reranking can improve candidate order, but keeping and fetching the original vectors remains a separate storage and latency decision.
16.2 Residual quantization and IVFADC
What
IVF assigns each vector to the nearest of centroids. Residual encoding stores:
Let denote a random vector and . At a population centroid condition, or for the empirical training distribution at a nonempty-cell Lloyd fixed point:
Then , so the cross term vanishes. With denoting finite positive total mean squared deviation, not per-coordinate variance:
Training centroids need not satisfy that identity for a shifted serving population. For a high-rate model with intrinsic dimension , comparable source shapes and the stated common prefactors, use the schematic approximations:
Equating raw distortion at to residual distortion at within this model gives:
For quantizer errors and , the exact ADC and SDC identities are:
Why
The coarse level can remove between-cell variation before PQ encodes residuals. The list address has at most bits of information; actual entropy may be smaller for imbalanced assignments. It is implicit in list membership rather than stored in every PQ code, but centroids, IDs and list structures still cost memory. The estimate is not a high-rate lower bound. Different source shapes, cell quality, rates and product-block correlations can change the gain in either direction. Likewise, the often-quoted ADC mean distance requires conditionally zero-mean error with ; SDC adds only with suitable zero means, equal error energy and zero cross covariance. Deterministic centroid errors do not generally satisfy these assumptions. For example, equally likely, and give exact distance but ADC distance , not .
Failure without it
Without residuals, a shared raw-vector codebook covers the full distribution rather than each centered cell's residual distribution. Residuals can improve that allocation, but do not automatically reduce every query error or improve every rank. When measured is near , centering may offer little distortion benefit while still costing work. The suggested warning is a workload heuristic, not a theorem. OPQ and centering can interact; measure their joint effect rather than adding their gains.
Cost and complexity
Without precomputation, residual scoring forms for each probed cell and builds a cell-dependent table. For balanced or representative probed lists, the following counts use one coordinate accumulation for table work and one addition for scan work; they are not calibrated equal-time operations:
The count-proxy crossover cancels . Using the nominal two-FLOP MAC model instead changes the crossover; ignored loads, norms, table combinations and selection can move it further:
Use , , , , , and :
- Codes are bytes and IDs eight bytes: -byte entries use .
- Centroids use and the book . The scoped total is , about times smaller than float32 vectors alone, before other structures.
- Mean list length is , so representative lists contain codes; the scan proxy is additions.
- A raw-PQ table has coordinate accumulations or nominal MACs. This is of the scan's addition count, but nominal MAC FLOPs are ; neither ratio is a latency share.
- Naive residual tables use coordinate accumulations, times the scan count. The nominal dot-work FLOP ratio is before remaining terms.
- The coarse address at contributes at most label bits. Under the high-rate equal-prefactor model this corresponds to a code-bit gain, not a guaranteed accuracy gain or floor.
The source's to coarse-list starting heuristic gives:
These endpoints are approximately and times the count-proxy crossover, or twice those ratios against the nominal FLOP crossover. The range is a tuning heuristic; it neither guarantees balanced lists nor matched recall. An optional float32 table of cell-dependent residual terms costs:
The exact expansion, including the cell-dependent offset needed when comparing candidates across lists, is:
For PQ64, this optional table uses at , or of the scoped index before adding it. The combined total becomes . At the table is . Precomputed terms remove repeated full-dimensional work, not every query operation: a shared query-dot table still costs nominal MACs, cell-table combinations cost , and list scans, coarse search and selection remain.
Worked numbers and decisions
- Compare raw PQ, residual PQ and precomputed residual PQ at matched code bytes, recall, load and memory. Disable or alter residual encoding when the measured benefit does not justify its real query and storage cost; or a half-scan build share are heuristics to test, not universal thresholds.
- ADC keeps the original query; SDC may be useful for already coded queries. Additive positive-distance bias is not a general guarantee for either method.
- At , mean scan work is additions while naive residual build work stays nominal MACs: a count ratio , or nominal dot-work FLOP ratio .
- The balanced scanned corpus fraction is at cells and at . Restoring that fraction takes , not a promise of restored recall.
- At , scan work returns to additions but table work rises to nominal MACs. The same large build-to-scan ratio remains. Benchmark precomputation, another coarse routing strategy or raw PQ rather than assuming one remedy always wins.
- Rerank a measured shortlist when original vectors are available. Exact float32 candidate scoring is not global exact search; increasing code bits and increasing candidate coverage address different failure modes.
16.3 Scalar and binary quantization
What
Float32 payload is bytes, or bytes at . For bits and a calibrated range , a clipped nearest-level scalar quantizer is:
For , nearest rounding gives , where . Clipped outliers need not obey that bound. A zero-mean uniform-bin approximation gives:
A unit vector has average squared coordinate . If the unit-vector distribution is also zero-mean and isotropic, each coordinate has the following RMS/standard-deviation scale; it is not the value of every coordinate:
With and :
For a fixed exact unit query, the score below is the dot product with the reconstructed vector, without renormalizing that reconstruction. With error mean and covariance :
Only under , and does score deviation equal . Per-dimension ranges, correlated errors, clipping and renormalization change that result. For binary hashing, let independent isotropic random hyperplanes encode a nonzero vector by . For a fixed pair at angle :
The source connects the single-random-hyperplane collision result to SimHash through Goemans and Williamson (1995) and Charikar (2002). Raw coordinate signs have no such guarantee for arbitrary fixed embeddings. A random orthogonal rotation has dependent hyperplane directions, so it does not by itself establish the binomial variance; learned ITQ also requires empirical error calibration.
Why
SQ8 reduces precision while retaining approximate component values. Binary Hamming counts estimate angular similarity under an appropriate hashing model instead of using one-bit reconstructed components. XOR and population count make Hamming scoring cheap, but query hashing, memory traffic, selection and candidate recall still cost work. A cosine estimate from Hamming is nonlinear and is generally biased even when the angle estimate is unbiased.
Failure without it
For finite, normal-range values rounded to nearest, float16 has significand bits and the usual relative error bound:
Subnormals, overflow and the actual rounding implementation need separate treatment. At component RMS , the normal-range absolute bound scale is about . A further uniform-relative-rounding approximation gives RMS near , about times below the SQ8 component-noise model while using twice the bytes. This does not prove a score-error rate or universal ranking gap. Extrapolating the uniform-bin scalar model to one bit gives and , but the high-rate approximation is especially questionable when unit-vector coordinates cluster near zero. Treat it as a surrogate, not a measured cosine deviation. Independent random-hyperplane hashing changes the estimator; an arbitrary coordinate-sign code or learned/orthogonal rotation must have its own bias, variance and recall measured. No theorem requires every binary deployment to rerank, but cosine-quality requirements may make it necessary.
Cost and complexity
At cosine :
The delta-method cosine deviation is at cosine and . It is not an exact standard deviation or a universal error bound. Binary code payload is eight times smaller than SQ8 and its local modeled deviation is about times larger. Comparing it with the extrapolated one-bit scalar deviation gives a ratio near , but does not validate that scalar noise model. For vectors and a sustained code-stream bandwidth of , the following are payload-only read floors, not measured end-to-end scans:
| Configuration | Memory | Scan | Score behavior |
|---|---|---|---|
| float32 | Original precision; exact candidate score only under the defined metric and arithmetic | ||
| SQ8 | Modeled raw-dot deviation ; no clipping assumed | ||
| Binary | Independent-hyperplane local cosine deviation at cosine |
Two float32 calibration endpoints per coordinate use . For two item scores, independent SQ8 errors in the stated isotropic model give a difference deviation:
The -deviation number is a scale comparison, not a justified Gaussian tail estimate. There is a stronger statement for this particular unclipped equal-step raw-dot model: , so a gap cannot flip under those bounds. Clipping, non-unit queries, other scoring rules or changed ranges invalidate that conclusion. For binary scores, an independent, equal-local-variance Gaussian surrogate at cosine gives the illustrative calculation below. The real scores share hash planes and a query, so their errors need not be independent:
For shared independent planes, even the covariance depends on a third angle. Write , and . One-bit disagreement covariance is , and is times that quantity. Thus a score gap alone does not determine a binary flip rate. For a separate reranking budget, fetching original float32 vectors needs:
Assume every candidate needs one independent read, all requests are ready, maximum concurrency is and every service time is exactly . Full waves then need:
That is of the binary read floor, not a measured fraction of end-to-end latency. A fluid throughput calculation gives , but cannot complete a partial final wave in the equal-service-time model. If each vector is read as one aligned record, device traffic is rather than . Queueing, page crossings, cache hits, selection and rescoring compute change actual latency.
Worked numbers and decisions
- PQ96 and -bit binary codes both have bytes and labels; their reconstruction geometry and estimators differ. Equal code count does not imply equal quality.
- Per-dimension clipping at the and quantiles is a calibration heuristic. It permits outliers beyond the half-step rounding bound. If every coordinate has exactly marginal clipping probability, expected clipped coordinates at are ; under further coordinate independence, about of vectors have at least one clipped coordinate. Production drift can change both rates.
- Distinguish raw coordinate signs, independent random projections, orthogonal rotations and learned ITQ. Only the stated independent-hyperplane construction directly gives the binomial formula; rotations and learned codes need measured covariance and recall.
- The source names library scalar options such as
QT_8bitandQT_8bit_uniform. Doubling an otherwise fixed range doubles the step and quadruples uniform-bin MSE; it may also change clipping error, so total MSE need not quadruple. - Oversampling by to times and rescoring are starting heuristics. Measure candidate recall as well as final ranking; rescoring cannot recover excluded items. A sub- budget is not by itself a reason to accept unmeasured error.
- Independent dense -plane query hashing costs MACs before the binary scan; no learned codebook does not mean free encoding or rebuilding. Structured and learned transforms have different costs.
- Truncating a suitably trained Matryoshka representation to dimensions and storing sign bits uses bytes, times less payload than original -dimensional float32. Ablate truncation and binarization separately, with an explicit sign-code model and measured recall.
16.4 FAISS, parallelism, and why block structure matters
What
PQ ADC computes:
Building the table touches coordinates; a norm-plus-dot implementation has nominal MACs plus other terms. Scanning one code uses lookups and additions, or additions with a zero-initialized accumulator. Loads, arithmetic and vector instructions are distinct costs. An illustrative coordinate-accumulation versus lookup-and-add count proxy, not an instruction- or time-equivalent comparison, gives at :
A conventional eight-bit PQ row stores a vector's subcodes together. Across vectors, one fixed subquantizer is then sampled at stride bytes. Implementations can still vectorize or cache such gathers; the layout does not uniquely fix instruction count.
A fast-scan kernel stores subcodes in blocks, for example vectors with subquantizer-major order. Four-bit subcodes are packed and unpacked for register lookup. A vpshufb-style byte shuffle addresses entries within each -bit lane; wider vector units replicate or arrange tables by lane. Quantizing table entries to bytes is an additional approximation, and accumulation width, offsets and saturation handling must be specified. Choosing alone does not make a float32 table byte-sized.
At the same -bit budget:
| Layout | Parameters | Table |
|---|---|---|
| PQ8 per vector | ; code bits | Float32: |
| PQ4 fast scan | ; code bits | Float32: ; byte-quantized LUT: , plus scale/offset state |
Why
Within a full block, PQ scoring has regular logical work and can avoid graph-like pointer traversal. A -vector block can suit a -thread NVIDIA-style warp, but CPU fast-scan layouts and GPU warp kernels are not the same implementation. Tail blocks, stalls, coarse routing and top- selection can still leave lanes idle. Uniform code work is an opportunity for utilization, not a guarantee of occupancy. Register-resident top- selection can avoid materializing every score and sorting it in global memory. A comparison baseline should say whether it materializes all scores, uses a heap, or uses another streaming selection method.
Failure without it
The source's opening example compares of float32 payload with of -bit PQ codes, a -fold code-payload reduction, while reporting only about a twofold scan improvement. Codebook lookups, arithmetic and selection can replace bandwidth as the bottleneck. A float32 query table is half of a stipulated L1 cache, not proof of a particular miss rate or a universal speedup. The worked selected-code stream is about per query. A single unbatched query may underfill an accelerator, but that depends on kernel, coarse work, concurrency and hardware; bytes alone do not prove underutilization. HNSW traversal has dependent accesses and uneven candidate work, which can make naive lane mappings inefficient. The source's FAISS GPU-HNSW statement applies to its reported implementation/version, not a theorem that graph search cannot run on GPUs. Specialized graph kernels such as the source's CAGRA example use regularized layouts and degree budgets to improve parallelism; fixed out-degree alone does not prove full utilization.
Cost and complexity
The source reports a four-bit block scan about to times faster than its conventional baseline, and reports WarpSelect at times a prior implementation plus a billion-vector -NN graph built in under hours on four Maxwell Titan X GPUs. Preserve the respective study, workload and baseline scopes; these are not predictions for the arithmetic example below or current hardware. Use , , , and :
PQ8 with and :
- PQ8 with stores -byte codes: versus of float32 payload, a -fold code-payload reduction.
- Use only as a rounded planning count. Its code stream is .
- A nominal scalar accounting of subcode extractions, table loads and additions is operations per code, or across the planned candidates. This is not a count of CPU micro-operations or cycles.
- The nominal -coordinate table build corresponds to candidates under the earlier heterogeneous count proxy, of the mean candidate count. The percentage is not a measured runtime share.
- The full index also has of eight-byte IDs, of coarse centroids and a book: a scoped before other terms. Coarse routing over centroids must be budgeted, not hidden in the selected-code scan. PQ4 with and :
- PQ4 with retains the same bits and code payload; changed subspaces and LUT precision can change recall.
- If the planned candidates form one packed run, blocks contain slots. Real IVF lists generally round blocks separately, so the sum of list block counts can be larger.
- Under a particular kernel's assumed seven vector instructions per subquantizer per block—one load, two nibble unpacks, two shuffles and two accumulation operations—the illustration is:
The numerical ratio compares scalar logical operations with vector instructions, not equivalent work or a predicted speedup. Extra packing, table conversion, accumulation overflow handling, routing and selection are omitted. For the smaller codebooks, the table-work count proxy becomes:
The proxy ratio is , not a measured table-build share. Comparing it with the PQ8 proxy does not account for the different scan kernels. If all planned candidate scores are materialized as float32, their output size is:
One write plus one reread is , exactly of the code stream. This is traffic accounting, not a latency penalty; streaming selection may avoid those transfers and caches can change the path. The reported -to--fold kernel speedup cannot be inferred from, or disproved by, the unlike-instruction-count ratio. Establishing why a measured gap occurs requires matched baselines, hardware counters and end-to-end timing; unchanged traffic and selection are plausible contributors, not conclusions proved by this ratio. For residual IVFADC at these PQ8 settings, a precomputed table costs:
This optional table is times the code array, before the separate IDs, centroids, codebook and overhead. The PQ4 version would have a different table budget, ; kernel and library support must also be checked.
Worked numbers and decisions
- Compare a supported fast-scan implementation with classic IVF-PQ at the same total code bytes and measured recall; do not assume the smaller LUT is accuracy-free or always faster.
- The -candidate PQ8 and -candidate PQ4 figures are count proxies, not universal latency break-evens. Include coarse routing and any per-cell residual work.
- Select CPU, GPU, graph or scan kernels from measured workload shape. Batch queries when useful, but include batch-fill delay for interactive requests.
- A tuned CPU can beat an underfilled accelerator, while a specialized GPU graph can beat naive CPU/GPU defaults. Neither is a universal rule.
- Budget residual precomputation explicitly and use measured query savings to decide whether it is worthwhile. The suggested -centroid caution is configuration-dependent, not a hard library or mathematical limit.
16.5 Index memory arithmetic, end to end
What
At :
| Stored form | |
|---|---|
| float32 | |
| float16 | |
| SQ8 | |
| PQ with eight-bit subquantizers |
IVF entries in these examples add an eight-byte ID. The HNSW example assumes implicit positional labels and four-byte neighbor IDs; stable external keys, deletion state and label maps can add bytes. Turn terms off when the corresponding structure is absent rather than adding IVF and graph terms indiscriminately. HNSW levels follow:
For an integer layer , . Under the stated allocation convention, base layer zero reserves four-byte neighbor slots and each occupied upper layer reserves . Actual populated degree is not the same as reserved capacity, and implementations may allocate differently. The expected allocated slot bytes per node, excluding counts, pointers, alignment and other overhead, are:
At :
The base-only rule gives bytes at . Including expected upper slots is higher than that base allocation; the two figures have different scopes. This expected-slot budget is neither an exact realized graph size nor complete process memory. Coarse IVF centroids use bytes and a float32 PQ book bytes. Include each only when present. Add optional precomputed tables and actual maps/overhead separately; a full-precision refine store is not part of a code-only budget.
Why
The simplified fleet formula assumes equal serving index copies and local rebuild overlap per replica. A same-node old-plus-new rebuild has for those index structures; not every in-place/incremental algorithm needs two full copies. A separate builder can move rebuild memory off serving nodes, but its peak and swap overlap must still be counted. A value such as is measured slack for one deployment, not a universal safe allowance. Refine and payload terms above already include their own physical replication and peak overlap, so do not multiply them again or silently omit replicas. Keep RAM and SSD budgets separate by tier. At tokens and roughly four characters per token, characters correspond to only under a one-byte-per-character average. UTF-8 is variable-width. The worked payload assumption is therefore of text per chunk, for chunks, plus per chunk or of logical metadata. This is a single logical payload copy, not automatically its replicated physical footprint or resident filter-index memory.
Failure without it
The naive estimate omits IDs, links, fixed tables, rebuild overlap, replicas, maps, allocator overhead, tombstones and payload. In the example, links are about of the vector-plus-slot budget. Omitting their from each of six old/new replica copies hides about ; percentages must be applied to the correct base. A refine store changes both the byte ratio and the precision claim. The scoped IVF-PQ96 index is . Adding float16 vectors uses , only about times smaller than the HNSW vector-plus-slot baseline. Float16 refinement is not exact relative to original float32 values. Keeping original float32 vectors instead gives , only about times smaller. Either may live on SSD, but then account for its storage, reads and physical copies. Candidate rescoring is not a guarantee of global top- recall. These are scoped budgets, not complete RSS. Validate per-item and fixed terms with representative builds and measured RSS; a sample cannot be blindly scaled because fixed structures, levels, fragmentation and working sets scale differently. Exact conversions are and . A binary unit is larger in bytes than the same numeric decimal GB value; the reverse percentage has a different denominator.
Cost and complexity
Use , , , , and decimal GB:
| Configuration | Per-vector bytes | Fixed terms | One index |
|---|---|---|---|
| HNSW-Flat float32, | None in this slot-only model | ||
| IVF-Flat | centroids | ||
| IVF-PQ96 | centroids; book | ||
| IVF-PQ96 plus float16 refine | Same IVF/PQ fixed terms | ; higher-precision candidate refinement, not original-float32 exactness |
- HNSW allocated links alone are approximately . Its complete implementation may use more.
- The scoped IVF-Flat estimate is about smaller than HNSW-Flat; the comparison changes with graph allocation, maps and implementation overhead.
- IVF-PQ96 is approximately times smaller before refinement under these scoped terms, not necessarily at matched recall.
- With and no separate builder/refine term, six index copies require about for HNSW or for IVF-PQ96.
- If one logical payload copy is genuinely shared and its physical overhead is ignored, totals are about and across the counted tiers. A real payload service's replication and RAM/SSD placement need their own budget.
- The index-copy term saves approximately ; no saving in that term reduces the stipulated payload bytes. At , -byte IVF-PQ96 entries alone are . A decimal resident budget allows at most per point before any fixed terms or headroom. This rules out those entries in one such RAM budget; it does not mathematically require a -byte code. For example, -byte codes plus eight-byte IDs use , leaving room to budget other resident terms, while vectors and graph may remain on SSD. The source's DiskANN result has its own dimension, code and storage configuration and does not validate every billion-point layout. At , centroids use while -byte entries use . Adding the PQ book gives before other terms. Fixed structures can exceed the entry array, so extrapolating a large-corpus per-vector ratio is unsafe. Halving from to at eight bits per subcode saves of codes at points. It does not halve the eight-byte IDs, coarse centroids, the PQ book or a float16 refine store; recall and scan behavior also change. For million vectors, retain and in the relevant configurations. The following includes expected graph slots, the IVF coarse book where used and scalar calibration bytes; it still excludes other overhead:
| Design | Bytes per vector | Total | Reduction |
|---|---|---|---|
| HNSW-Flat float32 | Baseline | ||
| HNSW plus SQ8 | , plus shared calibration | times smaller | |
| IVF plus SQ8 | , plus centroids and calibration | times smaller |
At constant monthly compound vector growth, ignoring fixed-term changes and assuming the same capacity is otherwise available, the yearly multiplier and approximate capacity time bought by the last ratio are:
Worked numbers and decisions
- Quote per-vector bytes, fixed structures, code precision and metric, then multiply by before rounding.
- Budget simultaneous old/new structures where the actual rebuild procedure needs them; do not call a separate builder free. State payload, refine and index replication separately.
- Keep source payload outside the replicated index tier when its fetch meets the workload, but still count its physical storage and any resident filter structures.
- Choose the refine precision, location and fetch budget before optimizing . Float16 is not original-float32 exactness, and exact candidate ranking is not exact candidate coverage.
- Report peak fleet bytes by RAM/SSD tier and measured RSS, not just a code array or one nominal copy. In the worked six-index-copy model, a per-copy saving near becomes before payload.
- Compounding growth can consume a compression gain in roughly months in this scenario. That is a capacity illustration, not a guarantee about quality, serving throughput or when every system must shard.
Diagrams
Figure 16.1
Diagram description and source
flowchart TD
X["768-dimensional float32 vector: 3,072 bytes"] --> S["Split into 96 blocks, width 8"]
S --> U1["Subvector 1"] --> C1["Book 1: 256 by 8 floats"] --> I1["Index 37"]
S --> U2["Subvector 2"] --> C2["Book 2: 256 by 8 floats"] --> I2["Index 210"]
S --> U96["Subvector 96"] --> C96["Book 96: 256 by 8 floats"] --> I96["Index 128"]
I1 --> CODE["96 one-byte indices: 32-fold payload reduction"]
I2 --> CODE
I96 --> CODE
CODE --> GRID["Product reconstruction: subspace choices combine"]
subgraph TOY["Separate two-block, four-centroid toy"]
P["Product: 16 labels from 8 sub-centroids"]
F["Free book: 16 full-dimensional centroids"]
end
| View at | Cells | Stored pieces | Boundary freedom |
|---|---|---|---|
| Product codebook | sub-centroids | Shared grid boundaries | |
| Free codebook | full centroids | Freely placed cells |
Figure : A product reconstruction combines subspace choices, yielding possible labels from sub-centroids with stored coordinates. These counts are capacities, not evidence that every label is used or equally probable. Product-cell boundaries are constrained by the shared subspace partitions. The separate toy compares product labels with freely placed full-dimensional centroids; it is not the main PQ96 configuration.
Figure 16.2
Diagram description and source
flowchart TD
X["Vector equals coarse centroid plus residual"] --> SUB["Subtract assigned centroid"]
SUB --> POOL["Pool residuals; measure their variance"]
POOL --> PQ["Shared residual PQ book"]
Q["Original-precision query"] --> COARSE["Route to w coarse cells"]
COARSE --> PROBE["Probe their inverted lists"]
PROBE --> CELL["Form each query-minus-centroid residual"]
CELL --> TABLE["Without precomputation: about w k d coordinate accumulations"]
TABLE --> SCAN["Scan selected codes with per-cell table"]
SCAN --> OFFSET["Include cell offsets when comparing lists"]
OFFSET --> TOP["Candidate shortlist; optional full-vector refinement"]
PRE["Optional cell-dependent precomputed terms"] -.-> TABLE
Figure : Residual reconstruction writes and encodes with a shared PQ book. Lower residual variance follows under the stated centroid/distribution conditions, not automatically after drift. Naive ADC tables depend on for each of cells; optional precomputed terms reduce full-dimensional rebuild work but add bytes and still require query terms and table combination. The schematic high-rate gain is not a guaranteed floor.
Figure 16.3
| Code | Bits per dimension | Footprint | Cosine noise |
|---|---|---|---|
| SQ8 | under the unclipped, isotropic uniform-error raw-dot model | ||
| SQ4 | under the same surrogate; calibration and clipping matter | ||
| Naive scalar | from a questionable one-bit uniform-bin extrapolation, not a measured cosine deviation | ||
| Binary Hamming | at | Delta-method deviation at cosine with independent random planes |
Diagram description and source
flowchart TD
B["10 million 96-byte binary codes: 0.96 GB"] --> H["12 64-bit XOR/popcount pairs per code; scoring cost is additional"]
H --> FLOOR["Code-read floor: 19.2 ms at 50 GB/s"]
FLOOR --> C["Example shortlist: 200 candidates"]
C --> F["614.4 kB useful float32 data; seven ideal read waves: 0.7 ms"]
F --> R["Original-float32 candidate rescoring"]
R --> T["Top 10 among fetched candidates"]
R --> P["Read-wave time is 3.65 percent of code-read floor; missing neighbors remain missing"]
Figure : The listed deviations compare different estimators under explicit error models, not a universal compression-versus-noise curve. The binary value uses independent random hyperplanes at cosine ; raw signs or learned/orthogonal rotations need separate calibration. The flip illustration additionally assumes independent local score errors, which shared hashes need not satisfy. Exact candidate rescoring improves order but cannot repair candidate omissions, and is not mandatory if measured final quality already meets the application contract.
Figure 16.4
Diagram description and source
flowchart TD
PV["Per-vector codes: one subquantizer at a strided offset"] --> STRIDE["Gather or multiple loads across vectors"]
BI["Block-interleaved subcodes"] --> LOAD["Compact block loads and unpacking"]
LOAD --> SHUF["Small in-register lookup tables"]
PQ["Regular full-block scan"] --> BUSY["Uniform logical work; actual occupancy still depends on kernel"]
G["Graph traversal"] --> R["Dependent accesses and uneven candidate work"]
R --> IDLE["Potential stalls or divergence, not inevitable idle-lane counts"]
| Memory order | First group | Second group |
|---|---|---|
| Per vector | ||
| Block interleaved |
Figure : Block-interleaved subcodes can replace strided gathers with compact loads, unpacking and register lookups. The -vector block is a kernel/layout choice, not a guarantee that one instruction scores a block or every lane remains busy. Four-bit fast scans also quantize tables and manage accumulation range. CPU shuffle lanes, GPU warps, tail blocks and graph kernels must be compared in their actual hardware setting.
Figure 16.5
| Budget row | HNSW-Flat, float32, | IVF-PQ, |
|---|---|---|
| Stored vector, | ||
| Add identifier | Implicit, | |
| Add graph links | expected slots | None |
| Multiply by | ||
| Add centroids and codebook | at | |
| Multiply by , | ||
| Multiply by | ||
| Shared payload | single logical copy in this illustration | Same stipulated shared copy; physical replicas, RAM/SSD placement and other terms additional |
Figure : The expected-slot/code-only comparison yields approximately times smaller one-index bytes before refinement and implementation overhead. At , the scoped index-copy terms are versus , a difference. The stipulated logical shared payload exceeds the six compressed-index copies but still needs its own physical capacity plan. A separate builder, resident refine set, payload replication or resident filtering structures would add further terms.
Whiteboard pack
What to draw
- Write and bytes per float32 vector.
- Split into blocks of width eight, each with centroids; store a -byte code.
- Show composite labels, sub-centroids and stored centroid floats. Label them capacity and storage counts, not a recall proof.
- Draw and query tables for . Add optional precomputed terms, memory and cross-list offsets.
- Write the exact ADC error with its cross term, and qualify the conditional noise models for SQ8 and binary hashing.
- Branch to -byte SQ8 and -byte binary payloads. Label calibration/clipping assumptions and shortlist recall; refinement cannot recover omitted neighbors.
- Draw a -vector block, packed subcodes and table lookup. Distinguish byte-quantized LUT size from float32 LUT size.
- Separate scalar work counts, vector instructions and measured latency.
- Finish with IDs, expected graph slots, fixed tables, refine precision, rebuild overlap, replicas, builders and physical payload by storage tier.
Spoken script
Start with the deployment constraint: ten million -dimensional float32 vectors use before other structures. PQ96 uses one byte for each of eight-dimensional blocks, with a shared codebook. Residual IVF-PQ can exploit a coarse cell address but pays cell-dependent table work or optional precompute memory. SQ8 and binary have different modeled error sources; neither has a universal accuracy guarantee, and clipping or shared-hash covariance can invalidate a simple noise calculation. Block layouts enable efficient kernels, not automatic speedup. Finally, count every index, refine, rebuild, builder and payload copy in its actual RAM or SSD tier. Rescoring is exact only for covered candidates and the authoritative stored precision.
Interview traps
1. Why not reduce to dimensions?
PCA with retained float32 principal coordinates uses the same bytes as PQ96 while dropping principal directions. PQ96 reconstructs all coordinates approximately, but that alone does not make it better. Compare PCA, PQ and any combinations at matched total bytes and measured task recall under the fixed encoder. Refine candidates when useful, while measuring coverage separately.
2. What does ADC mean, and why can residuals hurt ?
ADC keeps the original query and quantizes the database reconstruction. Its exact squared-distance error contains both reconstruction energy and a cross term; the common bias requires zero-mean/uncorrelated assumptions and is not general for learned centroids. SDC also has query/database error covariance. In residual IVF-PQ the table depends on , so naive build work rises from nominal to coordinate accumulations; precomputation trades memory for query work. A high-rate estimate near bits is conditional, not an accuracy floor or a guarantee.
3. Choose product, residual, scalar, or binary quantization.
SQ8 is a practical calibration baseline with a fourfold code-payload reduction, not guaranteed low-risk accuracy. PQ trades a learned product reconstruction against code bytes; residual PQ adds a coarse address and table work. Binary hashing can offer cheap Hamming scans, but its angular-noise model depends on the projection construction and score covariance. Choose from measured candidate recall, final quality, update cost, hardware and total storage. Original-vector rescoring can repair shortlist order, not omitted candidates; float16 refinement is not original-float32 exactness.
4. Why did compression give only latency?
A -fold code-payload reduction need not reduce end-to-end latency by the same factor: table work, coarse routing, selection, arithmetic and random accesses remain. The example's PQ8 table is float32; a PQ4 fast-scan LUT is bytes only after byte quantization, with its own precision and accumulation issues. The scalar-to-vector count ratio is not a speedup prediction. The source's reported four-to-sixfold kernel result must be kept tied to its own baseline and measurement.
5. Did a smaller index solve fleet memory?
No. Adding float16 refinement changes to , about a -fold reduction against the scoped HNSW baseline, and is not exact relative to original float32. Retaining float32 instead gives and only about a -fold byte reduction. Rebuild and replica multipliers apply to the structures actually copied; shared payload and a separate builder have their own physical footprints. Report peak fleet capacity by RAM/SSD tier and verify representative RSS, working sets and fetch latency.
Key numbers
| Group | Numbers to retain |
|---|---|
| PQ | , -fold code reduction, labels, book; illustrative ADC break-even |
| Flat comparison | codebook; heuristic training vectors; matched-book ratio |
| Residual | scoped index, -fold reduction; conditional -bit gain; nominal build MACs; count crossover |
| Residual table | at cells; at for PQ64; combined small index |
| Scalar | SQ8 , modeled raw-dot deviation , read floor , calibration |
| Binary | ; independent-hyperplane local cosine deviation at cosine ; code-read floor; independent-local-score flip surrogate, not a universal rate |
| Binary rescore | vectors, useful data; seven ideal waves at concurrency , , of read floor; aligned records may read |
| Fast scan | PQ8 float32 LUT; PQ4 float32 or byte LUT; -code block; unlike-count ratio is not speedup; source reports to times |
| HNSW | at ; vector-plus-slot budget at points, not full RSS |
| IVF | flat; PQ96; with float16 candidate refine, not original-float32 exactness |
| Fleet | Six index copies: HNSW versus IVF-PQ96; logical shared payload and other physical terms separate |
| Growth | ; scoped -fold capacity gain corresponds to about months at constant monthly growth |
| PQ rate defaults | One bit per dimension at ; at ; these are code rates, not quality guarantees |
| PQ divisors at | , , , , , are listed valid choices, not all divisors |
| PQ training heuristic | sample vectors per subspace at , reusing samples; a warning heuristic, not a mathematical floor |
| PQ query table | float32 entries, ; nominal MACs or , plus remaining terms |
| PQ -code scan | of codes, excluding tables, IDs and selection state |
| PQ32 | codes at points; -fold payload reduction; labels |
| Classic case | -bit codes and book at |
| Classic flat comparison | , or decimal zettabytes |
| IVF4096,PQ64 entries | per code-plus-ID entry and at points |
| IVF4096,PQ64 fixed terms | centroids and book, before list/runtime overhead |
| Raw PQ table share | unlike-count ratio; nominal MAC FLOPs give ; neither is measured latency |
| Residual build-to-scan ratio | MAC/addition count ratio; nominal dot-work FLOP ratio |
| Residual high-rate increase | bit-gain estimate under equal-prefactor high-rate assumptions, not a floor |
| FAISS list range at | Heuristic to to ; tune integer list count and recall |
| Residual warning threshold | is a source workflow heuristic; measure total distortion and query cost |
| Large-list fixed probe | scan additions; build/scan count ratio , nominal FLOP ratio |
| Large-list restored probe | restores balanced scanned fraction, not guaranteed recall; naive build nominal MACs |
| Isotropic component scale | for isotropic unit-vector RMS, not every coordinate value |
| SQ8 calibrated step | ; half-step error bound excludes clipped outliers |
| SQ8 pairwise difference noise | under independence; gap is such deviations; unclipped raw-dot worst-case pair bound |
| float16 relative bound | under nearest rounding in the finite normal range; subnormals/overflow separate |
| Naive one-bit scalar | from a uniform-bin extrapolation, not an established cosine-score deviation |
| Binary Hamming mean | at cosine , independent planes |
| Binary Hamming deviation | under the binomial model |
| Binary angle deviation | ; cosine delta approximation |
| Binary pairwise deviation | only under equal local variance and independent score errors; shared planes introduce covariance |
| Binary compression comparison | Eightfold smaller code payload than SQ8; about times the local modeled deviation at cosine |
| Fast-scan candidate set | Mean list , mean candidates at representative cells; planning count , not an exact per-query total |
| Fast-scan code traffic | for planned -byte codes, before list-tail padding |
| PQ8 operation count | nominal scalar logical operations per code; total, not CPU micro-operations or cycles |
| PQ4 operation count | assumed vector instructions for packed-run blocks; actual list padding and kernel may differ |
| PQ4 table-build equivalent | candidates under a heterogeneous count proxy, of mean count, not a latency share |
| Selection traffic | scores; write plus reread, of code bytes if materialized, not necessarily transferred or a latency penalty |
| GPU report | Source reports -fold prior-baseline speedup and a billion-vector graph in under hours on four Maxwell Titan X GPUs; not a prediction for this workload |
| Large fast-scan precompute | PQ8 cell table , times the code array; PQ4 setting instead |
| Index fixed terms | At : coarse centroids and PQ book |
| Unit warning | ; ; compare percentages using an explicit denominator |
| Refine knob comparison | saves of codes at points; float16 refine alone is , original float32 |
| Billion-point resident constraint | before fixed terms; -byte codes plus eight-byte IDs are , one option rather than a required code length |
00-START-HERE · 01-READING-ROUTES · 15_approximate_nearest_neighbor_search · 17_operating_a_vector_store