Level 3 · Module 16 · 10 minutes
Embeddings: turning tokens into numbers that carry meaning
- Define an embedding in plain words.
- Explain why related items end up close together in the embedding space.
- Explain why closeness in that space is not the same as truth.
An embedding is a list of numbers that represents meaning. Once text is split into tokens, the model turns each token into numbers. An embedding places those numbers in a space where items with similar meanings or similar uses sit close together.
A map of meaning
You can imagine a flat map for teaching: related words are near each other, and unrelated words are far apart. Real embeddings use many dimensions, meaning each list contains many numbers, which is impossible to draw but useful for calculation. The distances and directions in this space encode patterns learned from data. The numbers are not set by hand. They come from training.
These patterns are not definitions copied from a dictionary. The model learns them by seeing which words appear in similar contexts. A word that often appears near the same kinds of sentences as another word will tend to end up in a similar region. That is why the space captures associations, including biased or outdated ones.
Context changes the representation
A simple embedding table gives each token a fixed set of numbers. Modern language models go further. The representation of a token is adjusted by the words around it, so a word such as bank can end up with different representations inside the model when the surrounding words change the meaning. This is one reason attention matters: it lets the model build context-aware meaning.
What embeddings are used for
- Finding documents that are close in meaning to a search query.
- Grouping similar messages or items together.
- Comparing whether two sentences say similar things.
- Giving a language model its starting numbers before deeper layers refine them.
Closeness is not correctness. Two items can be close because of a shared association that is misleading, and the map can carry the biases of its training text. A search tool built on embeddings can therefore return results that are related in wording but wrong for the task.
A teaching picture, not a commercial system
Lessons draw a small flat map with a few words. Real commercial systems use very high-dimensional representations built from very large text collections. The flat map is an educational simplification, not a window into the model.
Common misconception
An embedding stores the dictionary definition of a word. It stores learned numerical patterns of use and association. It is not a definition, and it can reflect biases or misleading associations in the training data.
Guided practice
Choose six words and place them on a hand-drawn map so that related words are near each other. Add a seventh word with two possible meanings, such as bank, and draw two possible positions for it. Explain in two sentences why the map can only be a simplification. This is a paper exercise; no model is trained.
Knowledge check
Independent practice
Write a short example from your own work or daily life and decide whether it is AI, ordinary software or a mixture. Then explain why. Save it in your notes; no account is required.
Last reviewed: · Report a problem