Exploring Attention Map Reuse for Efficient Transformer Neural Networks

Kyuhong Shim, Jungwook Choi, Wonyong Sung
1/29/2023
cs.AIeess.SP

No confident code implementation found for this paper.

Abstract

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.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Cite this paper

@article{shim2023exploring,
  title  = {Exploring Attention Map Reuse for Efficient Transformer Neural Networks},
  author = {Kyuhong Shim and Jungwook Choi and Wonyong Sung},
  year   = {2023},
  eprint = {2301.12444},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2301.12444v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2301.12444.svg)](https://codeofpaper.com/paper/2301.12444)

Discussion