arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2412.06078cs.IRcs.LG
收藏

Mixture-of-PageRanks:用实时稀疏GraphRAG替代长上下文

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

Zyphra(齐法拉科技)

Nicholas Alonso, Beren Millidge

AI总结:

针对长上下文大语言模型推理成本高、现有RAG方法效率低且任务场景有限的问题,提出基于稀疏矩阵实现的混合PageRank图检索算法MixPR,在多项长上下文基准上取得SOTA,且CPU即可秒级处理百万token。

摘要:

前沿大语言模型(LLM)的上下文窗口已从数千token大幅扩展至数百万token,足以容纳整本书和整个代码库,但长上下文LLM的推理计算成本极高,在实际应用中往往难以承受。检索增强生成(RAG)提供了一种高效实用的替代方案:仅检索和处理当前任务最重要的上下段子集。尽管前景良好,近期将RAG应用于长上下文任务的研究存在两大核心局限:一是很少关注提升RAG流水线的计算效率,二是这类研究仅在简单问答任务上测试,其在更具挑战性任务上的性能尚不明确。针对上述问题,我们基于图检索算法PageRank开发了名为mixture-of-PageRanks(MixPR,混合PageRank)的算法。MixPR采用多种基于PageRank的图检索算法混合架构,通过稀疏矩阵实现,检索高效低成本,可应对各类复杂任务。我们的MixPR检索器在广泛的长上下文基准任务上取得了当前最优结果,性能超越现有RAG方法、专用检索架构以及长上下文LLM,且计算效率远高于这些方法。由于采用稀疏嵌入,该检索器计算效率极高,能在数秒内完成数百万token的嵌入和检索,且完全可在CPU上运行。

英文摘要:

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.

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

↑