arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2301.12444cs.AIeess.SP
收藏

探索有效的Transformer神经网络的注意力图重用

Exploring Attention Map Reuse for Efficient Transformer Neural Networks

Seoul National University(首尔国立大学);Hanyang University(汉阳大学)

Kyuhong Shim, Jungwook Choi, Wonyong Sung

摘要:

基于变换器的深度神经网络由于其强大的建模远程依赖性的能力,在各种序列应用中取得了巨大的成功。Transformer的核心模块是自注意(SA),它从整个序列中提取特征,而不考虑位置之间的距离。虽然SA有助于Transformer在长距离任务上执行得特别好,但SA需要与输入序列长度成二次的计算和内存复杂度。最近,注意力图重用,其中组多个SA层共享一个注意力图,已被提出,并取得了显着的加速语音识别模型。在本文中,我们提供了一个全面的研究注意力图重用集中在其能力,以加速推理。我们比较了该方法与其他SA压缩技术,并进行了故障分析,其优点为长序列。我们通过测量CPU和GPU平台上的延迟来证明注意力地图重用的有效性。

英文摘要:

Transformer-based deep neural networks have achieved great success in various sequence applications due to their powerful ability to model long-range dependency. The key module of Transformer is self-attention (SA) which extracts features from the entire sequence regardless of the distance between positions. Although SA helps Transformer performs particularly well on long-range tasks, SA requires quadratic computation and memory complexity with the input sequence length. Recently, attention map reuse, which groups multiple SA layers to share one attention map, has been proposed and achieved significant speedup for speech recognition models. In this paper, we provide a comprehensive study on attention map reuse focusing on its ability to accelerate inference. We compare the method with other SA compression techniques and conduct a breakdown analysis of its advantages for a long sequence. We demonstrate the effectiveness of attention map reuse by measuring the latency on both CPU and GPU platforms.

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

↑