Why Transformer Complexity is O(n²)
About
What Self-Attention Actually Does ?
n tokensn tokens (including itself)n × n = n²Visual Example
The
model
predicts
tokens
Mathematical Breakdown
Why Tokens Directly Affect Complexity ?
Does O(n²) Limit Tokens?
Example: Doubling Tokens
Memory Impact
Real Implication
Why Tokenization Matters Here ?
Not All Transformer Cost is O(n²)
Does This Mean Tokens Are Limited ?
How Modern Research Tries to Solve This ?
Last updated