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

自注意力的特征分析及其部分计算重构

Eigen Analysis of Self-Attention and its Reconstruction from Partial Computation

Google Research(谷歌研究院)

Srinadh Bhojanapalli, Ayan Chakrabarti, Himanshu Jain, Sanjiv Kumar, Michal Lukasik, Andreas Veit

摘要:

最先进的Transformer模型使用基于成对点积的自注意力,其计算成本是输入序列长度的二次方。在本文中,我们调查的全球结构的注意力分数计算使用这种点积机制上的一个典型的分布的输入,并研究其变化的主成分。通过特征分析的完整的注意力得分矩阵,以及他们的个人行,我们发现,大部分的注意力得分之间的变化在于在一个低维的特征空间。此外,我们发现这些特征空间之间的显着重叠,为不同的层,甚至不同的Transformer模型。在此基础上,我们建议只计算分数的令牌对的一部分子集,并使用它们来估计分数的其余对。除了研究重建注意力分数本身的准确性之外,我们还研究了采用这些近似的训练Transformer模型,并分析了对整体准确性的影响。我们的分析和所提出的方法提供了如何平衡精确的成对注意力的好处及其显着的计算费用的见解。

英文摘要:

State-of-the-art transformer models use pairwise dot-product based self-attention, which comes at a computational cost quadratic in the input sequence length. In this paper, we investigate the global structure of attention scores computed using this dot product mechanism on a typical distribution of inputs, and study the principal components of their variation. Through eigen analysis of full attention score matrices, as well as of their individual rows, we find that most of the variation among attention scores lie in a low-dimensional eigenspace. Moreover, we find significant overlap between these eigenspaces for different layers and even different transformer models. Based on this, we propose to compute scores only for a partial subset of token pairs, and use them to estimate scores for the remaining pairs. Beyond investigating the accuracy of reconstructing attention scores themselves, we investigate training transformer models that employ these approximations, and analyze the effect on overall accuracy. Our analysis and the proposed method provide insights into how to balance the benefits of exact pair-wise attention and its significant computational expense.

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

↑