Full-Precision Rescoring

The second step of a quantized vector search: find candidates using compressed vectors, then re-rank those candidates by their exact distances against the full-precision vectors. Quantization makes the first pass cheap enough to fit in memory; rescoring buys back the ordering errors that rough distances introduce.


How it works

  1. Candidate search on quantized vectors — an HNSW graph or IVF-style cluster scan over 1-bit, 2-bit, 4-bit or int8 vectors, returning more candidates than the final k.
  2. Exact rescoring — each candidate is scored against its full-precision vector and the top k returned.

The full vectors do not need to be in memory. In Hornet’s design they live on local NVMe: the graph search follows links step by step and must stay in RAM, but rescoring reads all top-K full vectors together once the candidates are known — small random reads that SSDs handle well and that cost less than memory. At top-K ≈1,000 on 1B 2-bit vectors, that is about 25,000 in-memory distance computations plus about 1,000 disk reads.

The levers

  • Candidate count (top-K, ef, oversampling factor): more candidates give more recall for more CPU and disk reads, not more memory. Elasticsearch’s BBQ uses num_candidates well above k for the same reason.
  • Bits per dimension: fewer bits mean rougher distances and more reliance on rescoring. On Hornet’s data, 2-bit vectors needed rescoring to reach 95% recall.
  • Pruning layers before rescoring: ParadeDB stacks a cluster scan and two 1-bit quantized layers (the second on the first layer’s error) so that, on MS MARCO’s 113M vectors, only a few hundred candidates reach full-precision scoring.
  • Distributed merge: across shards, a global merge can keep only the best candidates from all machines and send those back for rescoring — in Hornet’s illustration, 2,000 of 10,000, about 200 per machine instead of 1,000.

The limit

Rescoring only reorders what the first pass found. A true neighbor the quantized search never reached as a candidate — or one a distributed merge dropped — cannot be recovered. That is why the recall ceiling (the recall of an exact scan over the quantized vectors, with no rescoring) matters as a separate measurement from post-rescoring recall.

Topics