Linear attention is a method that reorders the attention computation so that the weight matrix never has to be formed. Katharopoulos et al. proposed it in 2020 in the paper "Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention."
Standard scaled dot-product attention first computes () and then multiplies by . As a result, computation and memory grow with the square of the sequence length .
Linear attention replaces the softmax function with "the dot product of vectors passed through a feature map ." The expression then consists only of matrix products, so the order of multiplication can be rearranged freely (associativity).
The left side forms an matrix, but the right side computes first, so the only matrix it forms is a small one (vector length by vector length). Since its size does not depend on , computation and memory grow linearly with ().
As an analogy, instead of comparing everyone's business cards one by one ( times), the contents of the cards are first compiled into a single directory (), and each question only consults the directory. Once built, the directory can be reused no matter how many people ask.
The right side of the figure at the top of the article shows this difference. Softmax attention forms an matrix, whereas linear attention forms only a matrix instead.

