Steering Knowledge Selection Behaviours in LLMs via SAE-Based Representation Engineering
该论文提出了一种基于稀疏自编码器的表示工程方法SPARE,用于控制大型语言模型在推理时的知识选择行为,有效解决了知识冲突问题。
更新于 2024-11-09。作者:Yu Zhao、Alessio Devoto、Giwon Hong、Xiaotang Du、Aryo Pradipta Gema、Hongru Wang、Kam-Fai Wong、Pasquale Minervini。
中文摘要
大型语言模型(LLMs)可以在其参数中存储大量的事实知识。然而,它们的参数知识可能与上下文中提供的信息相冲突——这种现象被称为上下文-记忆知识冲突,可能导致不理想模型行为,例如依赖过时或错误的信息。通过分析LLMs的内部激活,我们发现它们可以在中间层内部注册知识冲突的信号。这些信号使我们能够检测是否发生知识冲突,并使用推理时干预策略来解决这个问题。在本工作中,我们提出了SpARE,这是一种无训练的表示工程方法,它使用预训练的稀疏自编码器(SAEs)来控制LLMs的知识选择行为。SpARE识别出控制知识选择行为的函数特征,并在推理时间将它们应用于编辑LLMs的内部激活。我们的实验结果表明,SpARE可以有效地控制使用任一知识源来在开放域问答任务中解决知识冲突,超越了现有的表示工程方法(+10%)以及对比解码方法(+15%)。
英文摘要
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 -- this phenomenon, known as context-memory knowledge conflicts, can lead to undesirable model behaviour, such as reliance on outdated or incorrect information. Analysing the internal activations of LLMs, we find that they can internally register the signals of knowledge conflict at mid-layers. Such signals allow us to detect whether a knowledge conflict occurs and use inference-time intervention strategies to resolve it. In this work, we propose SpARE, a training-free representation engineering method that uses pre-trained sparse auto-encoders (SAEs) to control the knowledge selection behaviour of LLMs. SpARE identifies the functional features that control the knowledge selection behaviours and applies them to edit the internal activations of LLMs at inference time. Our experimental results show that SpARE can effectively control the usage of either knowledge source to resolve knowledge conflict in open-domain question-answering tasks, surpassing existing representation engineering methods (+10%) as well as contrastive decoding methods (+15%).
解读
一句话总结
该论文提出了一种基于稀疏自编码器的表示工程方法SPARE,用于控制大型语言模型在推理时的知识选择行为,有效解决了知识冲突问题。
问题1:这篇论文想要解决什么具体问题?
• 问题背景:大型语言模型(LLMs)在参数中存储了大量的知识,但这些知识可能与上下文信息冲突,导致模型依赖过时或不正确的信息。 • 现有方案不足:现有的解决方案需要额外的模型交互,导致延迟高,不适用于实际应用。 • 研究目标:提出一种无训练的表示工程方法,在推理时控制LLMs的知识选择行为,以解决知识冲突问题。
问题2:论文的核心创新点是什么?
• 技术创新:提出SPARE方法,利用预训练的稀疏自编码器(SAEs)控制LLMs的知识选择行为。 • 方法改进:通过编辑LLMs的内部激活来引导知识选择,提高控制精度。 • 优势:相比现有方法,SPARE在开放域问答任务中能够更有效地控制知识选择,提升性能。
问题3:实验结果如何验证了方法的有效性?
• 关键实验:在开放域问答任务中使用NQSwap和Macnoise数据集进行实验。 • 性能提升:SPARE在控制知识选择行为方面比现有表示工程方法和对比解码方法表现更优,性能提升超过10%和15%。 • 对比结果:与基线方法相比,SPARE在控制知识选择行为方面取得了显著的性能提升。
问题4:这个研究的实际应用价值是什么?
• 应用场景:可应用于需要精确控制知识选择的领域,如问答系统、智能客服等。 • 实施建议:结合实际应用场景,选择合适的LLMs和SAEs,优化SPARE方法。 • 局限与展望:SPARE方法依赖于预训练的SAEs,可能不适用于所有模型;未来可探索更通用的知识冲突解决方案。
来源
机器可读索引:llms.txt