BP-Transformer: Modelling Long-Range Context via Binary Partitioning

Zihao Ye, Qipeng Guo, Quan Gan, Xipeng Qiu, Zheng Zhang
11/11/2019
87 citations
cs.CLcs.LG
transformer-attention

Official code: yzh119/BPT (127 stars, Python, MIT, last commit 2021-04-05).

Abstract

The Transformer model is widely successful on many natural language processing tasks. However, the quadratic complexity of self-attention limit its application on long text.

Show full abstract

In this paper, adopting a fine-to-coarse attention mechanism on multi-scale spans via binary partitioning (BP), we propose BP-Transformer (BPT for short). BPT yields $O(k\cdot n\log (n/k))$ connections where $k$ is a hyperparameter to control the density of attention. BPT has a good balance between computation complexity and model capacity. A series of experiments on text classification, machine translation and language modeling shows BPT has a superior performance for long text than previous self-attention models. Our code, hyperparameters and CUDA kernels for sparse attention are available in PyTorch.

View on arXivView PDF

Code Implementations(1)

yzh119/BPTOfficial100%
MIT

Source code of paper "BP-Transformer: Modelling Long-Range Context via Binary Partitioning"

12720Python, CudaAug 13, 20195 years agoMIT

Similar Papers

Cite this paper

@article{ye2019bptransformer,
  title  = {BP-Transformer: Modelling Long-Range Context via Binary Partitioning},
  author = {Zihao Ye and Qipeng Guo and Quan Gan and Xipeng Qiu and Zheng Zhang},
  year   = {2019},
  eprint = {1911.04070},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/1911.04070}
}

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

Discussion