Linear Attention is a class of attention mechanisms designed to approximate the standard self-attention operation in linear time complexity relative to sequence length, bypassing the quadratic memory scaling limits of standard Transformers.
Key to managing sequence memory and token weights during infinite context length llms, long-sequence dna analysis, and fast state-space models; optimizing Linear Attention prevents attention processing bottlenecks and keeps execution latencies low.
Linear attention is an optimization of the standard attention mechanism that reduces its computational and memory complexity from quadratic to linear with respect to sequence length. By changing the order of matrix multiplications, linear attention models process extremely long context windows efficiently, making them attractive for long-document and multimodal processing.
Because standard attention calculates similarity scores between every token and every other token in the sequence (an N x N matrix).
State Space Models (like Mamba) or Linear Transformer variants that rewrite the attention matrix multiplication order.
Recent advances in long chain-of-thought reasoning model such as DeepSeek-R1 have led to increasingly longer inference context lengths under the test-time.