Current take
The softmax over every pair of tokens sets the cost.
Basics
Softmax
Read first.
FlashAttention tiling
Why attention is quadratic
Attention, from scratch
Reading
Attention Is All You Need
Which attention methods are exact
Tiled attention
Attention in five minutes