Analysing the Residual Stream of Language Models Under Knowledge Conflicts

要約

大規模言語モデル (LLM) は、パラメーターに大量の事実の知識を保存できます。
ただし、パラメトリックな知識は、コンテキストで提供される情報と矛盾する可能性があります。
このような競合は、古い情報や不正確な情報への依存など、モデルの望ましくない動作につながる可能性があります。
この研究では、LLM が知識の競合を識別できるかどうか、また LLM の残差ストリームを分析することでモデルがどの知識源に依存するかを知ることができるかどうかを調査します。
調査タスクを通じて、LLM が残差ストリーム内の知識競合の信号を内部的に登録できることがわかり、これは中間モデルの活性化を調査することで正確に検出できます。
これにより、入力パラメーターやモデル パラメーターを変更せずに、応答を生成する前に残差ストリーム内の競合を検出できます。
さらに、モデルが矛盾を解決するためにコンテキスト知識とパラメトリック知識に依存する場合、残差ストリームは大きく異なるパターンを示すことがわかりました。
このパターンを使用すると、競合が発生したときの LLM の動作を推定し、応答を生成する前に予期しない応答を防ぐことができます。
私たちの分析は、LLM が知識の競合を内部でどのように管理しているかについての洞察を提供し、知識の選択プロセスを制御する方法を開発するための基盤を提供します。

要約(オリジナル)

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.

arxiv情報

著者 Yu Zhao,Xiaotang Du,Giwon Hong,Aryo Pradipta Gema,Alessio Devoto,Hongru Wang,Xuanli He,Kam-Fai Wong,Pasquale Minervini
発行日 2024-10-21 15:12:51+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

カテゴリー: cs.CL パーマリンク