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

通过比较神经元分析解释大型语言模型中的算术机制

Interpreting Arithmetic Mechanism in Large Language Models through Comparative Neuron Analysis

The University of Manchester(曼彻斯特大学)

Zeping Yu, Sophia Ananiadou

AI总结:

提出 Comparative Neuron Analysis 方法,揭示大型语言模型中算术运算的内部逻辑链与 FFN 神经元作用机制,并应用于模型剪枝、编辑及 LoRA 机制研究。

摘要:

我们发现算术能力存在于少数注意力头中,每个头专门负责不同的运算。为探究原因,我们提出了 Comparative Neuron Analysis (CNA) 方法,该方法识别出从输入到预测包含四个不同阶段的内部逻辑链:通过浅层 FFN 神经元进行特征增强,通过浅层注意力层进行特征转移,通过算术头进行特征预测,以及在深层 FFN 神经元之间进行预测增强。此外,我们识别了特征增强和特征预测阶段中人类可解释的 FFN 神经元。这些发现促使我们研究 LoRA 的机制,揭示它通过放大与预测相关的 FFN 神经元的系数分数来提高预测概率。最后,我们将该方法应用于算术任务的模型剪枝和减少性别偏见的模型编辑。代码在 https://github.com/zepingyu0512/arithmetic-mechanism。

英文摘要:

We find arithmetic ability resides within a limited number of attention heads, with each head specializing in distinct operations. To delve into the reason, we introduce the Comparative Neuron Analysis (CNA) method, which identifies an internal logic chain consisting of four distinct stages from input to prediction: feature enhancing with shallow FFN neurons, feature transferring by shallow attention layers, feature predicting by arithmetic heads, and prediction enhancing among deep FFN neurons. Moreover, we identify the human-interpretable FFN neurons within both feature-enhancing and feature-predicting stages. These findings lead us to investigate the mechanism of LoRA, revealing that it enhances prediction probabilities by amplifying the coefficient scores of FFN neurons related to predictions. Finally, we apply our method in model pruning for arithmetic tasks and model editing for reducing gender bias. Code is on https://github.com/zepingyu0512/arithmetic-mechanism.

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

↑