arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2402.01258stat.MLcs.LG
收藏

Transformers在上下文中学习非线性特征:注意力景观上的非凸平均场动力学

Transformers Learn Nonlinear Features In Context: Nonconvex Mean-field Dynamics on the Attention Landscape

University of Tokyo(东京大学);RIKEN(理化学研究所)

Juno Kim, Taiji Suzuki

AI总结:

研究由MLP和线性注意力层组成的Transformer的优化,证明在平均场极限下参数分布的无穷维非凸损失景观变得温和,并首次对一般平均场动力学进行鞍点分析。

摘要:

基于Transformer架构的大型语言模型已展现出令人印象深刻的上下文学习能力。然而,关于这一现象如何产生的现有理论研究仅限于在线性回归任务上训练的单层注意力的动力学。在本文中,我们研究了一个由全连接层和随后的线性注意力层组成的Transformer的优化。MLP作为共同的非线性表示或特征映射,极大地增强了上下文学习的能力。我们在平均场和双时间尺度极限中证明了,参数分布的无穷维损失景观虽然高度非凸,但变得相当温和。我们还分析了平均场动力学的二阶稳定性,并表明Wasserstein梯度流几乎总是避开鞍点。此外,我们建立了新方法,用于在远离和接近临界点时获得具体的改进率。这代表了首次对一般平均场动力学进行鞍点分析,这些技术具有独立的意义。

英文摘要:

Large language models based on the Transformer architecture have demonstrated impressive capabilities to learn in context. However, existing theoretical studies on how this phenomenon arises are limited to the dynamics of a single layer of attention trained on linear regression tasks. In this paper, we study the optimization of a Transformer consisting of a fully connected layer followed by a linear attention layer. The MLP acts as a common nonlinear representation or feature map, greatly enhancing the power of in-context learning. We prove in the mean-field and two-timescale limit that the infinite-dimensional loss landscape for the distribution of parameters, while highly nonconvex, becomes quite benign. We also analyze the second-order stability of mean-field dynamics and show that Wasserstein gradient flow almost always avoids saddle points. Furthermore, we establish novel methods for obtaining concrete improvement rates both away from and near critical points. This represents the first saddle point analysis of mean-field dynamics in general and the techniques are of independent interest.

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

↑