Reference. Scatterbrain: Unifying Sparse and Low-rank Attention Approximation
Recent advances in efficient Transformers have exploited either the sparsity or low-rank properties of attention matrices to reduce the computational and memory bottlenecks of modeling long sequences. However, it is still challenging to balance the trade-off between model quality and efficiency to perform a one-size-fits-all approximation for different tasks. To better understand this trade-off, we observe that sparse and low-rank approximations excel in different regimes, determined by the softmax temperature in attention, and sparse + low-rank can outperform each individually. Inspired by the classical robust-PCA algorithm for sparse and low-rank decomposition, we propose Scatterbrain, a novel way to unify sparse (via locality sensitive hashing) and low-rank (via kernel feature map) attention for accurate and efficient approximation. The estimation is unbiased with provably low error. We empirically show that Scatterbrain can achieve 2.1x lower error than baselines when serving as a drop-in replacement in BigGAN image generation and pre-trained T2T-ViT. On a pre-trained T2T Vision transformer, even without fine-tuning, Scatterbrain can reduce 98% of attention memory at the cost of only 1% drop in accuracy. We demonstrate Scatterbrain for end-to-end training with up to 4 points better perplexity and 5 points better average accuracy than sparse or low-rank efficient transformers on language modeling and long-range-arena tasks.
Cite
Cites 68 works (0 here)
External (68)
- Attention Is All You Need (2025)
- Learning Multiple Layers of Features from Tiny Images (2024)
- Efficient Transformers: A Survey (2022)
- Efficient Content-Based Sparse Attention with Routing Transformers (2021)
- On the Dangers of Stochastic Parrots (2021)
- Tokens-to-Token ViT: Training Vision Transformers from Scratch on ImageNet (2021)
- Nyströmformer: A Nyström-based Algorithm for Approximating Self-Attention (2021)
- Simplified Self-Attention for Transformer-Based end-to-end Speech Recognition (2021)
- MONGOOSE: A Learnable LSH Framework for Efficient Neural Network Training (2021)
- Long-Short Transformer: Efficient Transformers for Language and Vision (2021)
- Luna: Linear Unified Nested Attention (2021)
- End-to-End Object Detection with Transformers (2020)
- Sparse GPU Kernels for Deep Learning (2020)
- Butterfly Transform: An Efficient FFT Based Neural Architecture Design (2020)
- SLIDE : In Defense of Smart Algorithms over Hardware Acceleration for Large-Scale Deep Learning Systems (2020)
- Language Models are Few-Shot Learners (2020)
- Longformer: The Long-Document Transformer (2020)
- Conv-Linformer: Boosting Linformer's Performance with Convolution in Small-Scale Settings (2020)
- Reformer: The Efficient Transformer (2020)
- Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention (2020)
- Hopfield Networks is All You Need (2020)
- Kaleidoscope: An Efficient, Learnable Representation For All Structured Linear Maps (2020)
- Climbing the WOL: Training for Cheaper Inference (2020)
- An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale (2020)
- Long Range Arena: A Benchmark for Efficient Transformers (2020)
- Rethinking Attention with Performers (2020)
- Sub-Linear Memory: How to Make Performers SLiM (2020)
- A Tale of Two Efficient and Informative Negative Sampling Distributions (2020)
- SMYRF: Efficient attention using asymmetric clustering (2020)
- HiPPO: Recurrent memory with optimal polynomial projections (2020)
- Compressive transformers for long-range sequence modelling (2020)
- Big Bird: Transformers for longer sequences (2020)
- BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding (2019)
- Adaptive Attention Span in Transformers (2019)
- Why Are Big Data Matrices Approximately Low Rank? (2019)
- Learning Fast Algorithms for Linear Transforms Using Butterfly Factorizations (2019)
- Fast and Accurate Stochastic Gradient Estimation (2019)
- ALBERT: A Lite BERT for Self-supervised Learning of Language\n Representations (2019)
- XLNet: Generalized Autoregressive Pretraining for Language Understanding (2019)
- Generating Long Sequences with Sparse Transformers (2019)
- Pay Less Attention with Lightweight and Dynamic Convolutions (2019)
- Learning Space Partitions for Nearest Neighbor Search (2019)
- Transformer-XL: Attentive language models beyond a fixed-length context (2019)
- Exploring the limits of transfer learning with a unified text-to-text transformer (2019)
- GLUE: A Multi-Task Benchmark and Analysis Platform for Natural Language Understanding (2018)
- ListOps: A Diagnostic Dataset for Latent Tree Learning (2018)
- Unique entity estimation with application to the Syrian conflict (2018)
- A Two-pronged Progress in Structured Dense Matrix Vector Multiplication (2018)
- Densified Winner Take All (WTA) Hashing for Sparse Datasets (2018)
- Learning long-range spatial dependencies with horizontal gated-recurrent units (2018)
- Learning compressed transforms with low displacement rank (2018)
- GPU kernels for block-sparse weights (2017)
- Pointer Sentinel Mixture Models (2016)
- Practical and Optimal LSH for Angular Distance (2015)
- Structured Transforms for Small-Footprint Deep Learning (2015)
- Asymmetric LSH (ALSH) for Sublinear Time Maximum Inner Product Search (MIPS) (2014)
- Global Convergence of Stochastic Gradient Descent for Some Non-convex\n Matrix Problems (2014)
- The ACL anthology network corpus (2013)
- Robust principal component analysis? (2011)
- Learning word vectors for sentiment analysis (2011)
- ImageNet: A large-scale hierarchical image database (2009)
- Exact Matrix Completion via Convex Optimization (2009)
- A Simpler Approach to Matrix Completion (2009)
- Bravais-Pearson and Spearman correlation coefficients: meaning, test of hypothesis and confidence interval (2002)
- Similarity Search in High Dimensions via Hashing (1999)
- Approximate nearest neighbors: towards removing the curse of dimensionality (1998)
- Interpretation of the Correlation Coefficient: A Basic Review (1990)
- Analysis of a complex of statistical variables into principal components (1933)