arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2402.14951stat.MLcs.CLcs.LG
收藏

线性Transformer块的上下文学习:MLP组件与一步梯度下降初始化的优势

In-Context Learning of a Linear Transformer Block: Benefits of the MLP Component and One-Step GD Initialization

University of California, Berkeley(加州大学伯克利分校);Google DeepMind(谷歌DeepMind)

Ruiqi Zhang, Jingfeng Wu, Peter L. Bartlett

AI总结:

本文研究线性Transformer块的上下文学习能力,证明其结合MLP组件可实现接近贝叶斯最优的ICL风险,并揭示其与一步梯度下降估计器的对应关系,凸显MLP层在降低近似误差中的关键作用。

摘要:

我们研究了一种线性Transformer块(LTB)的上下文学习(ICL)能力,该模块结合了线性注意力组件和线性多层感知机(MLP)组件。针对具有高斯先验和非零均值的线性回归的ICL问题,我们证明LTB能够实现接近贝叶斯最优的ICL风险。相比之下,仅使用线性注意力必然会产生不可消除的加性近似误差。此外,我们建立了LTB与具有可学习初始化的一步梯度下降估计器(GD-β)之间的对应关系,即每个GD-β估计器都可以由一个LTB估计器实现,并且每个最小化类内ICL风险的最优LTB估计器实际上都是一个GD-β估计器。最后,我们证明尽管训练目标是非凸的,GD-β估计器仍可以通过梯度流进行高效优化。我们的结果揭示了LTB通过实现GD-β来完成ICL,并凸显了MLP层在降低近似误差方面的作用。

英文摘要:

We study the \emph{in-context learning} (ICL) ability of a \emph{Linear Transformer Block} (LTB) that combines a linear attention component and a linear multi-layer perceptron (MLP) component. For ICL of linear regression with a Gaussian prior and a \emph{non-zero mean}, we show that LTB can achieve nearly Bayes optimal ICL risk. In contrast, using only linear attention must incur an irreducible additive approximation error. Furthermore, we establish a correspondence between LTB and one-step gradient descent estimators with learnable initialization ($\mathsf{GD}\text{-}\mathbfβ$), in the sense that every $\mathsf{GD}\text{-}\mathbfβ$ estimator can be implemented by an LTB estimator and every optimal LTB estimator that minimizes the in-class ICL risk is effectively a $\mathsf{GD}\text{-}\mathbfβ$ estimator. Finally, we show that $\mathsf{GD}\text{-}\mathbfβ$ estimators can be efficiently optimized with gradient flow, despite a non-convex training objective. Our results reveal that LTB achieves ICL by implementing $\mathsf{GD}\text{-}\mathbfβ$, and they highlight the role of MLP layers in reducing approximation error.

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

↑