📞 0339-0387701 (WhatsApp) Contact

« Back to Data Science & AI (NCCIA)

What is the main computational cost of self-attention?

A. It decreases with longer sequences
B. It grows quadratically with sequence length, because every token attends to every other token ✅
C. It grows linearly only
D. It is constant regardless of length

Correct Answer: B. It grows quadratically with sequence length, because every token attends to every other token

Explanation

Full attention compares all token pairs, so cost scales with the square of sequence length.