The bank near the river was muddy
river-side placeInteractive embeddings
Contextual vs Static Embeddings
Change the sentence and watch one token keep the same static vector while its contextual vector changes through Transformer attention.
Sentence
Thebankapprovedmyloan
The token bank is pulled toward finance because approved and loan dominate the context.
Attention weights for "bank"
The 4%
bank 28%
approved 25%
my 5%
loan 38%
Static vector
Same token, same lookup
0.400.12-0.220.71-0.18
Contextual vector
Same token, sentence-aware output
0.780.55-0.080.320.64
Why context matters
Static similarity for bank1.00
The static vectors are identical, so finance-bank and river-bank look the same at lookup time.
Contextual similarity for bank0.03
After attention, the contextual vectors separate because each sentence supplies different evidence.
Same word type, different token instances
Static embeddings represent a word type. Contextual embeddings represent each occurrence of that word inside a specific sentence.
The river bank was owned by a bank
financial institution