Hierarchical Retrieval at Scale: Bridging Transparency and Efficiency

Shubham Gupta, Zichao Li, Tianyi Chen, Cem Subakan, Siva Reddy, Perouz Taslakian, Valentina Zantedeschi

TL;DR

ReTreever is a novel tree-based retrieval framework that learns to organize data into a hierarchy optimized directly for search performance. By replacing expensive LLM-based node summarization with efficient, learnable embedding routers, it achieves a 160x speedup over existing hierarchical methods while providing human-readable transparency and flexible coarse-to-fine search capabilities.

What Problem Does This Paper Address?

Modern AI systems, especially those using Retrieval-Augmented Generation (RAG), rely on dense retrieval: turning documents and queries into high-dimensional vectors and finding the closest matches. While effective, this approach has two major drawbacks:

  1. Efficiency: High-dimensional embeddings are memory-intensive and computationally expensive to search at scale.
  2. Transparency: The vector space is a "black box." There is no inherent structure to help humans understand why a document was retrieved or how the corpus is organized.

Existing "hierarchical" retrievers try to solve this by building trees of data, but they often rely on Large Language Models (LLMs) to summarize nodes during construction and navigation. This makes them prohibitively slow and expensive for large-scale production use. ReTreever aims to bridge this gap, providing the interpretability of a tree with the speed of standard vector search.

Methods

ReTreever consists of a frozen bi-encoder (like BERT for text or DINOv2 for images) and a learnable binary tree that acts as a router.

  • Differentiable Routing: Instead of hard "left or right" decisions that break gradient descent, ReTreever uses probabilistic relaxations. Each internal node contains a "split function" that outputs a soft routing score.
  • Cross-Attention Splits: While simple linear projections work, the authors found that using a cross-attention mechanism—where learnable node embeddings "query" the input tokens—yielded the best performance.
  • End-to-End Optimization: The tree structure is trained using a contrastive InfoNCE loss. It learns to route positive query-document pairs to the same leaf nodes while pushing unrelated pairs apart.
  • Stochastic Depth Training: To ensure the tree is useful at every level, the model is trained by randomly sampling different tree depths. This allows a single model to support "coarse" searches (using just the top levels of the tree for speed) and "fine" searches (using the full tree for accuracy).
ReTreever architecture showing the flow from bi-encoder to the tree organizer and the resulting leaf assignments.

Datasets

The authors demonstrated ReTreever's versatility across three modalities:

  • Text: Natural Questions (NQ), HotpotQA, TopiOCQA, and RepLiQA.
  • Images: ImageNet-1K (for image-to-image retrieval).
  • Audio: VoxCeleb2 (for speaker retrieval).

Key Insights and Ideas

  • Emergent Semantic Structure: A key "aha moment" is that optimizing purely for retrieval performance naturally induces a semantically coherent hierarchy. Even without an explicit clustering objective, the tree groups documents by topic (e.g., Science → Biology → Health → HIV).
  • Modality Agnosticism: Because ReTreever operates on embeddings, it isn't tied to text. The same architecture successfully organized ImageNet photos by visual similarity (e.g., grouping objects with similar textures or silhouettes before refining them into specific classes).
  • The Latency-Accuracy Trade-off: ReTreever allows for "Matryoshka-style" flexibility. Users can cut inference costs by 75% by using coarser representations while still retaining roughly 95% of peak retrieval accuracy.

Key Results

ReTreever strikes a dominant balance between speed and performance compared to other hierarchical methods:

  • Speed: It is approximately 160x faster than Raptor (a leading hierarchical retriever) because it eliminates LLM calls during inference.
  • Accuracy: On the NQ dataset, ReTreever achieved an nDCG@10 of 54.48%, significantly outperforming both standard encoders and other tree-based baselines like Hier-Kmeans.
Table comparing latency and nDCG@10 across text datasets, showing ReTreever's superior trade-off.

As shown in the representation size analysis, ReTreever (Stochastic) consistently delivers the strongest performance at lower dimensions across all tested modalities.

Graphs showing nDCG@10 vs representation size for NQ, ImageNet, and VoxCeleb2.

Limitations and Future Work

  • Static Hierarchy: Currently, ReTreever learns a single hierarchy per dataset. The authors note that extending this to support incremental updates for evolving corpora is a necessary next step.
  • Fixed Architecture: The tree uses a fixed depth and width. Future iterations might explore learning variable-depth trees to allocate more computational "capacity" to complex parts of the data distribution.
  • Training Cost: While inference is fast, training the hierarchical router adds overhead compared to simple flat fine-tuning.

Summary updated

BibTeX
@inproceedings{gupta2026hierarchical,
  author = {Shubham Gupta and Zichao Li and Tianyi Chen and Cem Subakan and Siva Reddy and Perouz Taslakian and Valentina Zantedeschi},
  title = {{Hierarchical Retrieval at Scale: Bridging Transparency and Efficiency}},
  booktitle = {International Conference on Machine Learning},
  year = {2026},
  url = {https://openreview.net/forum?id=mydeyPBS0K},
}
Figure