Explicit Sparse Transformer: Concentrated Attention Through Explicit Selection

Guangxiang Zhao, Junyang Lin, Zhiyuan Zhang, Xuancheng Ren, Qi Su +1 more
12/25/2019
cs.CLcs.LG

Official code: lancopku/Explicit-Sparse-Transformer (62 stars, last commit 2023-07-21).

Abstract

Self-attention based Transformer has demonstrated the state-of-the-art performances in a number of natural language processing tasks. Self-attention is able to model long-term dependencies, but it may suffer from the extraction of irrelevant information in the context. To tackle the problem, we propose a novel model called \textbf{Explicit Sparse Transformer}. Explicit Sparse Transformer is able to improve the concentration of attention on the global context through an explicit selection of the most relevant segments. Extensive experimental results on a series of natural language processing and computer vision tasks, including neural machine translation, image captioning, and language modeling, all demonstrate the advantages of Explicit Sparse Transformer in model performance. We also show that our proposed sparse attention method achieves comparable or better results than the previous sparse attention method, but significantly reduces training and testing time. For example, the inference speed is twice that of sparsemax in Transformer model. Code will be available at \url{https://github.com/lancopku/Explicit-Sparse-Transformer}

View on arXivView PDF

Code Implementations(1)

code for Explicit Sparse Transformer

6212C++, LuaDec 21, 20193 years ago

Similar Papers

Cite this paper

@article{zhao2019explicit,
  title  = {Explicit Sparse Transformer: Concentrated Attention Through Explicit Selection},
  author = {Guangxiang Zhao and Junyang Lin and Zhiyuan Zhang and Xuancheng Ren and Qi Su and Xu Sun},
  year   = {2019},
  eprint = {1912.11637},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/1912.11637}
}

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/1912.11637.svg)](https://codeofpaper.com/paper/1912.11637)

Discussion