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

用于缓解偏见的激活引导:一种面向更安全LLM的可解释方法

Activation Steering for Bias Mitigation: An Interpretable Approach to Safer LLMs

Indian Institute of Technology Madras(印度理工学院马德拉斯学院)

Shivam Dubey

AI总结:

本文提出一种基于机制可解释性的端到端系统,通过在gpt2-large内部激活上训练线性探针识别偏见,并利用引导向量在推理时实时引导模型生成中性内容,为构建更安全LLM提供了可解释方案。

摘要:

随着大型语言模型(LLMs)越来越多地融入社会系统,它们延续和放大有害偏见的风险成为了一个关键的安全隐患。传统的缓解偏见方法通常依赖于数据过滤或事后输出审核,这些方法将模型视为不透明的黑盒。在本研究中,我们引入了一个完整的端到端系统,该系统使用机制可解释性技术,直接在模型内部运作中识别并主动缓解偏见。我们的方法包含两个主要阶段。首先,我们在模型的内部激活上训练线性“探针”,以检测各种偏见(例如,性别、种族、年龄)的潜在表示。我们在gpt2-large上的实验表明,这些探针能够以近乎完美的准确率识别出有偏见的内容,揭示了偏见表示在模型的较后层变得最为显著。其次,我们利用这些发现,通过对比模型对有偏见陈述和中性陈述的激活模式来计算“引导向量”。通过在推理过程中添加这些向量,我们能够主动引导模型的生成过程,使其在实时中远离产生有害的、刻板的或有偏见的内容。我们展示了这种激活引导技术的有效性,表明它成功地将有偏见的补全内容转变为更中性的替代方案。我们将我们的工作作为一个稳健且可复现的系统提出,它为构建更安全、更负责任的LLM提供了一种更直接、更可解释的方法。

英文摘要:

As large language models (LLMs) become more integrated into societal systems, the risk of them perpetuating and amplifying harmful biases becomes a critical safety concern. Traditional methods for mitigating bias often rely on data filtering or post-hoc output moderation, which treat the model as an opaque black box. In this work, we introduce a complete, end-to-end system that uses techniques from mechanistic interpretability to both identify and actively mitigate bias directly within a model's internal workings. Our method involves two primary stages. First, we train linear "probes" on the internal activations of a model to detect the latent representations of various biases (e.g., gender, race, age). Our experiments on \texttt{gpt2-large} demonstrate that these probes can identify biased content with near-perfect accuracy, revealing that bias representations become most salient in the model's later layers. Second, we leverage these findings to compute "steering vectors" by contrasting the model's activation patterns for biased and neutral statements. By adding these vectors during inference, we can actively steer the model's generative process away from producing harmful, stereotypical, or biased content in real-time. We demonstrate the efficacy of this activation steering technique, showing that it successfully alters biased completions toward more neutral alternatives. We present our work as a robust and reproducible system that offers a more direct and interpretable approach to building safer and more accountable LLMs.

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

↑