Scholay

学术搜索 · AI 审稿 · LaTeX 协作

An Attention Free Transformer

作者:Shuangfei Zhai, Walter Talbott, Nitish Srivastava, Chen Huang, Hanlin Goh, Zhang, Ruixiang, Susskind, Josh · 发表于:arXiv (Cornell University) · 年份:2021 · DOI:10.48550/arxiv.2105.14103 · 被引用次数:42 · 研究领域:Advanced Neural Network Applications、Multimodal Machine Learning Applications、Domain Adaptation and Few-Shot Learning

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.