← 返回资源分享
Linformer: Self-Attention with Linear Complexity
论文
论文
发布时间2020-06-08
发表arXiv:2006.04768
作者:Hao Ma,Sinong Wang,Belinda Z. Li,Madian Khabsa,Han Fang
详细介绍
Large transformer models have shown extraordinary success in achieving state-of-the-art results in many natural language processing applications. However, training and deploying these models can be prohibitively costly for long sequences, as the standard self-attention mechanism of the Transformer uses $O(n^2)$ time and space with respect to sequence length. In this paper, we demonstrate that the self-attention mechanism can be approximated by a low-rank matrix. We further exploit this finding to propose a new self-attention mechanism, which reduces the overall self-attention complexity from $O(n^2)$ to $O(n)$ in both time and space. The resulting linear transformer, the \textit{Linformer}, performs on par with standard Transformer models, while being much more memory- and time-efficient.
代码仓库 (11)
facebookresearch/fairseq/tree/main/examples/linformer官方PyTorch
facebookresearch/xformersPyTorch
microsoft/vision-longformerPyTorch
tatp22/pytorch-fast-GATPyTorch
sliao-mi-luku/Galaxy-Zoo-ClassificationPyTorch
santient/sparse-transformerPyTorch
The-AI-Summer/self-attention-cvPyTorch
tatp22/linformer-pytorchPyTorch
BenjaminWegener/transformer-tfjsTensorFlow
kuixu/Linear-Multihead-AttentionPyTorch
