How can “dog” be close to “puppy”?
A text system cannot use the feeling of relatedness directly. It needs numbers it can compare, combine and use as input for the next task.
00 Overview / start here
Computers do not begin with a human sense of “cat” or “queen.” They need a numerical way to carry meaning and compare one item with another.
A text system cannot use the feeling of relatedness directly. It needs numbers it can compare, combine and use as input for the next task.
An embedding turns a token into a dense list of numbers, placing related items near each other in a learned vector space.
“puppy” is represented by an ID: a label that tells the model which row to look up.
The ID selects a dense list of learned values. Nearby values can capture shared context.
The model can measure distance, blend vectors or pass the numbers into another prediction.
These three visible numbers are a toy vector. In this illustration, the first two help put “puppy” near “dog”; the last helps keep it in the pet neighborhood.
02 Unpack one lookup
The ID is only a label. The vector is the useful payload: a learned numeric signature that can move as context changes.
Choose a token and a context lens. Watch the short vector, map position, neighbors and explanation change together.
An ID points to a row. The vector carries the relationship.
03 Combine directions
Once words are vectors, simple operations can expose a direction. This famous analogy is useful as a toy idea, not a universal rule.
Use the stepper to reveal each operation. The values are invented for teaching, but the arithmetic is real.
An ID such as 0412 does not mean “cat” by itself. It only points to the right row.
The dense vector is the usable representation: compare it, combine it or send it onward.
Embeddings are learned from context, so words appearing in similar surroundings can become close.
The map is learned from usage. Context is what gives the coordinates meaning.
FAQ Embeddings / quick answers
Short answers for the moment when a vector starts to feel less abstract.
An embedding is a learned numeric vector used to represent a token. Its coordinates are not a dictionary definition; they give later calculations a way to compare and combine patterns.
Embeddings are learned from context. Tokens that appear in similar surroundings can receive vectors that are close in the model’s space, which makes similarity useful to downstream math.
No. Distance depends on the model, data, dimensions and context. A 2D map or a word analogy is a teaching lens, not a universal measure of meaning.