arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2105.14103cs.LGcs.CLcs.CV
收藏

一个免注意的Transformer

An Attention Free Transformer

Apple Inc.(苹果公司);MILA(米拉研究所)

Shuangfei Zhai, Walter Talbott, Nitish Srivastava, Chen Huang, Hanlin Goh, Ruixiang Zhang, Josh Susskind

摘要:

我们介绍注意自由Transformer(AFT),一个有效的变种Transformers,消除了点积自注意力的需要。在AFT层中,键和值首先与一组学习的位置偏差组合,其结果以元素方式与查询相乘。这种新的操作具有线性w.r.t.的内存复杂度。上下文大小和特征的维度,使其兼容大输入和模型大小。我们还介绍了AFT-local和AFT-conv,这两个模型变体利用了局部性和空间权重共享的思想,同时保持了全局连通性。我们对两个自回归建模任务(CIFAR 10和Enwik 8)以及图像识别任务(ImageNet-1 K分类)进行了广泛的实验。我们表明,AFT在所有基准测试中表现出具有竞争力的性能,同时提供出色的效率。

英文摘要:

We introduce Attention Free Transformer (AFT), an efficient variant of Transformers that eliminates the need for dot product self attention. In an AFT layer, the key and value are first combined with a set of learned position biases, the result of which is multiplied with the query in an element-wise fashion. This new operation has a memory complexity linear w.r.t. both the context size and the dimension of features, making it compatible to both large input and model sizes. We also introduce AFT-local and AFT-conv, two model variants that take advantage of the idea of locality and spatial weight sharing while maintaining global connectivity. We conduct extensive experiments on two autoregressive modeling tasks (CIFAR10 and Enwik8) as well as an image recognition task (ImageNet-1K classification). We show that AFT demonstrates competitive performance on all the benchmarks, while providing excellent efficiency at the same time.

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

↑