通过自消融机制让Transformer模型更可解释,同时提升神经元专注度。
Self-Ablating Transformers: More Interpretability, Less Sparsity
- 训练时动态强制选通最活跃的k个神经元和注意力单元,实现选择性激活。
- 模型在保持语言能力前提下,特征表示更集中,神经元分工更明确。
- 适合关注模型可解释性与内部机制研究的开发者和研究人员。
机器学习中日益普遍的观点认为稀疏性与可解释性存在关联。我们提出一种新型自消融机制,前瞻性地探究这一关系在语言Transformer中的体现。该方法动态施加k-胜者为王约束,迫使模型在神经元和注意力单元上实现选择性激活。不同于事后分析已训练模型的方法,本方法将可解释性直接融入训练过程,从源头促进特征定位。在TinyStories数据集上训练小型模型并进行可解释性测试发现,自消融使电路更局部化、特征表示更集中、神经元专属性增强,且未影响语言建模性能。令人意外的是,整体稀疏性反而下降,表明自消融促进的是局部专业化而非广泛不激活。这揭示了稀疏性与可解释性之间复杂的相互作用:全局稀疏性降低可与局部专属性提升共存,从而增强可解释性。代码已公开于https://github.com/keenanpepper/self-ablating-transformers以支持复现。
原文摘要 · Abstract (English)
A growing intuition in machine learning suggests a link between sparsity and interpretability. We introduce a novel self-ablation mechanism to investigate this connection ante-hoc in the context of language transformers. Our approach dynamically enforces a k-winner-takes-all constraint, forcing the model to demonstrate selective activation across neuron and attention units. Unlike post-hoc methods that analyze already-trained models, our approach integrates interpretability directly into model training, promoting feature localization from inception. Training small models on the TinyStories dataset and employing interpretability tests, we find that self-ablation leads to more localized circuits, concentrated feature representations, and increased neuron specialization without compromising language modelling performance. Surprisingly, our method also decreased overall sparsity, indicating that self-ablation promotes specialization rather than widespread inactivity. This reveals a complex interplay between sparsity and interpretability, where decreased global sparsity can coexist with increased local specialization, leading to enhanced interpretability. To facilitate reproducibility, we make our code available at https://github.com/keenanpepper/self-ablating-transformers.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。