arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2507.01414cs.LG
收藏

分解上下文召回中的预测机制

Decomposing Prediction Mechanisms for In-Context Recall

University of California, Berkeley(加州大学伯克利分校);University of Pennsylvania(宾夕法尼亚大学)

Sultan Daniels, Dylan Davis, Dhruv Gautam, Wentinn Liao, Gireeja Ranade, Anant Sahai

AI总结:

通过设计结合连续上下文学习与离散关联召回的新玩具问题,发现Transformer模型在上下文召回任务中存在两种具有不同学习动态的独立机制:一种依赖离散符号标签进行关联召回,另一种基于前一个token和上下文进行贝叶斯式预测。

摘要:

我们引入了一类新的玩具问题,将线性回归风格的连续上下文学习(ICL)特征与离散关联召回相结合。我们在该玩具的样本轨迹上预训练Transformer模型,具体是从随机抽取的线性确定性动力系统中提取的符号标记交错状态观测。我们研究当模型被提示使用相应的上下文标签时,是否能够召回先前在其上下文中见过的序列的状态。仔细观察这个任务,很明显模型必须执行两个功能:(1)识别应召回哪个系统的状态,并将该系统应用于其最后看到的状态;(2)继续应用正确的系统来预测后续状态。训练动态表明,第一个能力在模型训练中后期才出现。令人惊讶的是,第二个能力(继续预测恢复的序列)发展得更早。通过分布外实验和通过边缘剪枝对模型权重的机制分析,我们发现这个玩具问题的下一个token预测涉及至少两个独立的机制。一种机制使用离散符号标签进行关联召回,以预测先前见过的序列恢复的开始。第二种机制在很大程度上与离散符号标签无关,基于前一个token和上下文进行“贝叶斯式”预测。这两种机制具有不同的学习动态。为了确认这种多机制现象(表现为不同的相变)不仅仅是玩具设置的人为产物,我们使用OLMo在ICL翻译任务上的训练检查点观察到了类似的现象:第一个任务token的性能与第二个任务token的性能出现决定性差距。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑