Lune

ICLR2023Top-tier venue

Efficient Attention via Control Variates

Lin Zheng, Jianbo Yuan, Chong Wang, Lingpeng Kong

Abstract

Random-feature-based attention (RFA) is an efficient approximation of softmax attention with linear runtime and space complexity. However, the approximation gap between RFA and conventional softmax attention is not well studied. Built upon previous progress of RFA, we characterize this gap through the lens of control variates and show that RFA can be decomposed into a sum of multiple control variate estimators for each element in the sequence. This new framework reveals that exact softmax attention can be recovered from RFA by manipulating each control variate. Besides, it allows us to develop a more flexible form of control variates, resulting in a novel attention mechanism that significantly reduces the approximation gap while maintaining linear complexity. Extensive experiments demonstrate that our model outperforms state-of-the-art efficient attention mechanisms on both vision and language tasks. 1

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.

9 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

  • MetaLA: Unified Optimal Linear Approximation to Softmax Attention Map cites FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
  • MetaLA: Unified Optimal Linear Approximation to Softmax Attention Map cites Language Models are Few-Shot Learners
  • MetaLA: Unified Optimal Linear Approximation to Softmax Attention Map cites Various Lengths, Constant Speed: Efficient Language Modeling with Lightning Attention
  • MetaLA: Unified Optimal Linear Approximation to Softmax Attention Map cites Training data-efficient image transformers & distillation through attention
  • FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness cites Language Models are Few-Shot Learners
  • An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale cites Language Models are Few-Shot Learners
  • Coneheads: Hierarchy Aware Attention cites FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
  • Coneheads: Hierarchy Aware Attention cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • Coneheads: Hierarchy Aware Attention cites Language Models are Few-Shot Learners
  • Coneheads: Hierarchy Aware Attention cites Training data-efficient image transformers & distillation through attention
  • Swin Transformer: Hierarchical Vision Transformer using Shifted Windows cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • Swin Transformer: Hierarchical Vision Transformer using Shifted Windows cites Training data-efficient image transformers & distillation through attention
  • Various Lengths, Constant Speed: Efficient Language Modeling with Lightning Attention cites FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
  • Mobile Attention: Mobile-Friendly Linear-Attention for Vision Transformers cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • Mobile Attention: Mobile-Friendly Linear-Attention for Vision Transformers cites Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
  • Mobile Attention: Mobile-Friendly Linear-Attention for Vision Transformers cites Training data-efficient image transformers & distillation through attention
  • Training data-efficient image transformers & distillation through attention cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • Many-Shot In-Context Learning cites Language Models are Few-Shot Learners
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers9

  1. Many-Shot In-Context LearningRishabh Agarwal, Avi Singh, Lei Zhang, Bernd Bohnet et al.NeurIPS 2024 · 271 citations
  2. Various Lengths, Constant Speed: Efficient Language Modeling with Lightning AttentionZhen Qin, Weigao Sun, Dong Li, Xuyang Shen et al.ICML 2024 · 26 citations
  3. MetaLA: Unified Optimal Linear Approximation to Softmax Attention MapYuhong Chou, Man Yao, Kexin Wang, Yuqi Pan et al.NeurIPS 2024 · 22 citations
  4. Coneheads: Hierarchy Aware AttentionAlbert Tseng, Tao Yu, Toni J. B. Liu, Christopher De SaNeurIPS 2023 · 8 citations
  5. Mobile Attention: Mobile-Friendly Linear-Attention for Vision TransformersZhiyu Yao, Jian Wang, Haixu Wu, Jingdong Wang et al.ICML 2024 · 6 citations

Builds on52

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
  2. Swin Transformer: Hierarchical Vision Transformer using Shifted WindowsZe Liu, Yutong Lin, Yue Cao, Han Hu et al.ICCV 2021 · 31,683 citations
  3. An Image is Worth 16x16 Words: Transformers for Image Recognition at ScaleAlexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn et al.ICLR 2021 · 21,477 citations
  4. Training data-efficient image transformers & distillation through attentionHugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa et al.ICML 2021 · 8,974 citations
  5. 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

Related papers

  1. Random Feature AttentionHao Peng, Nikolaos Pappas, Dani Yogatama, Roy Schwartz et al.ICLR 2021 · 425 citations
  2. Linear Complexity Randomized Self-attention MechanismLin Zheng, Chong Wang, Lingpeng KongICML 2022 · 39 citations
  3. Dense-Exponential Random Features: Sharp Positive Estimators of the Gaussian KernelValerii Likhosherstov, Krzysztof Marcin Choromanski, Kumar Avinava Dubey, Frederick Liu et al.NeurIPS 2023 · 5 citations
  4. ELFATT: Efficient Linear Fast Attention for Vision TransformersChong Wu, Maolin Che, Renjie Xu, Zhuoheng Ran et al.ACM MM 2025 · 3 citations
  5. Breaking the Low-Rank Dilemma of Linear AttentionQihang Fan, Huaibo Huang, Ran HeCVPR 2025
Dusk over the sea between two cliffs drawn in fine vertical lines