What are embeddings? Words as points in space
When people ask what embeddings are, they usually have run into the word in a vector database, a search feature or an AI API and want a plain answer. Here it is: an embedding is a list of numbers that represents a piece of text (or an image, or a song) so that things with similar meaning end up with similar numbers. Think of it as giving every word a location on a map, where neighbours on the map are neighbours in meaning.
The problem embeddings solve
Computers are good at numbers and bad at meaning. The words "car" and "automobile" share no letters, so a program that only compares spelling sees them as unrelated. A program that only counts matching words will miss a document about automobiles when you search for cars.
The older fix was to give each word an ID number, or a long list of zeros with a single one in it. That tells the computer the words are different, but nothing about how they are related. Every word is equally far from every other word.
Embeddings fix this by giving each word a position in space, chosen so that distance carries meaning.
What embeddings are: words as points in space
Picture a flat map. Put "cat" somewhere, and "dog" nearby, since they are both pets. "Kitten" sits close to "cat". "Carburettor" lands far away, in a different region altogether.
A real embedding does the same thing, but instead of two coordinates it uses many, often hundreds or even thousands. You cannot picture that many dimensions, but the idea is unchanged: each word becomes a list of numbers, and that list is a point. Two points that are close together stand for words used in similar ways.
No person decides these coordinates. A model learns them.
How the numbers are learned
The core trick is that a word's meaning shows up in the company it keeps. "Cat" and "dog" both appear near words like "feed", "vet" and "fur". "Carburettor" appears near "engine" and "fuel".
During training, a model reads a very large amount of text and adjusts each word's coordinates so that the numbers help it predict the words around it. Words that appear in similar contexts are pushed toward similar coordinates, because that is what makes the prediction task easier. Nobody labels "cat" as an animal; the position emerges from usage.
Modern models do this for whole sentences and passages, not only single words, and the same word can get different numbers depending on the sentence it sits in. The principle is the same.
Measuring closeness
Once text is points, "how similar are these two?" becomes a geometry question. The most common measure is cosine similarity, which looks at the angle between two lists of numbers: a small angle means they point the same way, so they are similar. Plain distance between the points is another option.
The practical steps are:
- Run each piece of text through an embedding model to get its list of numbers.
- Store those lists, usually in a vector database or an index built for this.
- When a query arrives, embed it with the same model.
- Find the stored points nearest to the query point.
- Return the matching text.
That is semantic search: searching by meaning instead of by exact words.
Where you will meet embeddings
- Search: finding documents that match the intent of a question, not just its keywords.
- Retrieval for AI answers: the lookup step in RAG is typically done with embeddings.
- Inside language models: a transformer begins by turning each token into an embedding vector before attention does its work.
- Recommendations and clustering: items that land near each other can be suggested together or grouped.
What to keep in mind
Embeddings are a compressed summary, so they lose detail. Two sentences can land close together while differing in one crucial word, such as "not". Embeddings from different models are not interchangeable: each model has its own map, so you must embed your query and your documents with the same one. And because the map is learned from text, it can absorb the biases in that text.
Quick recap
- An embedding is a list of numbers that places text at a point in space.
- Similar meaning means nearby points; distance carries meaning.
- The coordinates are learned from how words are used in context, not set by hand.
- Cosine similarity or distance turns "is this similar?" into a calculation.
- Embeddings power semantic search, retrieval for AI, and the first step inside language models.