arXiv:2504.14492cs.CL2025-04ACL被引 44

无需重训,推理时动态修正大模型偏见。

FairSteer: Inference Time Debiasing for LLMs with Dynamic Activation Steering

  • 通过轻量分类器检测隐藏层中的偏见信号
  • 用对比提示对计算干预向量,实现精准纠偏
  • 适用所有主流大模型,部署简单无副作用

大型语言模型易吸收训练语料中的偏见,可能带来负面社会影响。现有基于提示的去偏方法因对提示敏感而不稳定,基于微调的方法则计算开销大且易引发灾难性遗忘。本文提出FairSteer,一种无需定制提示或模型重训的推理阶段去偏框架。受线性表示假设启发,初步研究发现公平相关特征可编码为隐藏激活空间中可分离的方向。FairSteer分三步运行:偏见激活检测、去偏引导向量(DSV)计算、动态激活调节。首先训练轻量级线性分类器以识别激活中的偏见特征;随后利用小规模对比提示对计算DSV作为干预方向;最后在推理阶段通过调整激活实现去偏。六种大模型的综合评估显示,FairSteer在问答、反事实输入评估及开放式文本生成任务中均表现更优。代码将开源。

原文摘要 · Abstract (English)

Large language models (LLMs) are prone to capturing biases from training corpus, leading to potential negative social impacts. Existing prompt-based debiasing methods exhibit instability due to their sensitivity to prompt changes, while fine-tuning-based techniques incur substantial computational overhead and catastrophic forgetting. In this paper, we propose FairSteer, a novel inference-time debiasing framework without requiring customized prompt design or model retraining. Motivated by the linear representation hypothesis, our preliminary investigation demonstrates that fairness-related features can be encoded into separable directions in the hidden activation space. FairSteer operates in three steps: biased activation detection, debiasing steering vector (DSV) computation, and dynamic activation steering. Specifically, it first trains a lightweight linear classifier to detect bias signatures in activations, and then computes DSVs as intervention directions derived from small contrastive prompt pairs. Subsequently, it performs debiasing by adjusting activations with DSVs in the inference stage. Comprehensive evaluation with six LLMs demonstrates the superiority of FairSteer across question-answering, counterfactual input evaluation and open-ended text generation tasks. Code will be released.

大模型去偏推理优化动态调节

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