arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2006.03274cs.LGcs.CLstat.ML
收藏

GMAT:Transformers的全局内存增强

GMAT: Global Memory Augmentation for Transformers

Tel Aviv University(特拉维夫大学);Allen Institute for AI(艾伦人工智能研究所)

Ankit Gupta, Jonathan Berant

摘要:

基于transformer的模型由于其大容量、固有的并行性和高性能而在自然语言处理中无处不在。Transformer块的上下文组件是$\textit{pairwise dot-product}$ attention,它对长度$L$序列有很大的$Ω(L^2)$内存需求,限制了它处理长文档的能力。这一直是最近的实质性兴趣的主题,其中提出了多个近似,以减少使用稀疏注意矩阵的二次记忆要求。在这项工作中,我们建议增加稀疏的Transformer块与密集的注意力为基础的$\textit{global memory}$的长度$M$($\ll L$),它提供了一个聚合的全局视图的整个输入序列的每个位置。我们的增强具有可管理的$O(M\cdot(L+M))$内存开销,并且可以与先前的稀疏解决方案无缝集成。此外,全局存储器也可以用于序列压缩,通过仅用存储器表示来表示长输入序列。我们的经验表明,我们的方法导致一系列任务的实质性改善,包括(a)需要全局推理的合成任务,(b)掩蔽语言建模,(c)阅读理解。

英文摘要:

Transformer-based models have become ubiquitous in natural language processing thanks to their large capacity, innate parallelism and high performance. The contextualizing component of a Transformer block is the $\textit{pairwise dot-product}$ attention that has a large $Ω(L^2)$ memory requirement for length $L$ sequences, limiting its ability to process long documents. This has been the subject of substantial interest recently, where multiple approximations were proposed to reduce the quadratic memory requirement using sparse attention matrices. In this work, we propose to augment sparse Transformer blocks with a dense attention-based $\textit{global memory}$ of length $M$ ($\ll L$) which provides an aggregate global view of the entire input sequence to each position. Our augmentation has a manageable $O(M\cdot(L+M))$ memory overhead, and can be seamlessly integrated with prior sparse solutions. Moreover, global memory can also be used for sequence compression, by representing a long input sequence with the memory representations only. We empirically show that our method leads to substantial improvement on a range of tasks, including (a) synthetic tasks that require global reasoning, (b) masked language modeling, and (c) reading comprehension.

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

↑