QKᵀ Matrix Generates N×N Attention Map

The computational bottleneck lies in the `QKᵀ` operation, where an N-length query matrix (Q) is multiplied by an N-length key transpose matrix (Kᵀ), resulting in an N×N attention score matrix that directly defines the O(N²) complexity.

Sources

Open the full topic