Everything so far took numbers in. Words are not numbers. The obvious fix is to give each word its own slot: a long row of zeros with a single 1. It works, but look at what it says: every word is exactly as far from every other. In this code, kitten is no closer to cat than to bread.
Instead of one slot per word, a handful of dials per word: how feminine, how royal, how young, how animal, how feline, how object-like. Now kitten and cat share most of their settings and bread shares none. This is a toy with six dials I chose by hand; the real thing has a few hundred and nobody chooses them, which is the last scene.
Two dials at a time can be drawn. Put gender on one axis and royalty on the other, and start with four words: each becomes a point. The layout has structure you could read off without knowing the labels: two rows, two columns, a rectangle.
Draw the arrow from man to woman, then from king to queen. They are the same arrow, moved. That arrow is the gender direction. Now man to king and woman to queen: the royalty direction, the same for both. Relationships between words have become directions in the space, and directions can be reused.
If directions are reusable, you can do sums. Start at king. Take away man, which removes the male, non-royal part. Add woman. The point you land on is not exactly a word, so look for the nearest one: it is queen. The famous example, and now you can see why it works.
The space has six dials and the screen has two, so you have been looking at a shadow. Change which two you see. Along gender and youth, boy and girl split from man and woman; along animal and feline, the pets separate from everyone. Every pair of axes is a different true slice of the same arrangement.
A table of dials per word is an *embedding*. Nobody fills it in. The dials start random and are trained with the same recipe as everything else: a word's vector is nudged until it predicts the words that appear around it in real text. King and queen appear in the same sorts of sentences, so their vectors are pushed together; the gender direction emerges because "he" and "she" contexts differ in a consistent way. Meaning becomes geometry as a side effect.
Same trick, different direction.
puppy − dog is the youth direction: it leaves the animal part behind and keeps only "young". Add cat and you are at "young cat", which is where kitten sits. The direction learned from one pair transfers to another, exactly as gender did for king and queen.