不用生成文本,用注意力变化实现高效零样本重排序
Attention in Large Language Models Yields Efficient Zero-Shot Re-Rankers

- 利用查询引发的注意力模式变化直接做重排序
- 仅需两次前向传播,延迟比生成式方法降低60%以上
- 适用于任意开源大模型,特别擅长复杂重排序任务
信息检索系统在现代数字生活中发挥关键作用,并通过检索增强生成技术在生成式AI时代持续展现价值。大型语言模型(LLMs)凭借强大的语言处理能力和广泛适用性,已成为零样本重排序的热门选择。现有基于LLM的重排序方法依赖强生成能力,限制了其使用范围,仅限于特定或高性能专有模型。我们提出疑问:自回归生成是否为LLM进行重排序所必需且最优?我们假设LLM中存在大量与重排序相关的信号,但尚未被生成方式充分挖掘。为此,我们提出上下文重排序(ICR),一种新方法,通过利用搜索查询引起的注意力模式变化实现准确高效的重排序。为缓解LLM固有的偏差,我们采用内容无关查询进行校准。由于无需生成,ICR仅需两次(O(1))前向传播即可对N个文档完成重排序,显著优于至少需要O(N)次前向传播的生成式方法。ICR设计可应用于任意LLM而无需专门训练,且保证输出排名结构合理。在两个主流开源大模型上,针对单跳和多跳信息检索基准的大量实验表明,ICR在性能上超越RankGPT,同时实际延迟降低超过60%。详细分析显示,ICR在需要更复杂重排序信号的任务中表现尤为出色。这些发现呼吁进一步探索开源大模型在文本生成之外的新应用方式。
原文摘要 · Abstract (English)
Information retrieval (IR) systems have played a vital role in modern digital life and have cemented their continued usefulness in this new era of generative AI via retrieval-augmented generation. With strong language processing capabilities and remarkable versatility, large language models (LLMs) have become popular choices for zero-shot re-ranking in IR systems. So far, LLM-based re-ranking methods rely on strong generative capabilities, which restricts their use to either specialized or powerful proprietary models. Given these restrictions, we ask: is autoregressive generation necessary and optimal for LLMs to perform re-ranking? We hypothesize that there are abundant signals relevant to re-ranking within LLMs that might not be used to their full potential via generation. To more directly leverage such signals, we propose in-context re-ranking (ICR), a novel method that leverages the change in attention pattern caused by the search query for accurate and efficient re-ranking. To mitigate the intrinsic biases in LLMs, we propose a calibration method using a content-free query. Due to the absence of generation, ICR only requires two ($O(1)$) forward passes to re-rank $N$ documents, making it substantially more efficient than generative re-ranking methods that require at least $O(N)$ forward passes. Our novel design also enables ICR to be applied to any LLM without specialized training while guaranteeing a well-formed ranking. Extensive experiments with two popular open-weight LLMs on standard single-hop and multi-hop information retrieval benchmarks show that ICR outperforms RankGPT while cutting the latency by more than 60% in practice. Through detailed analyses, we show that ICR's performance is specially strong on tasks that require more complex re-ranking signals. Our findings call for further exploration on novel ways of utilizing open-weight LLMs beyond text generation.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。