Manuscript Offprint

arXiv:2610.01767

A Matryoshka Hierarchical RAG for Efficient Multi-Hop Question Answering

Gianluca Bonifazi, Christopher Buratti, Michele Marchetti, Federica Parlapiano, Giulia Quaglieri, Davide Traini, Domenico Ursino, Luca Virgili

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Retrieval-Augmented Generation (RAG) systems for multi-hop Question Answering (QA) must balance retrieval quality with computational cost. This cost is incurred during indexing time, through the use of expensive Knowledge Graphs (KGs) or Large Language Models (LLMs) to generate summaries, or during querying, through iterative LLM-driven retrieval. To reduce it while maintaining retrieval quality, we present MatRAG, a hierarchical framework that combines RAG systems with Matryoshka Representation Learning (MRL). MatRAG addresses both kinds of cost by aligning the semantic hierarchy of a clustering structure with the nested structure of MRL. Specifically, it organizes the corpus of documents into a Directed Acyclic Graph (DAG) of clusters with progressively coarser granularity. Each level is indexed by a lower Matryoshka dimension. MatRAG pairs an iterative, top-down traversal of the DAG with an entity-driven mechanism that controls the hop budget and re-ranks candidates. We evaluated MatRAG on three standard multi-hop QA benchmarks against seven representative baselines. MatRAG outperforms its strongest competitors in terms of retrieval quality; furthermore, it reduces indexing costs by avoiding KG construction and LLM-based summarization, and lowers query-time costs through dimension-aware similarity.

∗^{*}Corresponding author

Email addresses: g.bonifazi@univpm.it (Gianluca Bonifazi),

c.buratti@pm.univpm.it (Christopher Buratti), michele.marchetti@univpm.it (Michele Marchetti), f.parlapiano@pm.univpm.it (Federica Parlapiano),

g.quaglieri@pm.univpm.it (Giulia Quaglieri), davide.traini@unimore.it (Davide Traini), d.ursino@univpm.it (Domenico Ursino), luca.virgili@univpm.it (Luca Virgili)

Keywords: Retrieval-Augmented Generation, Multi-hop Question Answering, Matryoshka Representation Learning, Large Language Models, Efficient Retrieval

1. Introduction

Retrieval-Augmented Generation (RAG) systems have become the dominant paradigm for grounding LLMs responses in external knowledge bases and reducing hallucinations [24, 37].

A significant challenge in RAG is multi-hop Question Answering (QA), where the correct answer requires aggregating information dispersed across several documents linked by entities or relationships [33]. A dense similarity between a query and a single document cannot capture chains of reasoning that span multiple documents, and flat indices do not exploit the hierarchical semantic structure of the corpus [5]. Recent literature has proposed two families of solutions to this problem. Graph-based approaches [21] construct an explicit Knowledge Graph (KG) of entities and relationships offline and explore it at query time via traversal [39], Personalized PageRank [8], or LLM-based agents [32, 14]. Hierarchical approaches organize the corpus into a multi-level index, enabling retrieval at multiple granularities [34, 30]. However, both families incur significant computational costs that limit their scalability. Specifically, graph-based approaches incur offline costs through entity linking and relationship extraction, while hierarchical approaches incur offline costs through recursive LLM calls to summarize internal nodes [30]. Additionally, both families incur online costs through iterative LLM-driven planning [13] and expensive KG traversals [32].

We argue that these limitations could be overcome by using the nested representations provided by Matryoshka Representation Learning (MRL) [15]. MRL produces embeddings whose low-dimensional prefixes retain useful information. This allows us to obtain representations of different dimensionalities from a single embedding. We hypothesize that this property can be exploited in a hierarchical clustering structure, where progressively coarser levels require less fine-grained representations. Thus, the upper levels of the hierarchy can be indexed using shorter Matryoshka prefixes while retaining the full embedding dimension for individual documents.

Starting from this intuition, in this paper we present MatRAG, a Matryoshka-indexed, hierarchical RAG framework designed for multi-hop QA. MatRAG encodes each document offline by using a Matryoshka embedding and builds a hierarchical index through density-based clustering. This index is structured as a Directed Acyclic Graph (DAG). The leaves of the DAG store full-dimensional document embeddings, while the internal nodes store centroids at progressively lower Matryoshka dimensions towards the coarser levels. When a query is received, retrieval proceeds via a top-down traversal of the DAG. During this process, the query embedding is truncated to the dimension of the level being explored. This reduces the cost of similarity computations at the coarser levels. An entity-aware iterative mechanism controls how many documents are collected at each hop and how candidate documents are re-ranked. This replaces the iterative LLM calls of plan-then-retrieve approaches with a lightweight signal based on the entities found in the query and in the already retrieved context.

We evaluated MatRAG against seven representative RAG baselines on three multi-hop QA benchmarks, namely HotpotQA, 2WikiMultiHopQA, and MuSiQue. Our experimental campaign assessed retrieval effectiveness, answer quality, and computational efficiency. MatRAG achieved the highest Exact Match (EM) and F1 scores across all three benchmarks, while consistently improving Recall@5 over the document-retrieval baselines. Moreover, it reduced the average response time compared to flat FAISS-based retrieval and substantially lowered the indexing costs compared to graph-based and hierarchical approaches.

The main contributions of this paper are:

  • A resolution-aligned indexing strategy that aligns MRL dimensions with index depth. This reduces the cost of query-time similarity at coarser levels while preserving retrieval accuracy.

  • An iterative retrieval mechanism that does not rely on graph-based multi-hop traversal, but rather progressively expands the retrieved context through hierarchical search.

  • An entity-aware re-ranking and drift-control mechanism, which uses entities to prioritize candidate nodes and prevents retrieval drift across iterations.

The rest of this paper is organized as follows: Section 2 reviews related literature. Section 3 introduces MatRAG. Section 4 reports our experimental results. Section 5 discusses findings and limitations. Finally, Section 6 presents our conclusions and outlines directions for future work.

References (44)

  • Hierarchical Density Estimates for Data Clustering, Visualization, and Outlier Detection
  • Cats-RAG: Contextual Augmented Triplet Synthesis for RAG in Technical QA. Expert Systems with Applications, page 131491, 2026
  • A cluster separation measure
  • From Local to Global: A Graph RAG Approach to Query-Focused Summarization
  • A survey on RAG meeting LLMS: Towards retrieval-augmented large language models
  • LightRAG: Simple and Fast Retrieval-Augmented Generation
  • Hipporag: Neurobiologically inspired long-term memory for large language models
  • From RAG to Memory: Non-Parametric Continual Learning for Large Language Models
  • Hierarchical level-wise news article clustering via multilingual Matryoshka embeddings
  • Constructing a multi-hop QA dataset for comprehensive evaluation of reasoning steps
  • Retrieval-Augmented Generation with Hierarchical Knowledge
  • Retrieval-Augmented Generation for Multi-Hop Question Answering Based on Structured Planning
  • Retrieve, summarize, plan: Advancing multi-hop question answering with an iterative approach
  • Graph Chain-of-thought: Augmenting Large Language Models by Reasoning on Graphs
  • Matryoshka Representation Learning
  • Breaking the Static Graph: Context-Aware Traversal for Robust Retrieval-Augmented Generation (opens arXiv in a new tab)
  • Pseudo relevance feedback with deep language models and dense retrievers: Successes and pitfalls
  • MRL-RAG: Enhancing the Accuracy of Retrieval-Augmented Generation via an Optimized Hybrid Query Retriever
  • Enhanced Arabic Retrieval Augmented Generation Using Nested Embedding Models
  • Nomic Embed: Training a Reproducible Long Context Text Embedder
  • Graph retrieval-augmented generation: A survey
  • Dual-granularity chunking and dynamic context augmentation: An optimization method for retrieval-augmented generation
  • Trajectory-Embedded Matryoshka Representation Learning for Enhanced Similarity Analysis
  • Hallucinations in LLMS: Understanding and addressing challenges
  • Measuring and narrowing the compositionality gap in language models
  • Test-time Corpus Feedback: From Retrieval to RAG. In Findings of the Association for Computational Linguistics: European Chapter of the Association for Computational Linguistics (EACL'26), pages 5637–5656, Rabat, Morocco, 2026
  • SG-RAG: Multi-hop question answering with large language models through knowledge graphs
  • Raptor: Recursive abstractive processing for tree-organized retrieval
  • LLM-confidence reranker: a training-free approach for enhancing retrieval-augmented generation systems
  • Think-on-Graph: Deep and Responsible Reasoning of Large Language Model on Knowledge Graph
  • MultiHop-RAG: Benchmarking Retrieval-Augmented Generation for Multi-Hop Queries
  • Treerag: Unleashing the power of hierarchical storage for enhanced knowledge retrieval in long documents
  • From Louvain to Leiden: guaranteeing well-connected communities
  • MuSiQue: Multihop Questions via Single-hop Question Composition
  • SageRAG: Query Rewriting for Retrieval Enhancement and Retrieval-Augmented Generation for Grounded Responses in AI Research Assistance
  • Archrag: Attributed community-based hierarchical retrieval-augmented generation
  • Knowledge graph prompting for multi-document question answering
  • HotpotQA: A dataset for diverse, explainable multihop question answering
  • GLiNER: Generalist Model for Named Entity Recognition using Bidirectional Transformer
  • SiReRAG: Indexing Similar and Related Information for Multihop Reasoning
  • A Dense Retrieval Model Training Method Combining Matryoshka Representation Learning and Knowledge Distillation
  • TreeQA: Enhanced LLM-RAG with logic tree reasoning for reliable and interpretable multi-hop question answering
  • Knowledge Graph-Guided Retrieval Augmented Generation
  • Query-drift prevention for robust query expansion