Matryoshka Hash Representations for Model-Aware Compact Semantic Retrieval
Peichun Hua, Yunming Xiao
Key points
From the paper's conclusion- We introduce Matryoshka Hash Representations (MHR), a two-stage procedure that separates full-width training from prefix organization.
Abstract
Retrieval-augmented generation (RAG) depends on dense retrieval: each document is stored as a learned vector, and a query is answered by finding its nearest neighbors in that vector space. Keeping one full-precision vector per document is the dominant index cost at corpus scale, so retrieval systems replace each vector with a short code of a few bytes---a step called quantization. Standard quantizers such as product quantization (PQ) pick the code that reconstructs the original vector most closely. A single code is even more useful if it serves several byte budgets at once: when its short prefixes are each directly searchable, a deployment can set its efficiency--quality operating point without re-encoding the corpus. But training all prefixes under one objective makes the early bits a compromise across budgets---short codes improve while the full-width code degrades. Quantization to low-bit representation, such as binary codes, further sharpens the conflict. We introduce Matryoshka Hash Representations (MHR), a two-stage procedure that separates full-width training from prefix organization. MHR first learns a longer binary code, then freezes the model and trains additional zero-initialized residual code adaptors for directly searchable prefixes. Documents are stored at one bit per coordinate, while queries keep continuous logits like PQ to attain sufficient expressivity. We implement the search process with FAISS FastScan. Trained on MS MARCO and zero-shot transferred to seven BEIR datasets, MHR reaches .5561 NDCG@10 and .6535 Recall@100 at 32 bytes, surpassing the best baseline of the same budget. The advantage is more pronounced in lower budgets. The same code also strengthens two common pipelines: shortlisting candidates for full-precision reranking, and pruning a low-storage graph index such as LEANN.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- A Matryoshka Hierarchical RAG for Efficient Multi-Hop Question AnsweringarXiv · 2026
- Spatial Matryoshka Training for Multi-Granularity Visual Document RetrievalarXiv · 2026
- MRVQ: One Resident Index for Dimension- and Rate-Elastic Vector SearcharXiv · 2026
- When Does Low-Bit Quantization Preserve the Decisions of Vector Search?arXiv · 2026
- Retrieval Needs Multivectors: An Exponential SeparationarXiv · 2026
- Let the Gate Decide: Per-Lookup Precision for Quantized Conditional Memory in LLMsarXiv · 2026