arXiv:2412.06078cs.IRcs.LG2024-12被引 4

用稀疏图检索替代长上下文,实现高效精准的文本理解。

Mixture-of-PageRanks: Replacing Long-Context with Real-Time, Sparse GraphRAG

  • 基于PageRank构建混合图检索算法,利用稀疏矩阵提升效率。
  • 百万级文本可在数秒内完成嵌入与检索,性能超越现有方法。
  • 适合资源受限场景,尤其适用于复杂任务的实时推理需求。

前沿大模型的上下文窗口已扩展至数百万词元,可容纳整本书或代码库,但推理计算成本极高。RAG通过仅检索任务相关上下文提供高效替代方案。然而,现有工作在计算效率上关注不足,且仅测试简单问答任务,复杂任务表现不明。为此,我们提出基于PageRank的混合图检索算法(MixPR),采用稀疏矩阵实现高效、低成本的检索,支持多种复杂任务。MixPR在多个长上下文基准测试中达到领先性能,优于现有RAG方法、专用检索架构及长上下文大模型,同时计算开销显著更低。得益于稀疏嵌入,该检索器可在数秒内处理百万级词元,全程仅需CPU运行。

原文摘要 · Abstract (English)

Recent advances have extended the context window of frontier LLMs dramatically, from a few thousand tokens up to millions, enabling entire books and codebases to fit into context. However, the compute costs of inferencing long-context LLMs are massive and often prohibitive in practice. RAG offers an efficient and effective alternative: retrieve and process only the subset of the context most important for the current task. Although promising, recent work applying RAG to long-context tasks has two core limitations: 1) there has been little focus on making the RAG pipeline compute efficient, and 2) such works only test on simple QA tasks, and their performance on more challenging tasks is unclear. To address this, we develop an algorithm based on PageRank, a graph-based retrieval algorithm, which we call mixture-of-PageRanks (MixPR). MixPR uses a mixture of PageRank-based graph-retrieval algorithms implemented using sparse matrices for efficent, cheap retrieval that can deal with a variety of complex tasks. Our MixPR retriever achieves state-of-the-art results across a wide range of long-context benchmark tasks, outperforming both existing RAG methods, specialized retrieval architectures, and long-context LLMs despite being far more compute efficient. Due to using sparse embeddings, our retriever is extremely compute efficient, capable of embedding and retrieving millions of tokens within a few seconds and runs entirely on CPU.

图检索RAG稀疏计算长上下文

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。