arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2406.05085cs.CLcs.AIcs.IR
收藏

多头RAG:利用LLMs解决多方面问题

Multi-Head RAG: Solving Multi-Aspect Problems with LLMs

Department of Computer Science, ETH Zurich(苏黎世联邦理工学院计算机科学系);IDEAS Research Institute(IDEAS研究 institute);NASK National Research Institute(国家研究 institute)
Maciej Besta, Ales Kubicek, Robert Gerstenberger, Marcin Chrapek, Roman Niggli, Patrik Okanovic, Yi Zhu, Patrick Iff, Michal Podstawski, Lucas Weitzendorf, Ming… 展开作者

Maciej Besta, Ales Kubicek, Robert Gerstenberger, Marcin Chrapek, Roman Niggli, Patrik Okanovic, Yi Zhu, Patrick Iff, Michal Podstawski, Lucas Weitzendorf, Mingyuan Chi, Joanna Gajda, Piotr Nyczyk, Jürgen Müller, Hubert Niewiadomski, Torsten Hoefler

AI总结:

多头RAG通过利用Transformer多头注意力机制提升多方面查询的检索准确性,实现更高的检索成功率和下游生成性能。

摘要:

检索增强生成(RAG)通过将支持文档纳入提示来提升大语言模型(LLMs),但现有方法并未明确针对需要检索多个内容差异显著的文档的查询。此类多方面查询具有挑战性,因为相关文档可能在嵌入空间中距离很远,使联合检索困难。我们引入了多头RAG(MRAG),通过使用Transformer多头注意力激活而非标准解码器层嵌入作为检索键,解决了这一差距。它利用观察到不同头捕捉不同的语义方面。这为文档和查询生成多方面嵌入,提高了复杂查询的检索准确性。我们展示了MRAG在18个RAG基线中的设计优势,对于实际应用场景,检索成功率可提高高达20%,并且下游LLM生成也有所提升。MRAG可以无缝集成到现有RAG框架和基准中。

英文摘要:

Retrieval-Augmented Generation (RAG) improves Large Language Models (LLMs) by retrieving supporting documents into the prompt, but existing methods do not explicitly target queries that require fetching multiple documents with substantially different content. Such multi-aspect queries are challenging because relevant documents can be far apart in embedding space, making joint retrieval difficult. We introduce Multi-Head RAG (MRAG), which addresses this gap with a simple yet powerful idea: using Transformer multi-head attention activations rather than the standard decoder-layer embedding, as retrieval keys. It leverages the observation that different heads capture different semantic aspects. This yields multi-aspect embeddings for both documents and queries, improving retrieval accuracy on complex queries. We show MRAG's design advantages over 18 RAG baselines, up to 20% higher retrieval success ratios for real-world use cases, and improved downstream LLM generation. MRAG integrates seamlessly with existing RAG frameworks and benchmarks.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑