arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2402.03902cs.LG
收藏

点积注意力可解模型中位置学习与语义学习之间的相变

A phase transition between positional and semantic learning in a solvable model of dot-product attention

EPFL(洛桑联邦理工学院)

Hugo Cui, Freya Behrens, Florent Krzakala, Lenka Zdeborová

AI总结:

该研究针对点积注意力可解模型开展理论分析,刻画了非凸损失全局最小值对应的位置与语义注意力机制,揭示了样本复杂度提升下二者的涌现阶段变,证实足量数据下点积注意力凭借语义机制优于线性位置基线。

摘要:

许多实证研究已为语言模型学习过程中算法机制(能力)的涌现提供了证据,这类机制会带来模型能力的质性提升。然而,关于此类机制如何涌现的理论刻画仍付之阙如。本文朝着这一方向迈出一步,对一个点积注意力可解模型中语义注意力的涌现开展了严密的理论分析。更具体地说,我们研究了一个具有可训练绑定低秩查询矩阵和键矩阵的非线性自注意力层。在高维数据且训练样本数量相当大的渐近极限下,我们对非凸经验损失曲面的全局最小值给出了严密的闭式刻画。我们证明,该最小值要么对应位置注意力机制(令牌基于各自的位置相互关注),要么对应语义注意力机制(令牌基于自身含义相互关注),并且证实随着样本复杂度提升,会出现从前者到后者的涌现阶段变。最后,我们将点积注意力层与线性位置基线进行比较,证明只要有足够的数据,点积注意力层借助语义机制的表现会优于后者。

英文摘要:

Many empirical studies have provided evidence for the emergence of algorithmic mechanisms (abilities) in the learning of language models, that lead to qualitative improvements of the model capabilities. Yet, a theoretical characterization of how such mechanisms emerge remains elusive. In this paper, we take a step in this direction by providing a tight theoretical analysis of the emergence of semantic attention in a solvable model of dot-product attention. More precisely, we consider a non-linear self-attention layer with trainable tied and low-rank query and key matrices. In the asymptotic limit of high-dimensional data and a comparably large number of training samples we provide a tight closed-form characterization of the global minimum of the non-convex empirical loss landscape. We show that this minimum corresponds to either a positional attention mechanism (with tokens attending to each other based on their respective positions) or a semantic attention mechanism (with tokens attending to each other based on their meaning), and evidence an emergent phase transition from the former to the latter with increasing sample complexity. Finally, we compare the dot-product attention layer to a linear positional baseline, and show that it outperforms the latter using the semantic mechanism provided it has access to sufficient data.

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

↑