Attention Mechanism: The O(N²) Cost Driver

Transformer models' self-attention scales quadratically with input length; doubling context quadruples computational cost because every token must attend to every other token.

Sources

Open the full topic