mlsanityData to 7 Oct 2026

Efficient Long-Range Transformers: You Need to Attend More, but Not Necessarily at Every Layer

arXiv 2310.12442 ↗First posted 19 Oct 2023cs.CL cs.LGcited by 13

Not on the map. Why?

Abstract (arXiv)

Pretrained transformer models have demonstrated remarkable performance across various natural language processing tasks. These models leverage the attention mechanism to capture long- and short-range dependencies in the sequence. However, the (full) attention mechanism incurs high computational cost - quadratic in the sequence length, which is not affordable in tasks with long sequences, e.g., inputs with 8k tokens. Although sparse attention can be used to improve computational efficiency, as suggested in existing work, it has limited modeling capacity and often fails to capture complicated dependencies in long sequences. To tackle this challenge, we propose MASFormer, an easy-to-implement transformer variant with Mixed Attention Spans. Specifically, MASFormer is equipped with full attention to capture long-range dependencies, but only at a small number of layers. For the remaining layers, MASformer only employs sparse attention to capture short-range dependencies. Our experiments on natural language modeling and generation tasks show that a decoder-only MASFormer model of 1.3B parameters can achieve competitive performance to vanilla transformers with full attention while significantly reducing computational cost (up to 75%). Additionally, we investigate the effectiveness of continual training with long sequence data and how sequence length impacts downstream generation performance, which may be of independent interest.

Key facts. Cited by 13 papers in the map (data through 7 Oct 2026). Builds on 28 of its 35 references that are in the map. First posted on arXiv 19 Oct 2023.

Builds on

28 of 35 references.

References · 28

  1. 2017Attention Is All You Needcited by 59,932
  2. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
  3. 2020Language Models are Few-Shot Learnerscited by 32,199
  4. 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 29,915
  5. 2019PyTorch: An Imperative Style, High-Performance Deep Learning Librarycited by 20,160
  6. 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,266
  7. 2022FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awarenesscited by 3,611
  8. 2020Longformer: The Long-Document Transformercited by 3,362
  9. 2021Efficiently Modeling Long Sequences with Structured State Spacescited by 2,424
  10. 2020The Pile: An 800GB Dataset of Diverse Text for Language Modelingcited by 2,346
  11. 2020DeBERTa: Decoding-enhanced BERT with Disentangled Attentioncited by 2,157
  12. 2019Transformer-XL: Attentive Language Models Beyond a Fixed-Length Contextcited by 1,830
16 more
  1. 2020Big Bird: Transformers for Longer Sequencescited by 1,673
  2. 2020Reformer: The Efficient Transformercited by 1,658
  3. 2020Linformer: Self-Attention with Linear Complexitycited by 1,462
  4. 2021DeBERTaV3: Improving DeBERTa using ELECTRA-Style Pre-Training with Gradient-Disentangled Embedding Sharingcited by 1,219
  5. 2022Simplified State Space Layers for Sequence Modelingcited by 776
  6. 2020HiPPO: Recurrent Memory with Optimal Polynomial Projectionscited by 600
  7. 2020Recipes for building an open-domain chatbotcited by 593
  8. 2018A Discourse-Aware Attention Model for Abstractive Summarization of Long Documentscited by 477
  9. 2021Random Feature Attentioncited by 350
  10. 2022Diagonal State Spaces are as Effective as Structured State Spacescited by 350
  11. 2021LongT5: Efficient Text-To-Text Transformer for Long Sequencescited by 232
  12. 2022Mega: Moving Average Equipped Gated Attentioncited by 178
  13. 2021Scatterbrain: Unifying Sparse and Low-rank Attention Approximationcited by 128
  14. 2021Do Long-Range Language Models Actually Use Long-Range Context?cited by 92
  15. 2022What Makes Convolutional Models Great on Long Sequence Modeling?cited by 86
  16. 2022Efficient Long Sequence Modeling via State Space Augmented Transformercited by 37

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2023: 1; 2024: 6; 2025: 5; 2026: 1.

13 papers.

Sort:

By area: