Large Language Models (LLMs), such as the GPT-4 and LLaMA families, have demonstrated considerable success across diverse tasks, including multiple-choice questions (MCQs). However, these models exhibit a positional bias, particularly an even worse anchored bias in the GPT-2 family, where they consistently favour the first choice 'A' in MCQs during inference. This anchored bias challenges the integrity of GPT-2's decision-making process, as it skews performance based on the position rather than the content of the choices in MCQs. In this study, we utilise the mechanistic interpretability approach to identify the internal modules within GPT-2 models responsible for this bias. We focus on the Multi-Layer Perceptron (MLP) layers and attention heads, using the "logit lens" method to trace and modify the specific value vectors that contribute to the bias. By updating these vectors within MLP and recalibrating attention patterns to neutralise the preference for the first choice 'A', we effectively mitigate the anchored bias. Our interventions not only mitigate the bias but also improve the overall MCQ prediction accuracy for the GPT-2 family across various datasets. This work represents the first comprehensive mechanistic analysis of anchored bias in MCQs within the GPT-2 models, introducing targeted, minimal-intervention strategies that significantly enhance GPT2 model robustness and accuracy in MCQs. Our code is available at https://github.com/ruizheliUOA/Anchored_Bias_GPT2.
翻译:以GPT-4和LLaMA系列为代表的大型语言模型(LLMs)在多项选择题(MCQs)等多样化任务中展现出显著成效。然而,这些模型存在位置偏差现象,其中GPT-2系列尤为严重地表现出锚定偏差——在推理过程中持续偏向多项选择题的首个选项“A”。这种锚定偏差挑战了GPT-2决策过程的完整性,因其评估结果取决于选项位置而非内容本身。本研究采用机制可解释性方法,定位了GPT-2模型中导致该偏差的内部模块。我们聚焦于多层感知器(MLP)层与注意力头,运用“logit lens”方法追踪并修正导致偏差的特定值向量。通过更新MLP内的这些向量并重新校准注意力模式以消除对首选项“A”的偏好,我们有效缓解了锚定偏差。我们的干预措施不仅减轻了偏差,还提升了GPT-2系列模型在多个数据集上的整体MCQ预测准确率。此项工作首次对GPT-2模型中的MCQ锚定偏差进行了系统性机制分析,提出了具有针对性、最小干预的策略,显著增强了GPT-2模型在MCQ任务中的鲁棒性与准确性。相关代码已发布于https://github.com/ruizheliUOA/Anchored_Bias_GPT2。