混合训练让大模型更懂知识检索,原理是让存储与查询格式保持一致。
Understanding Fact Recall in Language Models: Why Two-Stage Training Encourages Memorization but Mixed Training Teaches Knowledge
- 混合训练同时优化存储与查询格式,促进表示一致性。
- 在2.8~40亿参数模型上,混合训练召回率显著更高。
- 适合想提升模型知识注入效率的研究者与工程师。
尽管微调是向大语言模型注入事实知识的标准方法,但通过未见查询实现可靠事实召回的机制仍不清晰。常见的两阶段训练策略(先训练存储格式,再训练查询格式)常导致机械记忆。相比之下,混合训练联合优化两种格式,展现出更优的泛化召回能力。我们对比了2.8~40亿参数模型上的两种范式,发现核心机制在于:混合训练中的联合优化目标促使存储与查询格式间梯度一致,进而推动两类表示的一致性,建立与格式无关的检索过程,使未见查询可准确映射至存储事实。而两阶段训练缺乏该目标,导致表示不一致,召回失败。一致性还集中于两类任务共同更新的参数,其规模在混合训练中远大于两阶段训练。输入层面,一致性表现为:混合训练将事实编码为包含主语-关系词元的存储格式,这些词元也存在于查询中;而两阶段训练依赖完整上下文。研究揭示了事实召回的内在机制,为优化知识注入提供了机理基础。
原文摘要 · Abstract (English)
While fine-tuning is the standard for injecting factual knowledge into large language models (LLMs), the mechanisms enabling reliable fact recall via unseen queries remain poorly understood. Common two-stage training strategies, which sequentially train on fact storage and query formats, often cause rote memorization. In contrast, mixed training jointly optimizes both formats and exhibits superior generalized recall. We investigate this success by comparing the two paradigms across 2.8$\sim$4B LLMs and identify the core mechanism: the joint optimization objective in mixed training induces gradient consistency across storage and query formats. This in turn drives the representation consistency between the two formats, establishing a format-invariant retrieval process that maps unseen queries to stored facts. In contrast, the lack of such an objective in two-stage training results in inconsistent representations and failed recall. The consistency further localizes to the parameters updated by both formats, a set that is substantially larger under mixed training than under two-stage training. At the input level, the consistency leaves an interpretable signature: mixed training encodes facts in storage format from subject-relation tokens, the same components available in queries, while two-stage training relies on the full context. Our findings characterize the mechanisms of fact recall and offer mechanistic foundation for optimizing knowledge injection in LLMs.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。