[论文解读] A Theory of Emergent In-Context Learning as Implicit Structure Induction
本文提出,大型语言模型中的上下文学习(ICL)源于预训练数据中组合性操作的隐式结构归纳。通过将语言形式化为组合语法并推导信息论界限,作者表明,当数据包含足够的结构多样性时,仅通过下一个词预测即可实现ICL,该结论通过一个受控设置得到验证,其中ICL随模型规模增加而出现,并且通过思维链提示进一步提升。
Scaling large language models (LLMs) leads to an emergent capacity to learn in-context from example demonstrations. Despite progress, theoretical understanding of this phenomenon remains limited. We argue that in-context learning relies on recombination of compositional operations found in natural language data. We derive an information-theoretic bound showing how in-context learning abilities arise from generic next-token prediction when the pretraining distribution has sufficient amounts of compositional structure, under linguistically motivated assumptions. A second bound provides a theoretical justification for the empirical success of prompting LLMs to output intermediate steps towards an answer. To validate theoretical predictions, we introduce a controlled setup for inducing in-context learning; unlike previous approaches, it accounts for the compositional nature of language. Trained transformers can perform in-context learning for a range of tasks, in a manner consistent with the theoretical results. Mirroring real-world LLMs in a miniature setup, in-context learning emerges when scaling parameters and data, and models perform better when prompted to output intermediate steps. Probing shows that in-context learning is supported by a representation of the input's compositional structure. Taken together, these results provide a step towards theoretical understanding of emergent behavior in large language models.
研究动机与目标
- 为大型语言模型中涌现的上下文学习(ICL)建立理论基础。
- 解释为何ICL源于通用的下一个词预测,而无需专门的微调。
- 形式化组合结构在实现广泛ICL能力中的作用。
- 通过一个受控的、基于语言学动机的实验设置验证该理论,该设置模拟真实世界LLM的行为。
- 利用理论界限解释思维链提示在实证上的成功。
提出的方法
- 理论分析推导出一个信息论界限,表明当预训练数据包含足够的组合结构时,ICL将出现,且在基于语言学动机的假设下成立。
- 构建了一种新颖的受控数据集,使用一阶逻辑和隐马尔可夫模型(HMMs)来模拟具有不同结构多样性的组合数据生成。
- 在逻辑世界模型中定义任务,模型在具有受控变化的对象集合 $|Ω|$ 和函数集合 $|ℜ|$ 的组合文本上进行训练。
- 推导理论界限,以解释为何提示模型生成中间步骤(思维链)能提升ICL性能。
- 探针实验检验表示是否编码了组合结构,从而支持该理论。
- 消融研究隔离了循环、量词和条件语句等组件,以测试其对ICL的必要性。
实验结果
研究问题
- RQ1在何种条件下,大型语言模型中的上下文学习会从通用的下一个词预测中涌现?
- RQ2预训练数据中的组合结构如何使ICL在多样化任务中广泛实现?
- RQ3为何思维链提示能提升上下文学习性能?
- RQ4模型参数量和数据规模在多大程度上驱动了ICL的涌现?
- RQ5表示组合结构在实现ICL中起到何种作用?
主要发现
- 在受控设置中,ICL随着模型和数据规模的增加而突然出现,与真实世界LLM的行为一致,尽管模型仅通过下一个词预测进行训练。
- 当模型被提示生成中间步骤时,ICL性能显著提升,与定理2推导出的理论优势一致。
- 理论界限预测ICL的成功取决于任务组合描述的复杂度 $\operatorname{D}[\tau_{\phi}]$,该预测已通过实证验证。
- 消融研究显示,引入变量的结构(如循环、'存在某个')对ICL至关重要,而条件语句则相对不那么关键。
- 探针实验表明,模型表示编码了输入的组合结构,支持了隐式结构归纳的理论。
- ICL对非自然的提示格式具有鲁棒性,表明该机制依赖于结构泛化,而非表面形式。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。