Papers
Topics
Authors
Recent
Gemini 2.5 Flash
Gemini 2.5 Flash
51 tokens/sec
GPT-4o
60 tokens/sec
Gemini 2.5 Pro Pro
44 tokens/sec
o3 Pro
8 tokens/sec
GPT-4.1 Pro
50 tokens/sec
DeepSeek R1 via Azure Pro
28 tokens/sec
2000 character limit reached

Multi-Head RAG: Solving Multi-Aspect Problems with LLMs (2406.05085v2)

Published 7 Jun 2024 in cs.CL, cs.AI, and cs.IR

Abstract: Retrieval Augmented Generation (RAG) enhances the abilities of LLMs by enabling the retrieval of documents into the LLM context to provide more accurate and relevant responses. Existing RAG solutions do not focus on queries that may require fetching multiple documents with substantially different contents. Such queries occur frequently, but are challenging because the embeddings of these documents may be distant in the embedding space, making it hard to retrieve them all. This paper introduces Multi-Head RAG (MRAG), a novel scheme designed to address this gap with a simple yet powerful idea: leveraging activations of Transformer's multi-head attention layer, instead of the decoder layer, as keys for fetching multi-aspect documents. The driving motivation is that different attention heads can learn to capture different data aspects. Harnessing the corresponding activations results in embeddings that represent various facets of data items and queries, improving the retrieval accuracy for complex queries. We provide an evaluation methodology and metrics, multi-aspect datasets that we release online, and real-world use cases to demonstrate MRAG's effectiveness, showing improvements of up to 20% in relevance over standard RAG baselines. MRAG can be seamlessly integrated with existing RAG frameworks and benchmarking tools like RAGAS as well as different classes of data stores.

User Edit Pencil Streamline Icon: https://streamlinehq.com
Authors (14)
  1. Maciej Besta (66 papers)
  2. Ales Kubicek (9 papers)
  3. Roman Niggli (1 paper)
  4. Robert Gerstenberger (12 papers)
  5. Lucas Weitzendorf (2 papers)
  6. Mingyuan Chi (4 papers)
  7. Patrick Iff (16 papers)
  8. Joanna Gajda (2 papers)
  9. Piotr Nyczyk (7 papers)
  10. Jürgen Müller (40 papers)
  11. Hubert Niewiadomski (9 papers)
  12. Marcin Chrapek (8 papers)
  13. Torsten Hoefler (203 papers)
  14. Michał Podstawski (3 papers)
Citations (5)