arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2103.02143cs.CL
收藏

随机特征注意力

Random Feature Attention

Paul G. Allen School of Computer Science & Engineering, University of Washington(华盛顿大学保罗·G·艾伦计算机科学与工程学院);DeepMind(深度思维公司);School of Computer Science & Engineering, Hebrew University of Jerusalem(希伯来大学计算机科学与工程学院);Allen Institute for Artificial Intelligence(艾伦人工智能研究所)

Hao Peng, Nikolaos Pappas, Dani Yogatama, Roy Schwartz, Noah A. Smith, Lingpeng Kong

摘要:

Transformers是用于各种序列建模任务的最先进的模型。其核心是一个注意力函数,它对每个时间步的输入之间的成对交互进行建模。虽然注意力是强大的,但由于其在序列长度上的二次时间和空间复杂度,它不能有效地扩展到长序列。我们提出了RFA,一个线性的时间和空间的注意力,使用随机特征的方法来近似softmax函数,并探讨其在Transformers中的应用。RFA可以作为传统softmax注意力的直接替代品,并通过可选的门控机制提供了一种直接的学习方式,具有近因偏差。语言建模和机器翻译的实验表明,RFA实现类似或更好的性能相比,强大的Transformer基线。在机器翻译实验中,RFA的解码速度是普通Transformer的两倍。与现有的高效Transformer变体相比,RFA在三个长文本分类数据集上的准确性和效率方面都具有竞争力。我们的分析表明,RFA的效率增益在长序列上尤其显着,这表明RFA在需要处理大输入、快速解码速度或低内存占用的任务中特别有用。

英文摘要:

Transformers are state-of-the-art models for a variety of sequence modeling tasks. At their core is an attention function which models pairwise interactions between the inputs at every timestep. While attention is powerful, it does not scale efficiently to long sequences due to its quadratic time and space complexity in the sequence length. We propose RFA, a linear time and space attention that uses random feature methods to approximate the softmax function, and explore its application in transformers. RFA can be used as a drop-in replacement for conventional softmax attention and offers a straightforward way of learning with recency bias through an optional gating mechanism. Experiments on language modeling and machine translation demonstrate that RFA achieves similar or better performance compared to strong transformer baselines. In the machine translation experiment, RFA decodes twice as fast as a vanilla transformer. Compared to existing efficient transformer variants, RFA is competitive in terms of both accuracy and efficiency on three long text classification datasets. Our analysis shows that RFA's efficiency gains are especially notable on long sequences, suggesting that RFA will be particularly useful in tasks that require working with large inputs, fast decoding speed, or low memory footprints.

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

↑