[论文解读] Causal Mediation Analysis for Interpreting Neural NLP: The Case of Gender Bias
本文通过将内部组件(神经元、注意力头)视为输入和输出之间的中介,来解释神经NLP模型的因果中介分析,并将其应用于基于 Transformer 的语言模型中的性别偏见。
Common methods for interpreting neural models in natural language processing typically examine either their structure or their behavior, but not both. We propose a methodology grounded in the theory of causal mediation analysis for interpreting which parts of a model are causally implicated in its behavior. It enables us to analyze the mechanisms by which information flows from input to output through various model components, known as mediators. We apply this methodology to analyze gender bias in pre-trained Transformer language models. We study the role of individual neurons and attention heads in mediating gender bias across three datasets designed to gauge a model's sensitivity to gender bias. Our mediation analysis reveals that gender bias effects are (i) sparse, concentrated in a small part of the network; (ii) synergistic, amplified or repressed by different components; and (iii) decomposable into effects flowing directly from the input and indirectly through the mediators.
研究动机与目标
- 为解释神经NLP模型提供动机并形式化因果中介分析。
- 研究内部组件(神经元、注意力头)如何因果性地促成预训练 Transformer 中的性别偏见。
- 就模型内偏见效应的稀疏性、协同效应和可分解性提供实证证据。
提出的方法
- 将神经网络建模为以输入为根节点、输出为叶节点的有向无环图。
- 对输入(设定性别)和中介变量(特定神经元或注意力头)定义 do-干预。
- 计算总效应(TE)、自然直接效应(NDE)和自然间接效应(NIE),以量化中介变量的因果作用。
- 在神经元和注意力头级别应用干预,以测量它们在不同 GPT2 变体及其他模型中的偏见贡献。
- 使用包括 Professions、Winobias 和 Winogender 的数据集来评估语法性别偏见。
实验结果
研究问题
- RQ1语言模型中的性别偏见如何被内部组件(如神经元和注意力头)中介?
- RQ2偏见效应在 Transformer 模型中是否表现出稀疏性、协同作用以及可分解为直接路径和间接路径?
- RQ3研究结果是否可以在超出 GPT2 的模型规模和结构中普遍化?
- RQ4不同的偏见测量数据集如何影响观测到的中介效应?
主要发现
| 模型 | 参数 | 层数 | 头数量 | TE_WB | TE_WG | TE_Professions |
|---|---|---|---|---|---|---|
| GPT2-small rand. | 117M | 12 | 12 | 0.066 | 0.045 | 0.117 |
| GPT2-distil | 82M | 6 | 12 | 0.118 | 0.081 | 130.859 |
| GPT2-small | 117M | 12 | 12 | 0.249 | 0.103 | 112.275 |
| GPT2-medium | 345M | 24 | 16 | 0.774 | 0.322 | 115.945 |
| GPT2-large | 774M | 36 | 20 | 0.751 | 0.364 | 96.859 |
| GPT2-xl | 1558M | 48 | 25 | 1.049 | 0.342 | 225.217 |
- 偏见效应在较大的模型中更显著,并且在最大的 GPT2 变体中可能达到饱和。
- 性别偏见集中在模型组件的一个小子集,表明存在稀疏性。
- 中介变量之间的相互作用可以放大或抑制偏见,表现出组件之间的协同效应。
- 总效应可以通过将直接效应和间接效应相加来很好地近似,表明尽管存在非线性,但仍可分解。
- 研究结果在自回归模型上具有普遍性,在一定程度上也适用于掩码语言模型。
更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。