Expand description
Approximate inner product scoring without full decode.
The FibQuant codebook supports estimating the inner product of a query
vector against a stored FibCodeV1 without running the full decode
pipeline (rotation inverse + norm scaling). The method:
- Normalize the query, apply the same rotation → rotated query blocks.
- For each block, find the nearest codeword index (same as encode).
- Use a precomputed codebook Gram table
G[i,j] = <cw_i, cw_j>to estimate<rotated_query_block, rotated_stored_block>asG[query_idx, stored_idx]. - Sum block-level estimates and scale by the stored norm.
This avoids decoding the stored vector entirely — you only need the
packed indices and the stored norm, both of which are in FibCodeV1.
The estimate is approximate because the stored code uses the quantized codeword, not the original rotated block. The error is bounded by the codebook quantization noise and decreases as codebook size grows.
Structs§
- FibPrepared
Query - Pre-rotated, pre-quantized query for batch scoring.
- FibScorer
- Approximate scorer for FibQuant codes.
- Gram
Table - Precomputed codebook Gram table for approximate inner product scoring.
- Scored
Item - A scored candidate from approximate search.