RetroLM通过关键帧检索提升长文本处理效率,效果优于现有方法。
Does RAG Really Perform Bad For Long-Context Processing?
- 将KV缓存分页并检索关键页,实现高效长上下文处理
- 在LongBench等基准上超越主流长上下文模型,尤其擅长深度推理任务
- 适合需要长文本理解与推理的场景,如文档分析、复杂问答
大语言模型(LLMs)在处理长上下文时面临严重挑战。最近,检索增强生成(RAG)成为一种有前景的解决方案,使模型能选择性利用长上下文以实现高效计算。然而,现有RAG方法因检索不准和上下文碎片化而表现落后。为此,我们提出RetroLM,一种新型RAG框架。不同于传统方法,RetroLM采用基于键值(KV)级别的检索增强,将LLM的KV缓存划分为连续页面,并检索最关键的页面以实现高效计算。该方法增强了对检索误差的鲁棒性,促进了碎片化上下文的有效利用,并避免重复计算开销。在此基础上,我们进一步设计了专用检索器以精准定位关键页面,并通过无监督后训练优化模型对检索信息的利用能力。我们在LongBench、InfiniteBench和RULER等多个基准上进行了全面评估,结果表明RetroLM显著优于现有长上下文LLM及高效处理方法,尤其在需要密集推理或超长上下文理解的任务中表现突出。
原文摘要 · Abstract (English)
The efficient processing of long context poses a serious challenge for large language models (LLMs). Recently, retrieval-augmented generation (RAG) has emerged as a promising strategy for this problem, as it enables LLMs to make selective use of the long context for efficient computation. However, existing RAG approaches lag behind other long-context processing methods due to inherent limitations on inaccurate retrieval and fragmented contexts. To address these challenges, we introduce RetroLM, a novel RAG framework for long-context processing. Unlike traditional methods, RetroLM employs KV-level retrieval augmentation, where it partitions the LLM's KV cache into contiguous pages and retrieves the most crucial ones for efficient computation. This approach enhances robustness to retrieval inaccuracy, facilitates effective utilization of fragmented contexts, and saves the cost from repeated computation. Building on this framework, we further develop a specialized retriever for precise retrieval of critical pages and conduct unsupervised post-training to optimize the model's ability to leverage retrieved information. We conduct comprehensive evaluations with a variety of benchmarks, including LongBench, InfiniteBench, and RULER, where RetroLM significantly outperforms existing long-context LLMs and efficient long-context processing methods, particularly in tasks requiring intensive reasoning or extremely long-context comprehension.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。