Self-attention is one of the core ideas behind modern Transformer models such as BERT, GPT, and T5. It allows a model to understand relationships between words in a sequence, regardless of where they appear.

Why Self-Attention?

Earlier models like RNNs and LSTMs processed words in order, making it difficult to learn long-range dependencies. Self-attention solves this by allowing every word to look at every other word in the sentence at the same time.

Key Idea

Each word in a sentence is transformed into three vectors:

  • Query (Q) – What the word is looking for
  • Key (K) – What information the word exposes
  • Value (V) – The actual information carried by the word

The model computes similarity scores between words using dot products of queries and keys. The…

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help