QUESTION 14 OF 15

Why is long-context self-attention expensive?

Reveal the answer and explore the explanation.

14
MediumHigh priority

Why is long-context self-attention expensive?

Answer
Answer

Standard dense self-attention computes pairwise token interactions, requiring quadratic work in sequence length for those interactions.

Practical example

Double sequence length and observe a fourfold increase in attention score entries.

Reference: Further reading ↗

Last 30 min revisionHigh-yield interview Q&As