What is linear attention?

Definition

Linear attention uses mathematical rearrangements, kernel functions or recurrent summaries to avoid constructing the complete token-by-token attention matrix. This can make long sequences cheaper to process in memory and computation.

The efficiency gain comes with design tradeoffs. Approximations may lose some expressive detail, and different linear attention methods behave differently on recall and reasoning tasks. Hybrid architectures often combine linear and conventional or sparse attention to balance quality and cost.

Frequently asked questions

Why is linear attention useful for long context?

Its computation can grow much more slowly as the sequence becomes longer. That can make large documents, extended conversations or long media sequences practical to process.

Is linear attention always better than full attention?

No. Full attention can represent detailed token relationships directly. Linear methods trade some representation choices for efficiency, so the best approach depends on the task and implementation.

Videos explaining linear attention

  1. The Week Open Models Closed the Gap
    AI Search43:531 VIEW