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

Nyströmformer:一种基于Nyström的近似自注意算法

Nyströmformer: A Nyström-Based Algorithm for Approximating Self-Attention

University of Wisconsin-Madison(威斯康星大学麦迪逊分校);UC Berkeley(加州大学伯克利分校);Google Brain(谷歌大脑);American Family Insurance(美国家庭保险公司)

Yunyang Xiong, Zhanpeng Zeng, Rudrasis Chakraborty, Mingxing Tan, Glenn Fung, Yin Li, Vikas Singh

摘要:

Transformers已经成为广泛的自然语言处理任务的强大工具。推动Transformers令人印象深刻的性能的一个关键组件是自我注意力机制,它对其他令牌对每个特定令牌的影响或依赖进行编码。虽然有益,但输入序列长度上自我注意的二次复杂性限制了其应用于更长的序列-这是社区中正在积极研究的主题。为了解决这一限制,我们提出了Nyströmformer -一种模型,具有良好的可扩展性作为序列长度的函数。我们的想法是基于适应Nyström方法近似标准的自我注意与$O(n)$复杂性。Nyströmformer的可扩展性使应用程序能够应用于具有数千个令牌的更长序列。我们在GLUE基准测试和IMDB评论中使用标准序列长度对多个下游任务进行了评估,发现我们的Nyströmformer的性能优于标准自我注意力,或者在少数情况下甚至略好于标准自我注意力。在长距离竞技场(LRA)基准测试中,在较长序列的任务上,Nyströmmormer相对于其他有效的自我注意方法表现良好。我们的代码可在https://github.com/mlpen/Nystromformer上获得。

英文摘要:

Transformers have emerged as a powerful tool for a broad range of natural language processing tasks. A key component that drives the impressive performance of Transformers is the self-attention mechanism that encodes the influence or dependence of other tokens on each specific token. While beneficial, the quadratic complexity of self-attention on the input sequence length has limited its application to longer sequences -- a topic being actively studied in the community. To address this limitation, we propose Nyströmformer -- a model that exhibits favorable scalability as a function of sequence length. Our idea is based on adapting the Nyström method to approximate standard self-attention with $O(n)$ complexity. The scalability of Nyströmformer enables application to longer sequences with thousands of tokens. We perform evaluations on multiple downstream tasks on the GLUE benchmark and IMDB reviews with standard sequence length, and find that our Nyströmformer performs comparably, or in a few cases, even slightly better, than standard self-attention. On longer sequence tasks in the Long Range Arena (LRA) benchmark, Nyströmformer performs favorably relative to other efficient self-attention methods. Our code is available at https://github.com/mlpen/Nystromformer.

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

↑