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

梯度下降的一步可证明是具有一层线性自注意力的最优上下文学习器

One Step of Gradient Descent is Provably the Optimal In-Context Learner with One Layer of Linear Self-Attention

Stanford University(斯坦福大学)

Arvind Mahankali, Tatsunori B. Hashimoto, Tengyu Ma

AI总结:

本文从理论上证明,在合成线性回归数据上训练的单层线性自注意力Transformer的最优解等价于一步梯度下降,并揭示了协变量分布非各向同性时算法会变为预条件梯度下降,而响应分布变化影响较小。

摘要:

近期工作对上下文学习进行了实证分析,并表明在合成线性回归任务上训练的Transformer在容量充足时可以学会实现岭回归,即贝叶斯最优预测器 [Akyürek et al., 2023];而具有线性自注意力且没有MLP层的一层Transformer将学会在最小二乘线性回归目标上实现一步梯度下降(GD)[von Oswald et al., 2022]。然而,这些观察背后的理论仍未被充分理解。我们从理论上研究了在合成含噪线性回归数据上训练的、具有单层线性自注意力的Transformer。首先,我们数学上证明:当协变量从标准高斯分布中抽取时,最小化预训练损失的一层Transformer将在最小二乘线性回归目标上实现单步GD。然后,我们发现将协变量和权重向量的分布改为非各向同性高斯分布会对所学算法产生强烈影响:预训练损失的全局最小值点现在实现的是单步预条件GD。然而,如果仅改变响应变量的分布,则对所学算法不会产生大的影响:即使响应来自更一般的非线性函数族,预训练损失的全局最小值点仍然在最小二乘线性回归目标上实现单步GD。

英文摘要:

Recent works have empirically analyzed in-context learning and shown that transformers trained on synthetic linear regression tasks can learn to implement ridge regression, which is the Bayes-optimal predictor, given sufficient capacity [Akyürek et al., 2023], while one-layer transformers with linear self-attention and no MLP layer will learn to implement one step of gradient descent (GD) on a least-squares linear regression objective [von Oswald et al., 2022]. However, the theory behind these observations remains poorly understood. We theoretically study transformers with a single layer of linear self-attention, trained on synthetic noisy linear regression data. First, we mathematically show that when the covariates are drawn from a standard Gaussian distribution, the one-layer transformer which minimizes the pre-training loss will implement a single step of GD on the least-squares linear regression objective. Then, we find that changing the distribution of the covariates and weight vector to a non-isotropic Gaussian distribution has a strong impact on the learned algorithm: the global minimizer of the pre-training loss now implements a single step of $\textit{pre-conditioned}$ GD. However, if only the distribution of the responses is changed, then this does not have a large effect on the learned algorithm: even when the response comes from a more general family of $\textit{nonlinear}$ functions, the global minimizer of the pre-training loss still implements a single step of GD on a least-squares linear regression objective.

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

↑