Efficient Long-Range Transformers: You Need to Attend More, but Not Necessarily at Every Layer
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
- 2017Attention Is All You Needcited by 59,932
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 29,915
- 2019PyTorch: An Imperative Style, High-Performance Deep Learning Librarycited by 20,160
- 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,266
- 2022FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awarenesscited by 3,611
- 2020Longformer: The Long-Document Transformercited by 3,362
- 2021Efficiently Modeling Long Sequences with Structured State Spacescited by 2,424
- 2020The Pile: An 800GB Dataset of Diverse Text for Language Modelingcited by 2,346
- 2020DeBERTa: Decoding-enhanced BERT with Disentangled Attentioncited by 2,157
- 2019Transformer-XL: Attentive Language Models Beyond a Fixed-Length Contextcited by 1,830
16 more
- 2020Big Bird: Transformers for Longer Sequencescited by 1,673
- 2020Reformer: The Efficient Transformercited by 1,658
- 2020Linformer: Self-Attention with Linear Complexitycited by 1,462
- 2021DeBERTaV3: Improving DeBERTa using ELECTRA-Style Pre-Training with Gradient-Disentangled Embedding Sharingcited by 1,219
- 2022Simplified State Space Layers for Sequence Modelingcited by 776
- 2020HiPPO: Recurrent Memory with Optimal Polynomial Projectionscited by 600
- 2020Recipes for building an open-domain chatbotcited by 593
- 2018A Discourse-Aware Attention Model for Abstractive Summarization of Long Documentscited by 477
- 2021Random Feature Attentioncited by 350
- 2022Diagonal State Spaces are as Effective as Structured State Spacescited by 350
- 2021LongT5: Efficient Text-To-Text Transformer for Long Sequencescited by 232
- 2022Mega: Moving Average Equipped Gated Attentioncited by 178
- 2021Scatterbrain: Unifying Sparse and Low-rank Attention Approximationcited by 128
- 2021Do Long-Range Language Models Actually Use Long-Range Context?cited by 92
- 2022What Makes Convolutional Models Great on Long Sequence Modeling?cited by 86
- 2022Efficient Long Sequence Modeling via State Space Augmented Transformercited by 37
Built on by
Citing papers per year: 2023: 1; 2024: 6; 2025: 5; 2026: 1.
13 papers.
Sort:
By area:
- 2024Parallelizing Linear Transformers with the Delta Rule over Sequence Lengthcited by 373
- 2023Towards Efficient Generative Large Language Model Serving: A Survey from Algorithms to Systemscited by 101
- 2024LoCoCo: Dropping In Convolutions for Long Context Compressioncited by 18
- 2025Mixture of Sparse Attention: Content-Based Learnable Sparse Attention via Expert-Choice Routingcited by 13
- 2024CritiPrefill: A Segment-wise Criticality-based Approach for Prefilling Acceleration in LLMscited by 7
- 2025Multi-view Pyramid Transformer: Look Coarser to See Broadercited by 7
- 2024Superposed Decoding: Multiple Generations from a Single Autoregressive Inference Passcited by 4
- 2026One Token per Highly Selective Frame: Towards Extreme Compression for Long Video Understandingcited by 4
- 2024Reparameterized Multi-Resolution Convolutions for Long Sequence Modellingcited by 2
- 2024A vision-based framework for human behavior understanding in industrial assembly linescited by 1
- 2025T-T: Table Transformer for Tagging-based Aspect Sentiment Triplet Extractioncited by 0
- 2025WARBERT: A Hierarchical BERT-based Model for Web API Recommendationcited by 0
- 2026One Token per Highly Selective Frame: Towards Extreme Compression for Long Video Understanding15 Apr 2026
- 2025Multi-view Pyramid Transformer: Look Coarser to See Broader8 Dec 2025
- 2025An Enhanced Pyramid Feature Network Based on Long-Range Dependencies for Multi-Organ Medical Image Segmentation29 Sep 2025
- 2025WARBERT: A Hierarchical BERT-based Model for Web API Recommendation27 Sep 2025
- 2025T-T: Table Transformer for Tagging-based Aspect Sentiment Triplet Extraction8 May 2025
- 2025Mixture of Sparse Attention: Content-Based Learnable Sparse Attention via Expert-Choice Routing1 May 2025
- 2024A vision-based framework for human behavior understanding in industrial assembly lines25 Sep 2024
- 2024CritiPrefill: A Segment-wise Criticality-based Approach for Prefilling Acceleration in LLMs19 Sep 2024
- 2024Reparameterized Multi-Resolution Convolutions for Long Sequence Modelling18 Aug 2024
- 2024Parallelizing Linear Transformers with the Delta Rule over Sequence Length10 Jun 2024
- 2024LoCoCo: Dropping In Convolutions for Long Context Compression8 Jun 2024
- 2024Superposed Decoding: Multiple Generations from a Single Autoregressive Inference Pass28 May 2024
- 2024Parallelizing Linear Transformers with the Delta Rule over Sequence Lengthcited by 373
- 2024CritiPrefill: A Segment-wise Criticality-based Approach for Prefilling Acceleration in LLMscited by 7
- 2025Multi-view Pyramid Transformer: Look Coarser to See Broadercited by 7
- 2024Superposed Decoding: Multiple Generations from a Single Autoregressive Inference Passcited by 4
- 2024Reparameterized Multi-Resolution Convolutions for Long Sequence Modellingcited by 2
- 2024A vision-based framework for human behavior understanding in industrial assembly linescited by 1
- 2025T-T: Table Transformer for Tagging-based Aspect Sentiment Triplet Extractioncited by 0
- 2025WARBERT: A Hierarchical BERT-based Model for Web API Recommendationcited by 0
- 2025An Enhanced Pyramid Feature Network Based on Long-Range Dependencies for Multi-Organ Medical Image Segmentationcited by 0
- 2025Multi-view Pyramid Transformer: Look Coarser to See Broader8 Dec 2025
- 2025An Enhanced Pyramid Feature Network Based on Long-Range Dependencies for Multi-Organ Medical Image Segmentation29 Sep 2025
- 2025WARBERT: A Hierarchical BERT-based Model for Web API Recommendation27 Sep 2025
- 2025T-T: Table Transformer for Tagging-based Aspect Sentiment Triplet Extraction8 May 2025
- 2024A vision-based framework for human behavior understanding in industrial assembly lines25 Sep 2024
- 2024CritiPrefill: A Segment-wise Criticality-based Approach for Prefilling Acceleration in LLMs19 Sep 2024
- 2024Reparameterized Multi-Resolution Convolutions for Long Sequence Modelling18 Aug 2024
- 2024Parallelizing Linear Transformers with the Delta Rule over Sequence Length10 Jun 2024
- 2024Superposed Decoding: Multiple Generations from a Single Autoregressive Inference Pass28 May 2024