Linear Scaling: O(N) vs. O(N²) Attention Complexity

Longformer's hybrid attention mechanism drastically reduces the computational cost from the quadratic O(N²) of standard Transformer self-attention to linear O(N) or O(N*w), where 'w' is the window size, making long-sequence processing significantly more efficient.

Sources

Open the full topic