arXiv:2508.21258cs.LG2025-08被引 11

用相关性反向传播提升语言模型可解释性,更准更快定位关键神经路径。

RelP: Faithful and Efficient Circuit Discovery in Language Models via Relevance Patching

  • 用LRP的传播系数替代梯度,实现高效且可靠的归因分析。
  • 在GPT-2 Large上,对MLP输出的相关性达0.956,远超传统方法的0.006。
  • 适合研究模型内部机制的学者,尤其关注高精度可解释性的场景。

激活补丁法是机械可解释性中定位模型行为组件的标准方法,但大规模应用计算成本高。归因补丁法虽快,但在深层非线性网络中噪声大、可靠性低。本文提出相关性补丁(RelP),将归因补丁中的局部梯度替换为层间相关性传播(LRP)得到的传播系数。LRP通过逐层反向传播输出,依据局部规则重分配相关性,保证相关性守恒或提高信噪比。与归因补丁一样,RelP仅需两次前向传播和一次反向传播,保持高效同时提升准确性。我们在多种模型和任务中验证了其有效性,发现其对激活补丁的逼近效果优于标准归因补丁,尤其在间接宾语识别(IOI)任务中分析残差流和MLP输出时表现突出。例如,在GPT-2 Large的MLP输出上,归因补丁相关性仅为0.006,而RelP达到0.956。此外,对比稀疏特征电路的忠实度,RelP在不增加计算成本的前提下,实现了与集成梯度(IG)相当的忠实度。

原文摘要 · Abstract (English)

Activation patching is a standard method in mechanistic interpretability for localizing the components of a model responsible for specific behaviors, but it is computationally expensive to apply at scale. Attribution patching offers a faster, gradient-based approximation, yet suffers from noise and reduced reliability in deep, highly non-linear networks. In this work, we introduce Relevance Patching (RelP), which replaces the local gradients in attribution patching with propagation coefficients derived from Layer-wise Relevance Propagation (LRP). LRP propagates the network's output backward through the layers, redistributing relevance to lower-level components according to local propagation rules that ensure properties such as relevance conservation or improved signal-to-noise ratio. Like attribution patching, RelP requires only two forward passes and one backward pass, maintaining computational efficiency while improving faithfulness. We validate RelP across a range of models and tasks, showing that it more accurately approximates activation patching than standard attribution patching, particularly when analyzing residual stream and MLP outputs in the Indirect Object Identification (IOI) task. For instance, for MLP outputs in GPT-2 Large, attribution patching achieves a Pearson correlation of 0.006, whereas RelP reaches 0.956, highlighting the improvement offered by RelP. Additionally, we compare the faithfulness of sparse feature circuits identified by RelP and Integrated Gradients (IG), showing that RelP achieves comparable faithfulness without the extra computational cost associated with IG.

可解释性神经网络相关性传播语言模型

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