Linear Attention Mechanisms for Subquadratic Sequence Modeling

This direction is merged into another direction: linear complexity attention. Its last version stays readable and citable here.

Version 1 of 1453 papers559 conceptsfrozen 2026-10-04

The standard Transformer architecture has a fundamental scaling problem: the self-attention mechanism requires $O(N^2)$ time and memory, where $N$ is the sequence length. As Mostafa Dehghani and Yi Tay highlight in the Long Range Arena benchmark, this quadratic bottleneck makes it nearly impossible to process very long documents, high-resolution images, or complex genomic sequences.

To solve this, a growing body of research focuses on "linearizing" attention—transforming the operation into one that scales $O(N)$ with sequence length.

The Associative Property as a Speedup

The core intuition behind linear attention is a change in the order of operations. Standard attention computes a similarity matrix between all queries ($Q$) and keys ($K$), then multiplies this $N \times N$ matrix by the values ($V$). Mathematically, this is $(QK^T)V$.

As Ping Hu demonstrates in the Fast Attention Network, if we can remove the non-linear Softmax operation that sits between $QK^T$ and $V$, we can use the associative property of matrix multiplication to compute $Q(K^TV)$ instead.

In this reformulated version:

  1. We first multiply $K^T$ ($D \times N$) by $V$ ($N \times D$) to get a small $D \times D$ matrix (where $D$ is the head dimension).
  2. We then multiply $Q$ ($N \times D$) by this $D \times D$ result.

Because the head dimension $D$ is typically much smaller than the sequence length $N$, this shift reduces the complexity from quadratic to linear. Mostafa Dehghani and colleagues note in their survey of efficient Transformers that this "kernel trick" allows the model to avoid ever explicitly building the massive $N \times N$ similarity matrix.

Approximating the Softmax Distribution

The challenge is that Softmax is crucial for model performance; it helps the model "concentrate" its focus on specific tokens. Simply removing it often leads to poor results. Researchers have developed several ways to keep the benefits of Softmax while maintaining linear speed:

  • Feature Maps and Kernels: Models like the Performer (discussed in IAP) use random feature maps to approximate the Softmax kernel.
  • Statistical Matching: Yury Nahshan and Joseph Kampeas introduced Linear Log-Normal Attention, which mathematically mimics the "concentration" behavior of standard attention by matching its log-normal distribution.
  • Sampling: The YOSO framework by Zhanpeng Zeng and others treats attention as a sum of Bernoulli random variables, using Locality Sensitive Hashing (LSH) to sample only the most important interactions.

Exploiting Causal and Structural Constraints

In many tasks, we don't need every token to look at every other token. We can use the inherent structure of the problem to find shortcuts.

For autoregressive models (decoders), the attention mask is always lower-triangular because tokens can only look at the past. Erwan Fagnou and the team behind ChaCAL show that this triangular structure allows the attention mechanism to be solved as a system of linear equations. This enables "chain reasoning"—tracking an entity across many state changes—in a single layer, whereas standard Transformers would require many layers.

Similarly, Vijaya Krishna Yalavarthi and colleagues found in ProFITi that sorting input data to create a triangular matrix allows for linear-time Jacobian calculations, making attention-based generative models feasible for high-dimensional time series.

Scaling to Higher-Order Correlations

Standard attention only looks at pairs of tokens. However, some complex tasks require understanding relationships between triples or quadruples of tokens. Normally, this would lead to $O(N^3)$ or $O(N^4)$ complexity.

Recent theoretical work by Josh Alman and Zhao Song in Generalizing Matrix Softmax Attention proves that these higher-order correlations can actually be computed in near-linear time. By using tensor-structured data and mode-wise processing—as seen in the Higher Order Transformer by Soroush Omranpour—models can capture these deep interactions without the polynomial explosion in cost.

Attention as a Dynamical System

Finally, some researchers view attention not as a static calculation, but as an evolving state. Subhabrata Dutta and Tanya Gautam proposed TransEvolve, which treats layers as time-steps in an Ordinary Differential Equation (ODE). Instead of recomputing the $O(N^2)$ attention matrix at every layer, they compute it once and then "evolve" it using linear updates.

This perspective is echoed by Hedi Xia and Tan Minh Nguyen, who show that adding momentum to the recursive updates of linear Transformers allows them to better remember and weight historical information, bridging the gap between the efficiency of linear models and the expressive power of the original Transformer.

Papers in this version

Showing 60 of 453 papers.

History & citationVersion 1 · 2026-10-04

Merged into another direction · Permanent link

View frozen version 1

Cite this direction

Latest version (a living page):

@misc{lacuna_linear_attention_mechanisms_for_subquadr_d258a168,
  title = {Linear Attention Mechanisms for Subquadratic Sequence Modeling},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/linear-attention-mechanisms-for-subquadratic-sequence-modeling/rdr_d258a16811514e0b94561b0e45a34347},
  note = {Latest version of a living research direction; cite a version for a fixed text. Accessed 2026-11-23},
}

This exact version (version 1, frozen text):

@misc{lacuna_linear_attention_mechanisms_for_subquadr_d258a168_v1,
  title = {Linear Attention Mechanisms for Subquadratic Sequence Modeling},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/linear-attention-mechanisms-for-subquadratic-sequence-modeling/rdr_d258a16811514e0b94561b0e45a34347/v/1},
  note = {Version 1, frozen 2026-10-04. Accessed 2026-11-23},
}