arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2410.04343cs.CL
收藏

长上下文检索增强生成的推理缩放

Inference Scaling for Long-Context Retrieval Augmented Generation

University of Illinois Urbana-Champaign(伊利诺伊大学厄巴纳-香槟分校);Google DeepMind(谷歌DeepMind);University of Massachusetts Amherst(马萨诸塞大学阿默斯特分校)

Zhenrui Yue, Honglei Zhuang, Aijun Bai, Kai Hui, Rolf Jagerman, Hansi Zeng, Zhen Qin, Dong Wang, Xuanhui Wang, Michael Bendersky

AI总结:

本文研究了长上下文检索增强生成(RAG)的推理缩放,通过结合上下文学习和迭代提示等策略优化测试时计算分配,发现最优配置下计算量增加可带来近乎线性的性能提升,并在基准数据集上实现高达58.9%的增益。

摘要:

推理计算的缩放在多种场景下释放了长上下文大型语言模型(LLMs)的潜力。对于知识密集型任务,增加的计算通常被分配用于引入更多外部知识。然而,如果不能有效利用这些知识,仅仅扩展上下文并不总能提升性能。在本研究中,我们探讨了检索增强生成(RAG)的推理缩放,研究了超越单纯增加知识量的多种策略组合,包括上下文学习和迭代提示。这些策略为缩放测试时计算提供了额外灵活性(例如,通过增加检索文档或生成步骤),从而增强了LLMs有效获取和利用上下文信息的能力。我们解决了两个关键问题:(1) 当优化配置时,RAG性能如何从推理计算的缩放中受益?(2) 我们能否通过建模RAG性能与推理参数之间的关系,预测给定预算下的最优测试时计算分配?我们的观察表明,当推理计算得到最优分配时,增加计算量会使RAG性能获得近乎线性的提升,我们将这一关系描述为RAG的推理缩放定律。在此基础上,我们进一步开发了计算分配模型,以估计不同推理配置下的RAG性能。该模型预测了各种计算约束下的最优推理参数,与实验结果高度吻合。通过应用这些最优配置,我们证明在长上下文LLMs上缩放推理计算,与标准RAG相比,在基准数据集上实现了高达58.9%的性能提升。

英文摘要:

The scaling of inference computation has unlocked the potential of long-context large language models (LLMs) across diverse settings. For knowledge-intensive tasks, the increased compute is often allocated to incorporate more external knowledge. However, without effectively utilizing such knowledge, solely expanding context does not always enhance performance. In this work, we investigate inference scaling for retrieval augmented generation (RAG), exploring the combination of multiple strategies beyond simply increasing the quantity of knowledge, including in-context learning and iterative prompting. These strategies provide additional flexibility to scale test-time computation (e.g., by increasing retrieved documents or generation steps), thereby enhancing LLMs' ability to effectively acquire and utilize contextual information. We address two key questions: (1) How does RAG performance benefit from the scaling of inference computation when optimally configured? (2) Can we predict the optimal test-time compute allocation for a given budget by modeling the relationship between RAG performance and inference parameters? Our observations reveal that increasing inference computation leads to nearly linear gains in RAG performance when optimally allocated, a relationship we describe as the inference scaling laws for RAG. Building on this, we further develop the computation allocation model to estimate RAG performance across different inference configurations. The model predicts optimal inference parameters under various computation constraints, which align closely with the experimental results. By applying these optimal configurations, we demonstrate that scaling inference compute on long-context LLMs achieves up to 58.9% gains on benchmark datasets compared to standard RAG.

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

↑