语言模型中的推理-记忆交互由单一方向介导
The Reasoning-Memorization Interplay in Language Models Is Mediated by a Single Direction
AI总结:
本研究通过识别残差流中的线性特征,揭示了语言模型在推理与记忆间切换的机制,并证明干预这些特征可提升推理表现。
摘要:
大型语言模型(LLMs)在各种推理基准测试中表现出色,但先前的研究表明,它们有时难以泛化到未见过的题目,这可能是由于过度依赖记忆化的训练样本。然而,LLMs在文本生成过程中何时在推理与记忆之间切换的具体条件仍不清楚。在本工作中,我们通过识别模型残差流中一组线性特征,对LLMs的推理-记忆动态提供了机制层面的理解,这些特征控制着真实推理与记忆回忆之间的平衡。这些特征不仅能区分推理任务与记忆密集型任务,还可以通过操纵它们来因果性地影响模型在推理任务上的表现。此外,我们表明,干预这些推理特征有助于模型在答案生成过程中更准确地激活最相关的问题解决能力。我们的发现为理解LLMs中推理与记忆的底层机制提供了新见解,并为开发更稳健、可解释的生成式AI系统铺平了道路。
英文摘要:
Large language models (LLMs) excel on a variety of reasoning benchmarks, but previous studies suggest they sometimes struggle to generalize to unseen questions, potentially due to over-reliance on memorized training examples. However, the precise conditions under which LLMs switch between reasoning and memorization during text generation remain unclear. In this work, we provide a mechanistic understanding of LLMs' reasoning-memorization dynamics by identifying a set of linear features in the model's residual stream that govern the balance between genuine reasoning and memory recall. These features not only distinguish reasoning tasks from memory-intensive ones but can also be manipulated to causally influence model performance on reasoning tasks. Additionally, we show that intervening in these reasoning features helps the model more accurately activate the most relevant problem-solving capabilities during answer generation. Our findings offer new insights into the underlying mechanisms of reasoning and memory in LLMs and pave the way for the development of more robust and interpretable generative AI systems.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。