Skip to main content
QUICK REVIEW

[论文解读] Large Language Models with Controllable Working Memory

Daliang Li, Ankit Singh Rawat|arXiv (Cornell University)|Nov 9, 2022
Topic Modeling被引用 5
一句话总结

本文提出知识感知微调(KAFT),一种通过训练大语言模型优先考虑任务相关上下文而非记忆的世界知识,以增强其可控性和鲁棒性的方法。KAFT 在微调过程中使用反事实和无关上下文的数据增强,显著提升了模型在冲突或干扰输入下的表现,同时不损害标准性能。

ABSTRACT

Large language models (LLMs) have led to a series of breakthroughs in natural language processing (NLP), owing to their excellent understanding and generation abilities. Remarkably, what further sets these models apart is the massive amounts of world knowledge they internalize during pretraining. While many downstream applications provide the model with an informational context to aid its performance on the underlying task, how the model's world knowledge interacts with the factual information presented in the context remains under explored. As a desirable behavior, an LLM should give precedence to the context whenever it contains task-relevant information that conflicts with the model's memorized knowledge. This enables model predictions to be grounded in the context, which can then be used to update or correct specific model predictions without frequent retraining. By contrast, when the context is irrelevant to the task, the model should ignore it and fall back on its internal knowledge. In this paper, we undertake a first joint study of the aforementioned two properties, namely controllability and robustness, in the context of LLMs. We demonstrate that state-of-the-art T5 and PaLM (both pretrained and finetuned) could exhibit poor controllability and robustness, which do not scale with increasing model size. As a solution, we propose a novel method - Knowledge Aware FineTuning (KAFT) - to strengthen both controllability and robustness by incorporating counterfactual and irrelevant contexts to standard supervised datasets. Our comprehensive evaluation showcases the utility of KAFT across model architectures and sizes.

研究动机与目标

  • 探究大语言模型(LLMs)在记忆的世界知识与特定任务上下文发生冲突时的处理方式。
  • 发现像 T5 和 PaLM 这类最先进的 LLM 在规模增大时仍表现出较差的可控性和鲁棒性。
  • 开发一种方法,使 LLM 在上下文与内部知识矛盾时能正确优先考虑上下文,同时忽略无关上下文。
  • 提出一种微调方法,在不降低标准基准性能的前提下强化模型行为。

提出的方法

  • KAFT 通过在标准监督数据集上添加反事实上下文(即上下文与记忆的知识相矛盾)和无关上下文(与任务无关)实现数据增强。
  • 该方法在这些增强数据集上微调 LLM,以教会模型在上下文相关时抑制记忆的知识,并忽略无关上下文。
  • 训练使用一种损失函数,鼓励模型即使在与预训练知识冲突时,仍生成与上下文一致的答案。
  • 该方法被应用于 T5 和 PaLM 架构的多个尺寸模型上,包括 540B 参数模型。
  • KAFT 不需要重新训练或权重编辑;相反,它通过上下文控制在推理过程中修改激活模式。
  • 该方法通过在 TriviaQA 上使用反事实增强和上下文相关性过滤进行评估,以隔离可控性和鲁棒性的影响。

实验结果

研究问题

  • RQ1大语言模型能否被有效训练为在上下文与记忆的世界知识冲突时优先考虑上下文而非记忆的知识?
  • RQ2在存在冲突或无关上下文的情况下,模型规模如何影响可控性和鲁棒性?
  • RQ3单一微调过程能否在不降低标准性能的前提下同时提升可控性和鲁棒性?
  • RQ4使用反事实和无关上下文进行数据增强在多大程度上改善了模型行为?
  • RQ5模型能否被训练为忽略无关上下文,即使这些上下文在事实上合理或语义上相关?

主要发现

  • KAFT 将闭卷答案与反事实答案的匹配率从 PaLM 540B 的 0.6% 降低至 0.7%,表明对错误答案的记忆显著减少。
  • 对于 PaLM 62B,KAFT 将头部反事实问题的可控性匹配率从 1.4% 降低至 1.3%,显示出持续的改进。
  • 在 T5 XXL 上,KAFT 将可控性匹配率从 6.6% 提升至 6.8%,证明了其在不同模型尺寸上的有效性。
  • 在移除 TriviaQA 数据后,KAFT 在 T5 XXL 和 PaLM 62B 上的可控性分别达到 52% 和 69%,优于噪声微调方法。
  • 该方法在保持标准指标强性能的同时,显著改善了上下文控制场景下的模型行为。
  • 即使在训练期间未使用 TriviaQA 数据,KAFT 仍能实现高可控性,表明其对数据分布偏移具有鲁棒性。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。