Scatterbrain: Unifying Sparse and Low-rank Attention Approximation

By Beidi Chen, Tri Dao, Eric Winsor, Zhao Song, Atri Rudra, Christopher R'e. 2021

175 citations recorded by the source corpus.

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.

Subfields: Artificial Intelligence, Computer Vision and Pattern Recognition, Model Architectures

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

  1. Christopher R'e
  2. Yi Tay
  3. Ruslan Salakhutdinov
  4. Mostafa Dehghani
  5. Stefano Ermon
  6. Donald Metzler
  7. Yoshua Bengio
  8. Sergey Levine

In Computer Vision and Pattern Recognition

  1. Luc Van Gool
  2. Dacheng Tao
  3. Xiaogang Wang
  4. Jitendra Malik
  5. Andrew Zisserman
  6. Trevor Darrell
  7. Cordelia Schmid
  8. Ming-Hsuan Yang

In Model Architectures

  1. Tri Dao
  2. Christopher R'e
  3. Yi Tay
  4. Atri Rudra
  5. Mostafa Dehghani
  6. Donald Metzler
  7. Dara Bahri
  8. Stefano Ermon

Citations in the corpus