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.