Stage 2 · Teens · Foundations

Embeddings & Vector Space

How meaning gets represented as points in a high-dimensional space.

Once text is tokenized, each token is converted into an embedding — a list of numbers (a vector) that represents it in a high-dimensional space.

Inside a transformer, those are token embeddings: one vector per token, used as the starting point for attention and the rest of the network. Nearby vectors tend to belong to tokens that behave similarly in context, which is part of how the model generalizes — it can treat "puppy" a bit like "dog" because their representations overlap.

A related but different object is a passage embedding: one vector for a whole sentence or document, usually produced by a dedicated embedding model. That is what powers semantic search and RAG. Same geometry (meaning as position), different thing being embedded, often a different model than the LLM you chat with.

Embeddings: meaning as position in space
kingqueenprincedogcatpuppyapplebanana
royal
animal
fruit
Related meanings cluster together. This is a 2D cartoon of a high-dimensional space. The same geometry is used for token vectors inside a transformer and, separately, for whole-passage vectors in search — those are usually different models.
All lessons in Stage 2: How AI works