Skip to content

Experiment/spacing rescoring adaptive - #1

Merged
SwineCoder101 merged 4 commits into
mainfrom
experiment/spacing-rescoring-adaptive
Nov 4, 2026
Merged

SwineCoder101 merged 4 commits into
mainfrom
experiment/spacing-rescoring-adaptive

Conversation

@SwineCoder101

Copy link
Copy Markdown
Owner

No description provided.

Codec gains prepare_query and score_prepared, so a codec that works in a
transformed space rotates the query once per search instead of once per
stored vector. Defaults are the identity and score(); TruncateCodec
forwards to its inner codec; the store's search uses the prepared path.

mixed<B>[-pca][-w] spends a fixed B-byte budget per vector with bits
allocated per dimension by greedy reverse water-filling, each dimension
quantized with Max's Gaussian-optimal uniform step. -pca rotates into the
corpus's principal components first (Jacobi eigensolver, fitted on up to
20k vectors); -w allocates by variance times query energy, which targets
score error rather than reconstruction error.
bench recall reports three new numbers: boundary_gap (exact score gap
between rank k and k+1), neighbour_band (rank k to 2k) and rank_noise
(the codec's score-error spread over the exact top 2k, per-query bias
removed).

bench rescore scans with one codec and re-scores candidates with another
(int8 or f32) under three policies: none, a fixed depth, or an adaptive
margin that re-scores every candidate within N calibrated noise units of
the k-th first-stage score. Noise is calibrated on self-queries only.
Reports recall, worst-decile recall, nDCG, mean and p90 depth, bytes read
per query, and the exact depth an f32 re-score needs for 90/95/99/100%
recall. Query loading is shared with bench recall.
…oring

Neighbour spacing: SciFact, NFCorpus, ArguAna, FiQA and CoSQA (code, via
CoIR) on bge-small and MiniLM, nine codecs. Codec noise over the corpus's
neighbour band ranks recall@10 loss with Spearman 0.98 over 90 points,
against 0.64 for noise alone, and predicts a held-out corpus within 0.024.
Content type matters only through spacing; the embedding model moves it
as much as the corpus does. Write-up, site page and blog post.

Two-stage rescoring: the same collections, five first stages, int8 and
f32 second stages. The ratio predicts the depth needed (rho about 0.93;
depth/k = 4.8 r^1.29 for 95% recall). At 48 bytes, 50 f32 candidates
recover 0.95 (binary) to 0.99 (pq48) of the top 10 for 3-4% of an f32
scan's bytes.

Roadmap: results and follow-ups, and a section on MoE compression work
(QuantMoE-Bench, MoE-SVD, Sub-MoE) mapped onto hvec codecs. References:
the five datasets, QuantMoE-Bench, Sub-MoE, Max 1960, Huang-Schultheiss.
Scan codecs (uniform binary/pq against adaptive mixed<B> bit allocation at 24, 48 and 96 bytes) crossed with re-score policies (none, fixed depth, adaptive margin) and int8/f32 second stages. Results and write-up follow when the run completes.
@SwineCoder101
SwineCoder101 merged commit cb08646 into main Nov 4, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant