HyperAIHyperAI

Command Palette

Search for a command to run...

4 months ago

Efficient Attention: Attention with Linear Complexities

Zhuoran Shen; Mingyuan Zhang; Haiyu Zhao; Shuai Yi; Hongsheng Li

Efficient Attention: Attention with Linear Complexities

Abstract

Dot-product attention has wide applications in computer vision and natural language processing. However, its memory and computational costs grow quadratically with the input size. Such growth prohibits its application on high-resolution inputs. To remedy this drawback, this paper proposes a novel efficient attention mechanism equivalent to dot-product attention but with substantially less memory and computational costs. Its resource efficiency allows more widespread and flexible integration of attention modules into a network, which leads to better accuracies. Empirical evaluations demonstrated the effectiveness of its advantages. Efficient attention modules brought significant performance boosts to object detectors and instance segmenters on MS-COCO 2017. Further, the resource efficiency democratizes attention to complex models, where high costs prohibit the use of dot-product attention. As an exemplar, a model with efficient attention achieved state-of-the-art accuracies for stereo depth estimation on the Scene Flow dataset. Code is available at https://github.com/cmsflash/efficient-attention.

Code Repositories

HighCWu/stylegan2-paddle
pytorch
Mentioned in GitHub
lucidrains/stylegan2-pytorch
pytorch
Mentioned in GitHub
Bakikii/stylegan2-pytorch23
pytorch
Mentioned in GitHub
96jonesa/StyleGan2-Colab-Demo
pytorch
Mentioned in GitHub
SiavashCS/sgan_simple
pytorch
Mentioned in GitHub
lucidrains/linear-attention-transformer
pytorch
Mentioned in GitHub
cmsflash/efficient-attention
Official
pytorch
Mentioned in GitHub
lucidrains/DALLE2-pytorch
pytorch
Mentioned in GitHub
lucidrains/En-transformer
pytorch
Mentioned in GitHub
Di-Is/stylegan2-ada-pytorch
pytorch
Mentioned in GitHub
lucidrains/memory-transformer-xl
pytorch
Mentioned in GitHub

Benchmarks

BenchmarkMethodologyMetrics
extractive-text-summarization-on-govreportHEPOS
Avg. Test Rouge1: 56.86
Avg. Test Rouge2: 22.62
Avg. Test RougeLsum: 53.82

Build AI with AI

From idea to launch — accelerate your AI development with free AI co-coding, out-of-the-box environment and best price of GPUs.

AI Co-coding
Ready-to-use GPUs
Best Pricing
Get Started

Hyper Newsletters

Subscribe to our latest updates
We will deliver the latest updates of the week to your inbox at nine o'clock every Monday morning
Powered by MailChimp