arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2407.01100cs.CLcs.LG
收藏

消除语言模型的位置偏差:一种机制分析方法

Eliminating Position Bias of Language Models: A Mechanistic Approach

University of Illinois Urbana-Champaign(伊利诺伊大学厄巴纳-香槟分校);Harvard University(哈佛大学);Texas A&M University(德克萨斯农工大学)

Ziqi Wang, Hanlin Zhang, Xiner Li, Kuan-Hao Huang, Chi Han, Shuiwang Ji, Sham M. Kakade, Hao Peng, Heng Ji

AI总结:

本文通过机制分析将语言模型的位置偏差归因于因果注意力和相对位置编码,提出无需训练的零样本方法PINE,将文档间因果注意力改为双向注意力并利用注意力值决定文档顺序,实现文档级位置不变推理,在多项下游任务中显著提升性能与可靠性。

摘要:

位置偏差已被证明是现代语言模型(LMs)的一个普遍问题,模型会根据内容在给定上下文中的位置来优先处理内容。这种偏差常导致意外的模型失败,并损害各种应用中的性能、鲁棒性和可靠性。我们的机制分析将位置偏差归因于几乎所有最先进LMs中采用的两个组件:因果注意力和相对位置编码。基于这些分析,我们提出用一种无需训练的零样本方法消除位置偏差(例如,QA中不同检索文档的顺序影响性能)。我们的方法将文档间的因果注意力改为双向注意力,并利用模型注意力值决定文档的相对顺序,而非使用输入提示中提供的顺序,从而在文档层面实现位置不变推理(PINE)。通过消除位置偏差,模型在下游任务中取得更好的性能和可靠性,包括LM作为评判者、检索增强QA、分子生成和数学推理。值得注意的是,PINE在适配LMs以评估推理对时尤为有效:它持续提供8到10个百分点的性能提升,使Llama-3-70B-Instruct在RewardBench推理集上的表现甚至超过GPT-4-0125-preview和GPT-4o-2024-08-06。

英文摘要:

Position bias has proven to be a prevalent issue of modern language models (LMs), where the models prioritize content based on its position within the given context. This bias often leads to unexpected model failures and hurts performance, robustness, and reliability across various applications. Our mechanistic analysis attributes the position bias to two components employed in nearly all state-of-the-art LMs: causal attention and relative positional encodings. Based on the analyses, we propose to eliminate position bias (e.g., different retrieved documents' orders in QA affect performance) with a training-free zero-shot approach. Our method changes the causal attention to bidirectional attention between documents and utilizes model attention values to decide the relative orders of documents instead of using the order provided in input prompts, therefore enabling Position-INvariant inferencE (PINE) at the document level. By eliminating position bias, models achieve better performance and reliability in downstream tasks, including LM-as-a-judge, retrieval-augmented QA, molecule generation, and math reasoning. Notably, PINE is especially useful when adapting LMs for evaluating reasoning pairs: it consistently provides 8 to 10 percentage points performance gains, making Llama-3-70B-Instruct perform even better than GPT-4-0125-preview and GPT-4o-2024-08-06 on the RewardBench reasoning set.

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

↑