Lune

NeurIPS2021Top-tier venue

Sub-Linear Memory: How to Make Performers SLiM

Valerii Likhosherstov, Krzysztof Marcin Choromanski, Jared Quincy Davis, Xingyou Song, Adrian Weller

Abstract

The Transformer architecture has revolutionized deep learning on sequential data, becoming ubiquitous in state-of-the-art solutions for a wide variety of applications. Yet vanilla Transformers are notoriously resource-expensive, requiring O(L2)O(L^2) in serial time and memory as functions of input length LL. Recent works proposed various linear self-attention mechanisms, scaling only as O(L)O(L) for serial computation. We perform a thorough analysis of recent Transformer mechanisms with linear self-attention, Performers, in terms of overall computational complexity. We observe a remarkable computational flexibility: forward and backward propagation can be performed with no approximations using sublinear memory as a function of LL (in addition to negligible storage for the input sequence), at a cost of greater time complexity in the parallel setting. In the extreme case, a Performer consumes only O(1)O(1) memory during training, and still requires O(L)O(L) time. This discovered time-memory tradeoff can be used for training or, due to complete backward-compatibility, for fine-tuning on a low-memory device, e.g. a smartphone or an earlier-generation GPU, thus contributing towards decentralized and democratized deep learning.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

10 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention cites ALBERT: A Lite BERT for Self-supervised Learning of Language Representations
  • Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention cites Reformer: The Efficient Transformer
  • Long Range Arena : A Benchmark for Efficient Transformers cites Reformer: The Efficient Transformer
  • Scatterbrain: Unifying Sparse and Low-rank Attention cites Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention
  • Scatterbrain: Unifying Sparse and Low-rank Attention cites Long Range Arena : A Benchmark for Efficient Transformers
  • Scatterbrain: Unifying Sparse and Low-rank Attention cites ALBERT: A Lite BERT for Self-supervised Learning of Language Representations
  • Scatterbrain: Unifying Sparse and Low-rank Attention cites Reformer: The Efficient Transformer
  • Scatterbrain: Unifying Sparse and Low-rank Attention cites Language Models are Few-Shot Learners
  • FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness cites Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention
  • FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness cites Long Range Arena : A Benchmark for Efficient Transformers
  • FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness cites Scatterbrain: Unifying Sparse and Low-rank Attention
  • FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness cites Reformer: The Efficient Transformer
  • FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness cites Language Models are Few-Shot Learners
  • S3: Increasing GPU Utilization during Generative Inference for Higher Throughput cites Language Models are Few-Shot Learners
  • Accelerating Transformers with Spectrum-Preserving Token Merging cites Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention
  • Accelerating Transformers with Spectrum-Preserving Token Merging cites ALBERT: A Lite BERT for Self-supervised Learning of Language Representations
  • Accelerating Transformers with Spectrum-Preserving Token Merging cites FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
  • TRACE: A Fast Transformer-based General-Purpose Lossless Compressor cites Long Range Arena : A Benchmark for Efficient Transformers
  • TRACE: A Fast Transformer-based General-Purpose Lossless Compressor cites ALBERT: A Lite BERT for Self-supervised Learning of Language Representations
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers10

  1. FlashAttention: Fast and Memory-Efficient Exact Attention with IO-AwarenessTri Dao, Daniel Y. Fu, Stefano Ermon, Atri Rudra et al.NeurIPS 2022 · 5,493 citations
  2. Scatterbrain: Unifying Sparse and Low-rank AttentionBeidi Chen, Tri Dao, Eric Winsor, Zhao Song et al.NeurIPS 2021 · 165 citations
  3. S3: Increasing GPU Utilization during Generative Inference for Higher ThroughputYunho Jin, Chun-Feng Wu, David Brooks, Gu-Yeon WeiNeurIPS 2023 · 150 citations
  4. TRACE: A Fast Transformer-based General-Purpose Lossless CompressorYu Mao, Yufei Cui, Tei-Wei Kuo, Chun Jason XueWWW 2022 · 60 citations
  5. Accelerating Transformers with Spectrum-Preserving Token MergingChau Tran, Duy M. H. Nguyen, Manh-Duy Nguyen, TrungTin Nguyen et al.NeurIPS 2024 · 51 citations

Builds on8

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
  2. ALBERT: A Lite BERT for Self-supervised Learning of Language RepresentationsZhenzhong Lan, Mingda Chen, Sebastian Goodman, Kevin Gimpel et al.ICLR 2020 · 7,418 citations
  3. Reformer: The Efficient TransformerNikita Kitaev, Lukasz Kaiser, Anselm LevskayaICLR 2020 · 2,878 citations
  4. Transformers are RNNs: Fast Autoregressive Transformers with Linear AttentionAngelos Katharopoulos, Apoorv Vyas, Nikolaos Pappas, François FleuretICML 2020 · 2,665 citations
  5. Long Range Arena : A Benchmark for Efficient TransformersYi Tay, Mostafa Dehghani, Samira Abnar, Yikang Shen et al.ICLR 2021 · 881 citations

Related papers

  1. Rethinking Attention with PerformersKrzysztof Marcin Choromanski, Valerii Likhosherstov, David Dohan, Xingyou Song et al.ICLR 2021 · 122 citations
  2. Sequence Parallelism: Long Sequence Training from System PerspectiveShenggui Li, Fuzhao Xue, Chaitanya Baranwal, Yongbin Li et al.ACL 2023 · 29 citations
  3. A Solvable Attention for Neural Scaling LawsBochen Lyu, Di Wang, Zhanxing ZhuICLR 2025
  4. Transformers, parallel computation, and logarithmic depthClayton Sanford, Daniel Hsu, Matus TelgarskyICML 2024 · 64 citations
  5. Two Heads are Better than One: Simulating Large Transformers with Small OnesHantao Yu, Josh AlmanNeurIPS 2025 · 1 citation
Dusk over the sea between two cliffs drawn in fine vertical lines