大規模言語モデルにおける関係特異ニューロンについて
On Relation-Specific Neurons in Large Language Models
February 24, 2025
著者: Yihong Liu, Runsheng Chen, Lea Hirlimann, Ahmad Dawar Hakimi, Mingyang Wang, Amir Hossein Kargaran, Sascha Rothe, François Yvon, Hinrich Schütze
cs.AI
要旨
大規模言語モデル(LLM)では、特定のニューロンが事前学習中に学習した異なる知識の要素を格納することができます。知識は通常、関係と実体の組み合わせとして現れますが、あるニューロンが実体に依存せずに関係そのものに焦点を当てているかどうかは不明です。私たちは、このようなニューロンが入力テキスト内の関係を検出し、そのような関係を含む生成を導くと仮説立てています。このために、我々は統計に基づく手法を用いて、選択した関係のセットについてLlama-2ファミリーを研究しています。実験では、関係固有のニューロンの存在を示しています。関係rに特化した候補ニューロンを選択的に非活性化することが、LLMがrである事実および異なる関係r'(r ≠ r')の事実を処理する能力に与える影響を測定しています。関係情報をエンコードする能力に関して、関係固有のニューロンの以下の3つの特性の証拠を示しています。 (i) ニューロンの累積性。関係rのニューロンは累積効果を示し、それらのより大きな部分を非活性化すると、rのより多くの事実の劣化が生じます。 (ii) ニューロンの多様性。ニューロンは、複数の密接に関連する関係だけでなく、それほど関連性の低い関係にも共有されることがあります。一部の関係ニューロンは言語を超えて転送されます。 (iii) ニューロンの干渉。ある関係に特化したニューロンを非活性化することで、他の関係の事実に対するLLMの生成パフォーマンスが向上することがあります。私たちは、コードを以下のURLで一般公開します:https://github.com/cisnlp/relation-specific-neurons.
English
In large language models (LLMs), certain neurons can store distinct pieces of
knowledge learned during pretraining. While knowledge typically appears as a
combination of relations and entities, it remains unclear whether some neurons
focus on a relation itself -- independent of any entity. We hypothesize such
neurons detect a relation in the input text and guide generation involving such
a relation. To investigate this, we study the Llama-2 family on a chosen set of
relations with a 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 whose relation is r and (2) facts whose relation is 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. (i) Neuron cumulativity. The neurons for
r present a cumulative effect so that deactivating a larger portion of them
results in the degradation of more facts in r. (ii) Neuron
versatility. Neurons can be shared across multiple closely related as well as
less related relations. Some relation neurons transfer across languages.
(iii) Neuron interference. Deactivating neurons specific to one
relation can improve LLM generation performance for facts of other relations.
We will make our code publicly available at
https://github.com/cisnlp/relation-specific-neurons.