优化LLM让文档重排实时可用,速度提升166倍
LLM Optimization Unlocks Real-Time Pairwise Reranking
- 用小模型、低精度、限制输出等方法优化重排流程
- 每查询延迟从61.36秒降至0.37秒,召回率几乎不变
- 适合需要低延迟的线上检索增强生成系统
在信息检索管道中高效重排召回文档以提升检索增强生成(RAG)系统整体质量,仍是重要且具挑战性的问题。近期研究强调大型语言模型(LLM)在重排任务中的作用,尤其是成对重排提示(Pairwise Reranking Prompting, PRP)因其易用性和有效性成为有前景的即插即用方案。然而,该算法固有的复杂性以及LLM带来的高计算开销和延迟,使其在实时应用中面临可行性担忧。本文聚焦于成对重排,证明通过精心设计的优化方法可显著缓解上述问题。采用这些优化后,单次查询延迟从61.36秒降低至0.37秒,降幅达166倍,同时在Recall@k指标上性能损失极小。本研究揭示了以往被忽视的设计选择的重要性,包括使用小型模型、限制重排集合规模、采用低精度计算、通过单向顺序推断减少位置偏差、控制输出词元数量。这些优化使基于LLM的重排在延迟敏感的真实场景中变得切实可行。
原文摘要 · Abstract (English)
Efficiently reranking documents retrieved from information retrieval (IR) pipelines to enhance overall quality of Retrieval-Augmented Generation (RAG) system remains an important yet challenging problem. Recent studies have highlighted the importance of Large Language Models (LLMs) in reranking tasks. In particular, Pairwise Reranking Prompting (PRP) has emerged as a promising plug-and-play approach due to its usability and effectiveness. However, the inherent complexity of the algorithm, coupled with the high computational demands and latency incurred due to LLMs, raises concerns about its feasibility in real-time applications. To address these challenges, this paper presents a focused study on pairwise reranking, demonstrating that carefully applied optimization methods can significantly mitigate these issues. By implementing these methods, we achieve a remarkable latency reduction of up to 166 times, from 61.36 seconds to 0.37 seconds per query, with an insignificant drop in performance measured by Recall@k. Our study highlights the importance of design choices that were previously overlooked, such as using smaller models, limiting the reranked set, using lower precision, reducing positional bias with one-directional order inference, and restricting output tokens. These optimizations make LLM-based reranking substantially more efficient and feasible for latency-sensitive, real-world deployments.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。