知識の衝突下での言語モデルの残差ストリームの分析
Analysing the Residual Stream of Language Models Under Knowledge Conflicts
October 21, 2024
著者: Yu Zhao, Xiaotang Du, Giwon Hong, Aryo Pradipta Gema, Alessio Devoto, Hongru Wang, Xuanli He, Kam-Fai Wong, Pasquale Minervini
cs.AI
要旨
大規模言語モデル(LLMs)は、そのパラメータに膨大な事実知識を格納することができます。ただし、そのパラメトリックな知識は文脈で提供された情報と矛盾する可能性があります。このような矛盾は、過去の情報や誤った情報に依存するなど、望ましくないモデルの振る舞いにつながる可能性があります。本研究では、LLMsが知識の矛盾を識別できるかどうか、およびLLMの残差ストリームを分析することでモデルがどの知識源に依存するかを知ることが可能かどうかを調査しています。プロービングタスクを通じて、LLMsが残差ストリーム内で知識の矛盾の信号を内部的に登録することがわかりました。これは、中間モデルの活性化をプローブすることで正確に検出できます。これにより、入力やモデルのパラメータを変更せずに、回答を生成する前に残差ストリーム内の矛盾を検出できます。さらに、モデルが文脈知識とパラメトリック知識のどちらに依存して矛盾を解決するかによって、残差ストリームには大きく異なるパターンが現れることがわかりました。このパターンは、LLMsの振る舞いを推定し、回答を生成する前に予期しない回答を防ぐために活用できます。当社の分析は、LLMsが内部で知識の矛盾をどのように管理しているかについての洞察を提供し、知識選択プロセスを制御する方法の開発の基盤を提供しています。
English
Large language models (LLMs) can store a significant amount of factual
knowledge in their parameters. However, their parametric knowledge may conflict
with the information provided in the context. Such conflicts can lead to
undesirable model behaviour, such as reliance on outdated or incorrect
information. In this work, we investigate whether LLMs can identify knowledge
conflicts and whether it is possible to know which source of knowledge the
model will rely on by analysing the residual stream of the LLM. Through probing
tasks, we find that LLMs can internally register the signal of knowledge
conflict in the residual stream, which can be accurately detected by probing
the intermediate model activations. This allows us to detect conflicts within
the residual stream before generating the answers without modifying the input
or model parameters. Moreover, we find that the residual stream shows
significantly different patterns when the model relies on contextual knowledge
versus parametric knowledge to resolve conflicts. This pattern can be employed
to estimate the behaviour of LLMs when conflict happens and prevent unexpected
answers before producing the answers. Our analysis offers insights into how
LLMs internally manage knowledge conflicts and provides a foundation for
developing methods to control the knowledge selection processes.Summary
AI-Generated Summary