Self-Attention's Quadratic Cost: The Core Driver

The primary reason context window doubling quadruples costs is the Transformer's self-attention mechanism, which performs 'all-to-all' comparisons between every token, leading to computational requirements scaling quadratically (O(n²)) with sequence length.

Sources

Open the full topic