MacRAG:面向多尺度自适应上下文RAG的压缩、切片与扩展
MacRAG: Compress, Slice, and Scale-up for Multi-Scale Adaptive Context RAG
AI总结:
针对现有RAG系统检索不准、上下文覆盖不全等问题,提出分层框架MacRAG,通过粗细粒度划分与自适应扩展构建查询专属上下文,在多基准测试中优于基线,为长上下文多跳推理提供高效可扩展方案。
摘要:
长上下文大语言模型(LC LLMs)结合检索增强生成(RAG)在复杂多跳和大文档任务中具有巨大潜力。然而,现有RAG系统常存在检索不精准、受限窗口下上下文覆盖不完整,以及因上下文构建不佳导致的信息碎片化问题。我们提出多尺度自适应上下文RAG(MacRAG),这是一种分层RAG框架,将文档压缩并划分为从粗到细的粒度,再通过实时的块级和文档级扩展自适应合并相关上下文。通过从最细粒度检索启动,逐步纳入更广泛、更高层级的上下文,MacRAG构建了有效的查询专属长上下文,同时优化了精准度和覆盖度。在HotpotQA、2WikiMultihopQA和Musique的挑战性LongBench扩展集上的评估证实,使用Llama-3.1-8B、Gemini-1.5-pro和GPT-4o时,MacRAG在单步和多步生成中始终优于基线RAG流水线。我们的结果表明MacRAG是适用于现实世界长上下文、多跳推理的高效可扩展解决方案。代码可在https://github.com/Leezekun/MacRAG获取。
英文摘要:
Long-context large language models (LC LLMs) combined with retrieval-augmented generation (RAG) hold strong potential for complex multi-hop and large-document tasks. However, existing RAG systems often suffer from imprecise retrieval, incomplete context coverage under constrained windows, and fragmented information from suboptimal context construction. We introduce Multi-scale Adaptive Context RAG (MacRAG), a hierarchical RAG framework that compresses and partitions documents into coarse-to-fine granularities, then adaptively merges relevant contexts through real-time chunk- and document-level expansions. By initiating with finest-level retrieval and progressively incorporating broader, higher-level context, MacRAG constructs effective query-specific long contexts, optimizing both precision and coverage. Evaluations on challenging LongBench expansions of HotpotQA, 2WikiMultihopQA, and Musique confirm MacRAG consistently surpasses baseline RAG pipelines in single- and multi-step generation using Llama-3.1-8B, Gemini-1.5-pro, and GPT-4o. Our results establish MacRAG as an efficient, scalable solution for real-world long-context, multi-hop reasoning. Our code is available at https://github.com/Leezekun/MacRAG.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。