arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2410.06496cs.CL
收藏

跨语言电路的相似性研究:以主谓一致任务为例

On the Similarity of Circuits across Languages: a Case Study on the Subject-verb Agreement Task

Universitat Politècnica de Catalunya(加泰罗尼亚理工大学);FAIR, Meta(Meta FAIR实验室)

Javier Ferrando, Marta R. Costa-jussà

AI总结:

该研究以主谓一致任务为例,探究Gemma 2B在英西双语下的内部电路,发现二者高度一致且存在跨语言的主语数信号方向,该方向具因果效应,且同类模型也有类似表现。

摘要:

近期,语言模型实现的若干算法已被成功逆向工程,但这些发现集中于特定任务和模型,电路在不同设置下的普适性仍不明确。本文研究Gemma 2B(20亿参数语言模型)在英语、西班牙语两种语言中解决主谓一致任务的实现电路。我们发现两种语言的电路高度一致:主要由特定注意力头将“主语数”信号写入最后残差流,再由最终MLP(多层感知机)中的少量神经元读取。值得注意的是,该主语数信号以残差流空间中的方向表示,且与语言无关。我们证明该方向对模型预测存在因果效应:通过干预英语中发现的方向,可有效翻转西班牙语的动词数预测。最后,我们还提供证据表明Gemma 1和Gemma 2系列的其他模型也存在类似行为。

英文摘要:

Several algorithms implemented by language models have recently been successfully reversed-engineered. However, these findings have been concentrated on specific tasks and models, leaving it unclear how universal circuits are across different settings. In this paper, we study the circuits implemented by Gemma 2B for solving the subject-verb agreement task across two different languages, English and Spanish. We discover that both circuits are highly consistent, being mainly driven by a particular attention head writing a `subject number' signal to the last residual stream, which is read by a small set of neurons in the final MLPs. Notably, this subject number signal is represented as a direction in the residual stream space, and is language-independent. We demonstrate that this direction has a causal effect on the model predictions, effectively flipping the Spanish predicted verb number by intervening with the direction found in English. Finally, we present evidence of similar behavior in other models within the Gemma 1 and Gemma 2 families.

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

↑