arXiv:2502.17355cs.CL2025-02EMNLP被引 4

发现大模型中存在专门识别关系的神经元,能影响事实生成。

On Relation-Specific Neurons in Large Language Models

  • 通过统计方法定位特定关系的专属神经元
  • 多个神经元协同处理同一关系,单个神经元不完整编码事实
  • 神经元可跨关系甚至跨语言复用,关闭某类神经元反而提升其他事实记忆

在大型语言模型中,某些神经元可存储预训练期间学到的特定知识。尽管事实知识通常由关系与实体共同构成,但尚不清楚是否存在专注于关系本身(而非特定实体)的神经元。本文假设这类神经元能检测输入中的关系,并引导涉及该关系的生成。研究基于LLama-2系列模型,在选定关系上采用统计方法进行分析。实验表明存在关系专属神经元。通过选择性关闭针对关系r的候选神经元,评估其对处理(1)关系r相关事实和(2)另一不同关系r' ≠ r的事实的影响。结果支持关系专属神经元的三个特性:(i) 神经元累积性:多个神经元共同参与处理关系r的事实,无单一神经元独立完整编码;(ii) 神经元通用性:神经元可跨紧密或较远关系共享,部分还具备跨语言迁移能力;(iii) 神经元干扰性:关闭某关系专属神经元反而提升模型对其他关系事实的回忆表现。代码与数据已公开于https://github.com/cisnlp/relation-specific-neurons。

原文摘要 · Abstract (English)

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.

神经元分析关系识别大模型机制知识存储

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