预训练模型能通过提取结构泛化出事实推论,无需额外训练。
Extractive Structures Learned in Pretraining Enable Generalization on Finetuned Facts
- 提出'提取结构'框架,解释模型如何利用权重变化存储并推理事实
- 实验证明:事实必须先于推论出现,才能学习到有效提取结构
- 不同层学到的事实可产生不同泛化能力,适合研究模型推理机制
预训练语言模型能在微调后泛化出所学事实的推论。例如,若微调语句为“约翰·多住在东京”,模型可正确回答“约翰所在城市的人讲什么语言?”为“日语”。然而,该泛化的机制及其在预训练中如何形成仍不清楚。本文引入“提取结构”框架,描述模型中组件(如MLP或注意力头)如何协同实现此类泛化。该结构包含存储训练事实的有信息量组件,以及上游查询和下游处理组件。假设这些结构在预训练中通过遇到已有事实的推论而被学习。由此提出两个预测:数据顺序效应(仅当事实先于推论时才可学习)与权重嫁接效应(可转移至预测反事实推论)。我们在OLMo-7b、Llama 3-8b、Gemma 2-9b和Qwen 2-7b模型中验证了这些现象。此外,结果表明事实学习可发生在早期和晚期层,导致不同形式的泛化。
原文摘要 · Abstract (English)
Pretrained language models (LMs) can generalize to implications of facts that they are finetuned on. For example, if finetuned on ``John Doe lives in Tokyo," LMs can correctly answer ``What language do the people in John Doe's city speak?'' with ``Japanese''. However, little is known about the mechanisms that enable this generalization or how they are learned during pretraining. We introduce extractive structures as a framework for describing how components in LMs (e.g., MLPs or attention heads) coordinate to enable this generalization. The structures consist of informative components that store training facts as weight changes, and upstream and downstream extractive components that query and process the stored information to produce the correct implication. We hypothesize that extractive structures are learned during pretraining when encountering implications of previously known facts. This yields two predictions: a data ordering effect where extractive structures can be learned only if facts precede their implications, and a weight grafting effect where extractive structures can be transferred to predict counterfactual implications. We empirically demonstrate these phenomena in the OLMo-7b, Llama 3-8b, Gemma 2-9b, and Qwen 2-7b models. Of independent interest, our results also indicate that fact learning can occur at both early and late layers, which lead to different forms of generalization.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。