Luna:线性统一嵌套注意力
Luna: Linear Unified Nested Attention
摘要:
Transformer的注意力机制的二次计算和存储复杂性限制了其对长序列建模的可扩展性。在本文中,我们提出了Luna,一个线性统一的嵌套注意力机制,它用两个嵌套的线性注意力函数近似softmax注意力,只产生线性(而不是二次)时间和空间复杂度。具体来说,在第一个attention函数中,Luna将输入序列打包成一个固定长度的序列。然后,使用第二注意函数对打包的序列进行解包。与传统的注意力机制相比,Luna引入了一个固定长度的附加序列作为输入和一个附加的相应输出,这使得Luna能够线性地执行注意力操作,同时还存储了足够的上下文信息。我们对序列建模任务的三个基准进行了广泛的评估:长上下文序列建模,神经机器翻译和大规模预训练的掩蔽语言建模。具有竞争力甚至更好的实验结果证明了Luna与各种
英文摘要:
The quadratic computational and memory complexities of the Transformer's attention mechanism have limited its scalability for modeling long sequences. In this paper, we propose Luna, a linear unified nested attention mechanism that approximates softmax attention with two nested linear attention functions, yielding only linear (as opposed to quadratic) time and space complexity. Specifically, with the first attention function, Luna packs the input sequence into a sequence of fixed length. Then, the packed sequence is unpacked using the second attention function. As compared to a more traditional attention mechanism, Luna introduces an additional sequence with a fixed length as input and an additional corresponding output, which allows Luna to perform attention operation linearly, while also storing adequate contextual information. We perform extensive evaluations on three benchmarks of sequence modeling tasks: long-context sequence modeling, neural machine translation and masked language modeling for large-scale pretraining. Competitive or even better experimental results demonstrate both the effectiveness and efficiency of Luna compared to a variety
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。