Long-Short Transformer: Efficient Transformers for Language and Vision
By Chen Zhu, Wei Ping, Chaowei Xiao, Mohammad Shoeybi, Tom Goldstein, Anima Anandkumar, Bryan Catanzaro. 2021
175 citations recorded by the source corpus.
Transformers have achieved success in both language and vision domains. However, it is prohibitively expensive to scale them to long sequences such as long documents or high-resolution images, because self-attention mechanism has quadratic time and memory complexities with respect to the input sequence length. In this paper, we propose Long-Short Transformer (Transformer-LS), an efficient self-attention mechanism for modeling long sequences with linear complexity for both language and vision tasks. It aggregates a novel long-range attention with dynamic projection to model distant correlations and a short-term attention to capture fine-grained local correlations. We propose a dual normalization strategy to account for the scale mismatch between the two attention mechanisms. Transformer-LS can be applied to both autoregressive and bidirectional models without additional complexity. Our method outperforms the state-of-the-art models on multiple tasks in language and vision domains, including the Long Range Arena benchmark, autoregressive language modeling, and ImageNet classification. For instance, Transformer-LS achieves 0.97 test BPC on enwik8 using half the number of parameters than previous method, while being faster and is able to handle 3x as long sequences compared to its full-attention version on the same hardware. On ImageNet, it can obtain the state-of-the-art results (e.g., a moderate size of 55.8M model solely trained on 224x224 ImageNet-1K can obtain Top-1 accuracy 84.1%), while being more scalable on high-resolution images. The source code and models are released at https://github.com/NVIDIA/transformer-ls .
Subfields: Artificial Intelligence, Computer Vision and Pattern Recognition, Model Architectures, Efficiency & Compression
How researchers see this paper
The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.
In Artificial Intelligence
- Yi Tay
- Christopher R'e
- Mostafa Dehghani
- Donald Metzler
- Tri Dao
- Alan L. Yuille
- Dara Bahri
- Anima Anandkumar
In Computer Vision and Pattern Recognition
- Luc Van Gool
- Alan L. Yuille
- Dacheng Tao
- Christopher R'e
- Andrew Zisserman
- Xiaogang Wang
- Ming-Hsuan Yang
- Cordelia Schmid
In Model Architectures
In Efficiency & Compression
Citations in the corpus
- Efficient Transformers: A Survey (2020, background): “…al., 2020) O ( N ) KR Big Bird (Zaheer et al., 2020) O ( N ) FP+M Random Feature Attention (Peng et al., 2021) O ( N ) KR Long Short Transformers (Zhu et al., 2021) O ( kN ) FP + LR Poolingformer (Zhang et al., 2021) O ( N ) FP+M Nystr¨omformer (Xiong et al., 2021b) O ( kN ) M+DS Perceiver…”
- Scatterbrain: Unifying Sparse and Low-rank Attention Approximation (2021, background): “• Long-short transformer[71] (concurrent work): a special case of Scatterbrain where the sparse component is local attention and the low-rank component is Linformer.”
- Prompt Injection: Parameterization of Fixed Inputs (2022, unknown): “There has been a surge of recent works addressing this problem [6, 38, 1, 13, 40, 8].”
- MegaScale: Scaling Large Language Model Training to More Than 10, 000 GPUs (2024, background): “We believe that our work not only offers practical insights for those working on LLM training, but also paves the way for future research in this rapidly evolving field.”
- Attention mechanism in neural networks: where it comes and where it goes (2022, methodology): “Additionally, various approaches have been presented in Hierarchical Visual Transformer [183], Long-Short Transformer (Transformer-LS) [184], Perceiver [185], and Performer [186].”
- Adaptive Fourier Neural Operators: Efficient Token Mixers for Transformers (2021, background): “For instance, long-short (LS) transformer aggregates a long-range attention with dynamic projection to model distant correlations and a short-term attention to capture local correlations Zhu et al. (2021).”
- Are Transformers More Robust Than CNNs? (2021, result): “In addition, we note this conclusion is further corroborated in concurrent works [58, 30, 50, 62, 29], where a range of additional out-of-distribution tasks/datasets are tested.”