发现大模型在上下文回忆中存在两种独立预测机制。
Decomposing Prediction Mechanisms for In-Context Recall
- 用符号化动态系统构建玩具任务,研究上下文记忆原理。
- 模型先学会中断后恢复状态,再学会持续预测后续状态。
- 不同机制学习速度差异大,适用于理解模型推理过程的科研人员。
我们提出一类新玩具问题,结合连续上下文学习(ICL)与离散关联回忆的特点。预训练变换器模型于随机生成的线性确定性动力系统中符号化交错状态轨迹。研究模型能否在提示对应符号标签时,回忆先前上下文中序列的状态。分析表明,模型需完成两项功能:(1) 识别应回忆的系统并将其应用于最后观测状态;(2) 持续应用正确系统以预测后续状态。训练动态显示,第一项能力在训练后期才出现,而第二项能力却更早发展。通过分布外实验与基于边剪枝的机制分析,发现该任务的下一个词预测涉及至少两种独立机制:一种利用离散符号标签实现关联回忆;另一种几乎无视符号标签,基于前一词和上下文进行类似贝叶斯的预测。两者学习动态不同。为验证该多机制现象是否仅为玩具设定的产物,我们在OLMo训练检查点上对ICL翻译任务进行测试,发现首次任务词与第二次任务词性能之间存在明显涌现差距,支持该现象具有普遍性。
原文摘要 · Abstract (English)
We introduce a new family of toy problems that combine features of linear-regression-style continuous in-context learning (ICL) with discrete associative recall. We pretrain transformer models on sample traces from this toy, specifically symbolically-labeled interleaved state observations from randomly drawn linear deterministic dynamical systems. We study if the transformer models can recall the state of a sequence previously seen in its context when prompted to do so with the corresponding in-context label. Taking a closer look at this task, it becomes clear that the model must perform two functions: (1) identify which system's state should be recalled and apply that system to its last seen state, and (2) continuing to apply the correct system to predict the subsequent states. Training dynamics reveal that the first capability emerges well into a model's training. Surprisingly, the second capability, of continuing the prediction of a resumed sequence, develops much earlier. Via out-of-distribution experiments, and a mechanistic analysis on model weights via edge pruning, we find that next-token prediction for this toy problem involves at least two separate mechanisms. One mechanism uses the discrete symbolic labels to do the associative recall required to predict the start of a resumption of a previously seen sequence. The second mechanism, which is largely agnostic to the discrete symbolic labels, performs a "Bayesian-style" prediction based on the previous token and the context. These two mechanisms have different learning dynamics. To confirm that this multi-mechanism (manifesting as separate phase transitions) phenomenon is not just an artifact of our toy setting, we used OLMo training checkpoints on an ICL translation task to see a similar phenomenon: a decisive gap in the emergence of first-task-token performance vs second-task-token performance.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。