Sparse Attention: Reducing Quadratic Complexity for Speed

Sparse attention mechanisms enhance parallel attention speed by reducing its quadratic computational complexity O(N²) (where N is sequence length) to linear O(N) or sub-quadratic, by strategically limiting each token's attention to a subset of other tokens. This approach, exemplified by methods like DeepSpeed Sparse Attention, has shown up to 6.3x faster computation in BERT base and 6.1x in GPT2 models, alongside significant memory reductions enabling processing of 10x to 16x longer sequences.

Sources

Open the full topic