重新思考注意力机制:Performer

Rethinking Attention with Performers

克日什托夫·乔罗曼斯基 Krzysztof Choromanski · Google · 2020-09-30 · arXiv:2009.14794 ↗ · 被引 2330

打开互动全文版(逐段中英对照 + 图/公式 + 论文问答)→

摘要 · Abstract

我们引入了 Performer,这是一种 Transformer 架构,能够以可证明的精度估计常规(softmax)全秩注意力 Transformer,但仅使用线性(而非二次)空间和时间复杂度,且不依赖于任何先验假设(如稀疏性或低秩性)。为了近似 softmax 注意力核,Performer 采用了一种新颖的基于正正交随机特征的快速注意力方法(FAVOR+),该方法对于可扩展的核方法可能具有独立的意义。FAVOR+还可用于高效建模除 softmax 之外的其他可核化注意力机制。这种表示能力对于首次在超出常规 Transformer 能力范围的大规模任务上精确比较 softmax 与其他核,并研究最优注意力核至关重要。Performer 是线性架构,与常规 Transformer 完全兼容,并具有强大的理论保证:注意力矩阵的无偏或近似无偏估计、一致收敛性和低估计方差。我们在从像素预测到文本模型再到蛋白质序列建模的丰富任务集上测试了 Performer。我们展示了与其他经过检验的高效稀疏和密集注意力方法相比具有竞争力的结果,突显了 Performer 所利用的新型注意力学习范式的有效性。

We introduce Performers, Transformer architectures which can estimate regular (softmax) full-rank-attention Transformers with provable accuracy, but using only linear (as opposed to quadratic) space and time complexity, without relying on any priors such as sparsity or low-rankness. To approximate softmax attention-kernels, Performers use a novel Fast Attention Via positive Orthogonal Random features approach (FAVOR+), which may be of independent interest for scalable kernel methods. FAVOR+ can be also used to efficiently model kernelizable attention mechanisms beyond softmax. This representational power is crucial to accurately compare softmax with other kernels for the first time on large-scale tasks, beyond the reach of regular Transformers, and investigate optimal attention-kernels. Performers are linear architectures fully compatible with regular Transformers and with strong theoretical guarantees: unbiased or nearly-unbiased estimation of the attention matrix, uniform convergence and low estimation variance. We tested Performers on a rich set of tasks stretching from pixel-prediction through text models to protein sequence modeling. We demonstrate competitive results with other examined efficient sparse and dense attention methods, showcasing effectiveness of the novel attention-learning paradigm leveraged by Performers.

核心贡献 · Key contributions

局限 · Limitations

论文章节 · Sections(共 17)

阅读逐段中英对照全文 →