Asked about Attention, conceptually
Why is long context expensive?
An answer that works
Attention compares every position with every other, so cost grows with the square of sequence length. Doubling the input quadruples the work, which is why context limits exist and why efficient attention is an active research area.
Reading an answer is not being able to give one. The section that teaches this is Attention, conceptually, 8 hours of Transformers & attention.
Learn this properlyAlso asked about Transformers & attention
Explain how attention works.Why did transformers replace recurrent networks?What do multiple attention heads do?What does causal masking do?What is the difference between attention and the feed-forward layer?Why does a transformer need position information at all?What are residual connections and layer norm for?What is the KV cache?
All 17 questions on Transformers & attention