arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2404.00859cs.LGcs.CL
收藏

语言模型会为未来的token提前规划吗?

Do language models plan ahead for future tokens?

University of Colorado Boulder(科罗拉多大学博尔德分校);Cornell University(康奈尔大学)

Wilson Wu, John X. Morris, Lionel Levine

AI总结:

本文研究Transformer是否在推理时为未来token提前准备信息,提出预缓存和面包屑两种假设,并通过短视训练实验验证,发现合成数据中存在预缓存,而自回归语言建模更支持面包屑假设。

摘要:

Transformer在推理过程中,在给定位置上是否会“提前思考”?已知Transformer在前向传播的时间步t的隐藏状态中准备了信息,这些信息随后被用于未来的前向传播t+τ。我们对这一现象提出两种解释:预缓存,即在训练期间存在的非对角梯度项导致模型在t处计算与当前推理任务无关但对未来有用的特征;以及面包屑,即与时间步t最相关的特征已经与那些最有利于时间步t+τ推理的特征相同。我们通过训练语言模型时不将梯度传播到过去的时间步来检验这些假设,我们将该方案形式化为短视训练。在构造的合成数据环境中,我们发现了预缓存的明确证据。在自回归语言建模环境中,我们的实验更倾向于支持面包屑假设,尽管预缓存随着模型规模的增大而增加。

英文摘要:

Do transformers "think ahead" during inference at a given position? It is known transformers prepare information in the hidden states of the forward pass at time step $t$ that is then used in future forward passes $t+τ$. We posit two explanations for this phenomenon: pre-caching, in which off-diagonal gradient terms present during training result in the model computing features at $t$ irrelevant to the present inference task but useful for the future, and breadcrumbs, in which features most relevant to time step $t$ are already the same as those that would most benefit inference at time $t+τ$. We test these hypotheses by training language models without propagating gradients to past timesteps, a scheme we formalize as myopic training. In a constructed synthetic data setting, we find clear evidence for pre-caching. In the autoregressive language modeling setting, our experiments are more suggestive of the breadcrumbs hypothesis, though pre-caching increases with model scale.

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

↑