← 返回资源分享
Mega: Moving Average Equipped Gated Attention
论文
论文
发布时间2022-09-21
发表arXiv:2209.10655
作者:Luke Zettlemoyer,Graham Neubig,Xiang Kong,Jonathan May,Junxian He,Xuezhe Ma,Chunting Zhou,Liangke Gui
详细介绍
The design choices in the Transformer attention mechanism, including weak inductive bias and quadratic computational complexity, have limited its application for modeling long sequences. In this paper, we introduce Mega, a simple, theoretically grounded, single-head gated attention mechanism equipped with (exponential) moving average to incorporate inductive bias of position-aware local dependencies into the position-agnostic attention mechanism. We further propose a variant of Mega that offers linear time and space complexity yet yields only minimal quality loss, by efficiently splitting the whole sequence into multiple chunks with fixed length. Extensive experiments on a wide range of sequence modeling benchmarks, including the Long Range Arena, neural machine translation, auto-regressive language modeling, and image and speech classification, show that Mega achieves significant improvements over other sequence models, including variants of Transformers and recent state space models.
代码仓库 (7)
facebookresearch/mega官方PyTorch
huggingface/transformersPyTorch
ethanbar11/ssm_2dPyTorch
lucidrains/gated-state-spaces-pytorchPyTorch
pwc-1/Paper-9/tree/main/2/megaMindSpore
linghao-jin/canmt-challengesPyTorch
ZIZUN/MAFiDPyTorch
