具有快速查找和固定大小表示的廉价线性注意力机制
A Cheap Linear Attention Mechanism with Fast Lookups and Fixed-Size Representations
摘要:
softmax基于内容的注意力机制已被证明在递归神经网络的许多应用中非常有益。然而,它受到两个主要的计算限制。首先,它对注意力查找的计算在关注序列的大小上线性缩放。其次,它不将序列编码为固定大小的表示,而是需要记住所有隐藏状态。这两个限制将softmax注意力机制的使用限制在具有短序列和每个序列很少查找的相对小规模的应用中。在这项工作中,我们介绍了一个家庭的线性注意力机制,旨在克服上述两个限制。我们表明,从传统的注意力公式中去除softmax非线性,可以产生恒定时间的注意力查找和固定大小的出席序列表示。这些属性使得这些线性注意力机制特别适合于具有极端查询负载、实时要求和存储器约束的大规模应用。在问答任务上的早期实验表明,这些线性机制产生的准确性结果明显优于没有注意力,但明显不如他们的softmax替代方案。
英文摘要:
The softmax content-based attention mechanism has proven to be very beneficial in many applications of recurrent neural networks. Nevertheless it suffers from two major computational limitations. First, its computations for an attention lookup scale linearly in the size of the attended sequence. Second, it does not encode the sequence into a fixed-size representation but instead requires to memorize all the hidden states. These two limitations restrict the use of the softmax attention mechanism to relatively small-scale applications with short sequences and few lookups per sequence. In this work we introduce a family of linear attention mechanisms designed to overcome the two limitations listed above. We show that removing the softmax non-linearity from the traditional attention formulation yields constant-time attention lookups and fixed-size representations of the attended sequences. These properties make these linear attention mechanisms particularly suitable for large-scale applications with extreme query loads, real-time requirements and memory constraints. Early experiments on a question answering task show that these linear mechanisms yield significantly better accuracy results than no attention, but obviously worse than their softmax alternative.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。