Vectors and Embeddings
How a word becomes a list of numbers, and how the geometry of those numbers carries meaning.
Drag the tips of a and b. Green is a + b (b moved to the tip of a). Cosine similarity is 1 when they point the same way, 0 at right angles, −1 when opposite.
Try: stretch one arrow without turning it. The dot product changes, the cosine does not.
A toy embedding with 5 hand-made dimensions. We cannot draw 5D, so choose two axes. Click a word to see its nearest neighbours by cosine similarity.
Arithmetic on meaning: A − B + C. Orange arrows show the step B→C, copied onto A. Raise messiness to mimic imperfect learned embeddings.
“Male to female” is a direction in the space, estimated by averaging king−queen, man−woman, prince−princess and boy−girl. Pick a word and push it along that direction.
Try king with a push near −2, then boy.
A random rotation of the whole space scrambles the coordinates, so no axis means anything, yet every cosine and the analogy are unchanged. Meaning lives in relationships, not in individual axes.