通过分析残差流,可提前发现大模型知识冲突并预测其回答来源。
Analysing the Residual Stream of Language Models Under Knowledge Conflicts
- 探测模型中间激活值中的冲突信号,无需改输入或参数。
- 残差流模式差异显著:上下文知识与参数知识依赖时表现不同。
- 适合研究模型决策机制或提升生成可控性的研究人员。
大语言模型(LLMs)在其参数中存储了大量事实性知识,但这些参数化知识可能与上下文信息冲突,导致模型依赖过时或错误信息。本文研究了LLM能否识别此类知识冲突,并是否可通过分析其残差流来判断模型将依赖哪种知识来源。通过探测任务,我们发现模型能在残差流中内部记录知识冲突信号,且该信号可通过探测中间激活值准确检测,从而在生成答案前就识别冲突。此外,当模型依赖上下文知识或参数知识解决冲突时,残差流表现出显著不同的模式,这些模式可用于预估模型行为并防止意外输出。本分析揭示了模型处理知识冲突的内部机制,为控制知识选择提供了基础。
原文摘要 · Abstract (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.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。