How Context Changes Meaning
Why "bat" means different things near "cave" vs "baseball"
Say "bat" on its own — you might picture a baseball bat. But in "the bat flew out of the cave," it means a flying animal. Your brain makes this switch instantly, and so does an LLM. The previous section showed where words sit **alone**. This tool shows what happens when you put them **in a sentence** — surrounding words pull on each word's meaning, shifting its position in embedding space. > **Try it:** Click the example sentence **"The bat flew out of the cave at night"** and select the word **bat**. Toggle between **"Word alone"** and **"In context"** — watch how the word's nearest neighbors completely change. Then check the **attention chart** to see which words in the sentence influenced "bat" the most. The attention chart is the key to understanding transformers — it shows which words the model pays attention to when deciding what a word means in context.