paper-with-me

Papers

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

2023-10-19 · Qingru Zhang, Dhananjay Ram, Cole Hawkins, Sheng Zha, Tuo Zhao

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.

📄 PDF Abstract BibTeX arXiv:2310.12442

Code (0)

등록된 구현이 없습니다.

Tasks

8kComputational EfficiencyDecoderLanguage ModelingLanguage Modelling

Similar Papers 제목 키워드 기반

Unlimiformer: Long-Range Transformers with Unlimited Length Input

2023-05-02 · NeurIPS 2023 11 · Amanda Bertsch, Uri Alon, Graham Neubig, Matthew R. Gormley

Since the proposal of transformers, these models have been limited to bounded input lengths, because of their need to attend to every token in the input. In this work, we propose Unlimiformer: a general approach that wra…

Book summarizationCPUDecoderGPU

General-purpose, long-context autoregressive modeling with Perceiver AR

2022-02-15 · Curtis Hawthorne, Andrew Jaegle, Cătălina Cangea, Sebastian Borgeaud 외

Real-world data is high-dimensional: a book, image, or musical performance can easily contain hundreds of thousands of elements even after compression. However, the most commonly used autoregressive models, Transformers,…

Density EstimationLanguage Modelling

Extended Mind Transformers

2024-06-04 · Phoebe Klett, Thomas Ahle

Pre-trained language models demonstrate general intelligence and common sense, but long inputs quickly become a bottleneck for memorizing information at inference time. We resurface a simple method, Memorizing Transforme…

Common Sense ReasoningcounterfactualDecoderRetrieval

SCOUT: Toward Sub-Quadratic Attention via Segment Compression for Optimized Utility in Transformers

2025-08-31 · Aref Jafari, Yuhe Fan, Benyamin Jamialahmadi, Parsa Farinneya 외 arxiv

Transformers have demonstrated strong performance across a wide range of sequence modeling tasks, but their quadratic attention complexity limits scalability to long sequences. Linear models such as Mamba and sliding-win…

Recurrent Distance Filtering for Graph Representation Learning

2023-12-03 · Yuhui Ding, Antonio Orvieto, Bobby He, Thomas Hofmann

Graph neural networks based on iterative one-hop message passing have been shown to struggle in harnessing the information from distant nodes effectively. Conversely, graph transformers allow each node to attend to all o…

Graph ClassificationGraph Representation LearningInductive BiasLong-range modeling+2