arXiv:2510.10142cs.CLcs.AI2025-10ACL

通过屏蔽特定注意力头,显著降低大模型的偏见输出。

Debiasing LLMs by Masking Unfairness-Driving Attention Heads

  • 对比直接回答与思维链提示,发现偏见源于少数活跃注意力头。
  • 提出DiffHeads框架,仅屏蔽引发偏见的注意力头,降低49.4%偏见。
  • 无需重训练,适配多模型,适合部署阶段去偏处理。

大型语言模型在需避免歧视性决策的领域日益关键。现有研究关注偏见何时出现,但缺乏对生成机制的理解,导致缓解措施脆弱。本文系统研究了大模型偏见,提出轻量级去偏框架DiffHeads。首先,在八种主流开源与闭源模型上比较直接回答(DA)与思维链(CoT)提示,发现DA会激活模型固有偏见,使测得偏见降低534.5%-391.9%(在单轮与双轮对话中)。其次,定义标记-头贡献度,追踪每个标记对注意力头的影响,揭示一小簇在DA下激活、在CoT下基本沉寂的“偏见头”,首次建立提示策略与偏见产生的因果联系。最后,基于此,提出DiffHeads:通过比较DA与CoT下的差异激活,识别并选择性屏蔽偏见头。该方法在DA和CoT下分别减少49.4%和40.3%的不公平性,且不损害模型性能。

原文摘要 · Abstract (English)

Large language models (LLMs) increasingly mediate decisions in domains where unfair treatment of demographic groups is unacceptable. Existing work probes when biased outputs appear, but gives little insight into the mechanisms that generate them, leaving existing mitigations largely fragile. In this paper, we conduct a systematic investigation LLM unfairness and propose DiffHeads, a lightweight debiasing framework for LLMs. We first compare Direct-Answer (DA) prompting to Chain-of-Thought (CoT) prompting across eight representative open- and closed-source LLMs. DA will trigger the nature bias part of LLM and improve measured unfairness by 534.5%-391.9% in both one-turn and two-turn dialogues. Next, we define a token-to-head contribution score that traces each token's influence back to individual attention heads. This reveals a small cluster of bias heads that activate under DA but stay largely dormant with CoT, providing the first causal link between prompting strategy and bias emergence. Finally, building on this insight, we propose DiffHeads that identifies bias heads through differential activation analysis between DA and CoT, and selectively masks only those heads. DiffHeads reduces unfairness by 49.4%, and 40.3% under DA and CoT, respectively, without harming model utility.

大模型去偏注意力头提示工程

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。