Papers
arxiv:2006.04768

Linformer: Self-Attention with Linear Complexity

Published on Jun 8, 2020
Authors:
,
,
,
,

Abstract

A new self-attention mechanism reduces the complexity of Transformers from quadratic to linear time and space, achieving comparable performance while being more efficient.

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 Linformer, performs on par with standard Transformer models, while being much more memory- and time-efficient.

Community

Sign up or log in to comment

Get this paper in your agent:

hf papers read 2006.04768
Don't have the latest CLI?
curl -LsSf https://hf.co/cli/install.sh | bash

Models citing this paper 0

No model linking this paper

Cite arxiv.org/abs/2006.04768 in a model README.md to link it from this page.

Datasets citing this paper 0

No dataset linking this paper

Cite arxiv.org/abs/2006.04768 in a dataset README.md to link it from this page.

Spaces citing this paper 0

No Space linking this paper

Cite arxiv.org/abs/2006.04768 in a Space README.md to link it from this page.

Collections including this paper 2