arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2502.17355cs.CL
收藏

大型语言模型中的关系特定神经元

On Relation-Specific Neurons in Large Language Models

Yihong Liu, Runsheng Chen, Lea Hirlimann, Ahmad Dawar Hakimi, Mingyang Wang, Amir Hossein Kargaran, Sascha Rothe, François Yvon, Hinrich Schütze

AI总结:

本研究通过统计方法在LLama-2中发现关系特定神经元,验证其检测关系并引导生成,揭示累积性、多功能性和干扰性三大属性,并公开代码与数据。

摘要:

在大型语言模型(LLMs)中,某些神经元可以存储预训练期间学到的不同知识片段。虽然事实知识通常表现为关系和实体的组合,但目前尚不清楚某些神经元是否专注于关系本身——独立于任何实体。我们假设这类神经元在输入文本中检测关系,并引导涉及此类关系的生成。为了研究这一点,我们在选定的关系集合上使用基于统计的方法研究了LLama-2系列模型。我们的实验证明了关系特定神经元的存在。我们测量了选择性停用特定于关系r的候选神经元对LLM处理(1)涉及关系r的事实和(2)涉及不同关系r'≠r的事实的能力的影响。关于它们编码关系信息的能力,我们为关系特定神经元的以下三个属性提供了证据。(i)神经元累积性:多个神经元共同参与处理涉及关系r的事实,没有单个神经元独自完整编码r中的事实。(ii)神经元多功能性:神经元可以在多个密切相关以及不太相关的关系之间共享。此外,一些关系神经元可以跨语言迁移。(iii)神经元干扰:停用特定于一种关系的神经元可以提高LLM对其他关系事实的事实回忆性能。我们在https://github.com/cisnlp/relation-specific-neurons公开了我们的代码和数据。

英文摘要:

In large language models (LLMs), certain \emph{neurons} can store distinct pieces of knowledge learned during pretraining. While factual knowledge typically appears as a combination of \emph{relations} and \emph{entities}, it remains unclear whether some neurons focus on a relation itself -- independent of any entity. We hypothesize such neurons \emph{detect} a relation in the input text and \emph{guide} generation involving such a relation. To investigate this, we study the LLama-2 family on a chosen set of relations, with a \textit{statistics}-based method. Our experiments demonstrate the existence of relation-specific neurons. We measure the effect of selectively deactivating candidate neurons specific to relation $r$ on the LLM's ability to handle (1) facts involving relation $r$ and (2) facts involving a different relation $r' \neq r$. With respect to their capacity for encoding relation information, we give evidence for the following three properties of relation-specific neurons. \textbf{(i) Neuron cumulativity.} Multiple neurons jointly contribute to processing facts involving relation $r$, with no single neuron fully encoding a fact in $r$ on its own. \textbf{(ii) Neuron versatility.} Neurons can be shared across multiple closely related as well as less related relations. In addition, some relation neurons transfer across languages. \textbf{(iii) Neuron interference.} Deactivating neurons specific to one relation can improve LLMs' factual recall performance for facts of other relations. We make our code and data publicly available at https://github.com/cisnlp/relation-specific-neurons.

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

↑