LSG Attention: Extrapolation of pretrained Transformers to long sequences

Charles Condevaux, Sébastien Harispe
10/13/2022
cs.CL
transformer-attention

Official code: ccdv-ai/convert_checkpoint_to_lsg (98 stars, Python, MIT, PyTorch, last commit 2023-12-17).

Abstract

Transformer models achieve state-of-the-art performance on a wide range of NLP tasks. They however suffer from a prohibitive limitation due to the self-attention mechanism, inducing $O(n^2)$ complexity with regard to sequence length.

Show full abstract

To answer this limitation we introduce the LSG architecture which relies on Local, Sparse and Global attention. We show that LSG attention is fast, efficient and competitive in classification and summarization tasks on long documents. Interestingly, it can also be used to adapt existing pretrained models to efficiently extrapolate to longer sequences with no additional training. Along with the introduction of the LSG attention mechanism, we propose tools to train new models and adapt existing ones based on this mechanism.

View on arXivView PDF

Code Implementations(1)

PyTorchMIT

Efficient Attention for Long Sequence Processing

9810Python, ShellNov 15, 20212 years agoMIT
deep-learningnatural-language-processingnlppythonpytorch+3 more

Similar Papers

Cite this paper

@article{condevaux2022attention,
  title  = {LSG Attention: Extrapolation of pretrained Transformers to long sequences},
  author = {Charles Condevaux and Sébastien Harispe},
  year   = {2022},
  eprint = {2210.15497},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2210.15497}
}

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

Discussion