arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2409.19745cs.CLcs.AI
收藏

PEAR:位置嵌入无关的注意力重加权以零推理开销增强检索增强生成

PEAR: Position-Embedding-Agnostic Attention Re-weighting Enhances Retrieval-Augmented Generation with Zero Inference Overhead

Gaoling School of Artificial Intelligence, Renmin University of China(中国人民大学高瓴人工智能学院);Ant Group(蚂蚁集团);Southeast University(东南大学)

Tao Tan, Yining Qian, Ang Lv, Hongzhan Lin, Songhao Wu, Yongbo Wang, Feng Wang, Jingtong Wu, Xin Lu, Rui Yan

AI总结:

针对大语言模型RAG任务上下文感知不足、现有增强方法有推理开销且依赖特定位置嵌入的问题,提出零开销的PEAR方法,通过重加权抑制性注意力头提升性能,且适配多种位置嵌入。

摘要:

借助检索增强生成(RAG)增强的大语言模型(LLM)为网页搜索带来了全新范式。然而,大语言模型有限的上下文感知能力会降低其在RAG任务上的表现。现有的上下文感知增强方法通常效率低下,会在推理阶段产生时间或内存开销,且许多方法是针对特定位置嵌入定制的。本文提出了位置嵌入无关的注意力重加权方法(Position-Embedding-Agnostic attention Re-weighting, PEAR),能够以零推理开销增强大语言模型的上下文感知能力。具体而言,我们首先在一个聚焦于上下文复制的代理任务上,检测那些会抑制模型上下文感知能力、进而降低RAG性能的注意力头。为削弱这些注意力头的影响,我们使用可学习系数对其输出进行重加权。在大语言模型参数冻结的情况下,通过调整这些系数最小化代理任务的损失,从而完成模型优化。最终系数会被优化至小于1的值,由此降低它们抑制RAG性能的倾向。在推理阶段,无论当前具体任务是什么,都使用固定的优化后系数对这些注意力头进行重加权。我们提出的PEAR相较于现有方法有两大核心优势:(1)它不会带来任何额外的内存占用或推理时间开销,同时在各类RAG任务上的准确率和效率均优于主流基线模型。(2)它不依赖于位置嵌入算法,适用范围更广。

英文摘要:

Large language models (LLMs) enhanced with retrieval-augmented generation (RAG) have introduced a new paradigm for web search. However, the limited context awareness of LLMs degrades their performance on RAG tasks. Existing methods to enhance context awareness are often inefficient, incurring time or memory overhead during inference, and many are tailored to specific position embeddings. In this paper, we propose Position-Embedding-Agnostic attention Re-weighting (PEAR), which enhances the context awareness of LLMs with zero inference overhead. Specifically, on a proxy task focused on context copying, we first detect heads which suppress the models' context awareness thereby diminishing RAG performance. To weaken the impact of these heads, we re-weight their outputs with learnable coefficients. The LLM (with frozen parameters) is optimized by adjusting these coefficients to minimize loss on the proxy task. As a result, the coefficients are optimized to values less than one, thereby reducing their tendency to suppress RAG performance. During inference, the optimized coefficients are fixed to re-weight these heads, regardless of the specific task at hand. Our proposed PEAR offers two major advantages over previous approaches: (1) It introduces zero additional inference overhead in terms of memory usage or inference time, while outperforming competitive baselines in accuracy and efficiency across various RAG tasks. (2) It is independent of position embedding algorithms, ensuring broader applicability.

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

↑