arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2405.16845cs.LGcs.CLstat.ML
收藏

论自回归训练 Transformer 中的 Mesa-Optimization:涌现与能力

On Mesa-Optimization in Autoregressively Trained Transformers: Emergence and Capability

Gaoling School of Artificial Intelligence, Renmin University of China(中国人民大学高瓴人工智能学院);RIKEN AIP(理化学研究所人工智能项目);School of Software, Shandong University(山东大学软件学院);Dept. of Comp. Sci. & Tech., BNRist Center, THU-Bosch ML Center, Tsinghua University(清华大学计算机科学与技术系、BNRist中心、THU-Bosch机器学习中心)

Chenyu Zheng, Wei Huang, Rongzhen Wang, Guoqiang Wu, Jun Zhu, Chongxuan Li

AI总结:

本文分析单层线性因果自注意力在自回归梯度流训练下的非凸动态,证明其可通过一步 OLS 梯度下降形成 mesa-optimizer,并刻画其恢复数据分布的能力边界。

摘要:

自回归训练的 transformer 给世界带来了深刻变革,尤其是其用于解决下游任务的上下文学习(in-context learning,ICL)能力。最近,多项研究表明,transformer 会在自回归(autoregressive,AR)预训练期间学习一个 mesa-optimizer,以实现 ICL。也就是说,经过训练的 transformer 的前向传播等价于在上下文中优化一个内部目标函数。然而,实际的非凸训练动态是否会收敛到理想的 mesa-optimizer 仍不清楚。为填补这一空白,我们研究了一个由梯度流进行自回归训练的单层线性因果自注意力模型的非凸动态,其中序列由 AR 过程 $x_{t+1}=Wx_t$ 生成。首先,在某种数据分布条件下,我们证明自回归训练的 transformer 通过执行一步梯度下降来最小化上下文中的普通最小二乘(ordinary least squares,OLS)问题,从而学习 $W$。随后,它将学到的 $\widehat{W}$ 用于下一 token 预测,由此验证 mesa-optimization 假说。接着,在相同数据条件下,我们探究所得 mesa-optimizer 的能力局限。我们表明,一个与数据矩相关的更强假设是所学 mesa-optimizer 恢复该分布的充分必要条件。此外,我们在首个数据条件之外进行探索性分析,并证明通常情况下,训练后的 transformer 不会对 OLS 问题执行普通梯度下降。最后,我们的仿真结果验证了这些理论结果。

英文摘要:

Autoregressively trained transformers have brought a profound revolution to the world, especially with their in-context learning (ICL) ability to address downstream tasks. Recently, several studies suggest that transformers learn a mesa-optimizer during autoregressive (AR) pretraining to implement ICL. Namely, the forward pass of the trained transformer is equivalent to optimizing an inner objective function in-context. However, whether the practical non-convex training dynamics will converge to the ideal mesa-optimizer is still unclear. Towards filling this gap, we investigate the non-convex dynamics of a one-layer linear causal self-attention model autoregressively trained by gradient flow, where the sequences are generated by an AR process $x_{t+1} = W x_t$. First, under a certain condition of data distribution, we prove that an autoregressively trained transformer learns $W$ by implementing one step of gradient descent to minimize an ordinary least squares (OLS) problem in-context. It then applies the learned $\widehat{W}$ for next-token prediction, thereby verifying the mesa-optimization hypothesis. Next, under the same data conditions, we explore the capability limitations of the obtained mesa-optimizer. We show that a stronger assumption related to the moments of data is the sufficient and necessary condition that the learned mesa-optimizer recovers the distribution. Besides, we conduct exploratory analyses beyond the first data condition and prove that generally, the trained transformer will not perform vanilla gradient descent for the OLS problem. Finally, our simulation results verify the theoretical results.

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

↑