Papers
arxiv:2407.01100

Eliminating Position Bias of Language Models: A Mechanistic Approach

Published on Jul 1
· Submitted by wzq016 on Jul 4
Authors:
,
,
,
,
,
,
,

Abstract

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. Specifically, we find that causal attention generally causes models to favor distant content, while relative positional encodings like RoPE prefer nearby ones based on the analysis of retrieval-augmented question answering (QA). Further, our empirical study on object detection reveals that position bias is also present in vision-language models (VLMs). Based on the above analyses, we propose to ELIMINATE position bias caused by different input segment orders (e.g., options in LM-as-a-judge, retrieved documents in QA) in a TRAINING-FREE ZERO-SHOT manner. Our method changes the causal attention to bidirectional attention between segments and utilizes model attention values to decide the relative orders of segments instead of using the order provided in input prompts, therefore enabling Position-INvariant inferencE (PINE) at the segment level. By eliminating position bias, models achieve better performance and reliability in downstream tasks where position bias widely exists, such as LM-as-a-judge and retrieval-augmented QA. Notably, PINE is especially useful when adapting LMs for evaluating reasoning pairs: it consistently provides 8 to 10 percentage points performance gains in most cases, and makes Llama-3-70B-Instruct perform even better than GPT-4-0125-preview on the RewardBench reasoning subset.

Community

Paper author Paper submitter

Hi readers! In this paper, we propose a training-free approach to eliminate the position bias in LLMs, which is useful for tasks like LM-as-judge and RAG-QA. In short, our method converts causal attention to bidirectional attention, and use attention sorting to re-assign positions.

A promising result is that Llama 70B with our method can beat GPT-4 in the RewardBench reasoning subset!

More details:
Twitter: https://x.com/wzq016/status/1808568703229046792
PDF: https://arxiv.org/pdf/2407.01100
Html: https://arxiv.org/html/2407.01100
Abstract: https://arxiv.org/abs/2407.01100
Github: https://github.com/wzq016/PINE

Sign up or log in to comment

Models citing this paper 0

No model linking this paper

Cite arxiv.org/abs/2407.01100 in a model README.md to link it from this page.

Datasets citing this paper 0

No dataset linking this paper

Cite arxiv.org/abs/2407.01100 in a dataset README.md to link it from this page.

Spaces citing this paper 0

No Space linking this paper

Cite arxiv.org/abs/2407.01100 in a Space README.md to link it from this page.

Collections including this paper 2