Skip to content

Matryoshka Hash Representations for Model-Aware Compact Semantic Retrieval

Sep 2026 · 1 citation · 54 references
Computer Science

TL;DR

This work introduces Matryoshka Hash Representations (MHR), a two-stage procedure that separates full-width training from prefix organization and strengthens two common pipelines: shortlisting candidates for full-precision reranking, and pruning a low-storage graph index such as LEANN.

Abstract

Retrieval-augmented generation (RAG) depends on dense retrieval: each document is stored as a learned vector, and queries are answered by nearest-neighbor search. Keeping one full-precision vector per document dominates index cost at corpus scale, so systems replace each vector with a short code of a few bytes (quantization). Standard quantizers such as product quantization (PQ) pick the code that best reconstructs the original vector, but reconstruction is only a proxy for retrieval: at a few bytes per document, a model-aware code trained on the retriever's ranking signal uses the budget better. A single code is even more useful if its short prefixes are each directly searchable, letting a deployment 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. Binary codes sharpen the conflict, since a gradient step either flips a stored bit or leaves it unchanged. 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 zero-initialized residual code adaptors for directly searchable prefixes. Documents are stored at one bit per coordinate, queries keep continuous logits as in PQ, and search runs on FAISS FastScan. Trained on MS MARCO and zero-shot transferred to seven BEIR datasets, one MHR code reaches 0.502 NDCG@10 at 16 bytes and 0.556 at 32 bytes, against 0.404 and 0.524 for the best compact baselines; the gains hold across training seeds, on all 13 public BEIR datasets, and against off-the-shelf binary Matryoshka embeddings with stronger backbones. The same code also helps shortlist candidates for reranking and prune low-storage graph indexes such as LEANN.

View source

Similar papers

#machine learning Preprint Sep 2026

Spruce: Scalable Private Outsourced Retrieval Using Compact Embeddings

Spruce learns compact binary codes that preserve candidates for full-precision reranking, replacing corpus-wide embedding scoring with efficient Hamming-distance computation under two-server multi-party computation under two-server multi-party computation (MPC).

Pei-Chun Hua, Yun-Ming Xiao · 4 citations
Preprint Aug 2026

AdaWidth: Query-Adaptive Embedding Width for Dense Retrieval

AdaWidth is introduced, which adapts the number of evaluated dimensions to each query within a shared prefix representation, and derives a prefix sufficiency analysis showing that the required number of dimensions is set by the competing documents at the retrieval cutoff.

Shu-Bing Yang, Dongfang Zhao · 0 citations
#machine learning Preprint Aug 2026

RSLM: Training-Free Vector Quantization for Approximate Nearest Neighbor Search

By introducing RSLM (Rotated Scaled Lloyd-Max), a family of training-free vector quantization codecs compressing embeddings to 1--4 bits per dimension, this work reduces memory cost and memory bandwidth of a typical large-scale Approximate Nearest Neighbor (ANN) search system, while reducing its complexity and keeping...

Rastislav Lenhardt, Teodora Dobos, Thomas Vecchiato et al. · 0 citations
Book Open access Aug 2026

FLASH: Fast Generative Retrieval via Autoregressive Semantic Hashing with Provably Distance Bounds

Retrieval-Augmented Generation (RAG) relies critically on the effectiveness of its retrieval component. Dense retrieval with Approximate Nearest Neighbor (ANN) search is efficient but relies on symmetric similarity metrics that can limit the modeling of directional relevance. Generative retrieval addresses this limitat...

Yifei Zhang, Hao Zhu, Haoran Shi et al. · 0 citations
#machine learning Preprint Aug 2026

Self-Indexing Attention for Compression-Compatible Sparse Long-Context LLM Inference

Self-Indexing Attention is proposed, a training-free framework built on a shared transform-domain sign-magnitude representation that provides a reusable token-level index for grouped prefill selection and decode retrieval, while the same representation remains compatible with external KV-cache compression without separ...

Xu Yang, Jia-Peng Zhang, Yu-Xi Chen et al. · 0 citations

Related blog posts

MIT News · Artificial Intelligence Sep 29, 2026

Who we become when we talk to machines

Professor Sherry Turkle’s new book, “Artificial Intimacy,” offers a withering critique of chatbots and the antisocial dynamics she believes they encourage.

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.