Embeddings in Plain English: How Software Compares Meaning
Understand how words, sentences and pictures become lists of numbers that let software find things with similar meaning.
Key takeaways
- An embedding represents content as numbers, placed so that related items end up near one another.
- Models learn these positions from patterns of use in large amounts of data, without anyone writing definitions.
- Embeddings power meaning-based search, recommendations, grouping, duplicate detection and document chatbots.
- Close does not mean true or identical: opposites, negations, numbers and exact codes can confuse the comparison.
An embedding is a list of numbers that stands for a piece of content, such as a word, a sentence, a product or a photo, arranged so that similar things get similar numbers. Software can then compare meaning by measuring how close two lists are, even when the original wording shares nothing at all.
That is how a search for "how to fix a leaky tap" can surface a page titled "Repairing a dripping faucet." The words barely overlap, but their embeddings sit near each other.
The map idea
Think of a map. Each town has two numbers, a latitude and a longitude. Towns with similar numbers are close together, and you can tell that without knowing anything else about them.
An embedding does something similar for meaning. Each item gets coordinates. The difference is that instead of two numbers there are typically hundreds or thousands. Nobody can picture a space with that many directions, but the arithmetic of distance works the same way.
The individual numbers usually have no neat label. You should not expect one to mean "is an animal" and another "is expensive." Meaning is spread across many of them together.
A tiny example you can check
Here is a made-up version with only two numbers per word, chosen to show the idea. Real systems learn their values and use far more of them.
| Word | First number | Second number |
|---|---|---|
| cat | 0.90 | 0.80 |
| kitten | 0.85 | 0.85 |
| invoice | −0.70 | 0.20 |
To find the straight-line distance between two points, take the difference in each number, square the differences, add them and take the square root.
cat to kitten: differences 0.05 and −0.05
0.05² + 0.05² = 0.0025 + 0.0025 = 0.005
√0.005 ≈ 0.07
cat to invoice: differences 1.60 and 0.60
1.60² + 0.60² = 2.56 + 0.36 = 2.92
√2.92 ≈ 1.71 "Cat" is much closer to "kitten" than to "invoice." Many systems use a related measure called cosine similarity, which compares only the directions in which the two lists point and ignores their lengths. The purpose is the same: a single score for how alike two items appear.
Where the numbers come from
Nobody types in the coordinates. A model learns them during training.
A classic insight is that words used in similar surroundings tend to have related meanings. "Coffee" and "tea" appear near words like "cup," "hot" and "morning." A model trained to predict words from their neighbors, or neighbors from words, ends up giving them similar numbers because doing so helps it predict.
Modern embedding models usually represent whole sentences or passages and take context into account, so "bank" in a sentence about a river gets a different representation from "bank" in a sentence about a loan. Other models are trained on pairs, such as pictures with captions, so that a photo and a matching description land close together. That lets you search a photo library by typing a phrase.
The training itself is described without equations in what it means to train an AI model.
What embeddings are used for
Say a hypothetical library receives thousands of comments from visitors. Embedding each comment and grouping the close ones could reveal that many are about noise, many about opening hours and a few about a broken door. A person still has to read the groups and name them.
Embeddings also sit underneath many document chatbots. The system embeds your question, finds the passages whose embeddings are nearest and gives them to a language model. That pipeline is explained in how retrieval lets a chatbot use your documents.
A search from start to finish
Suppose a hypothetical hardware shop wants its help page search to understand everyday wording. The setup and use go roughly like this.
- The shop gathers its help articles and cuts long ones into sections, so that each embedding describes one reasonably focused topic.
- An embedding model turns every section into a list of numbers, which is stored along with a link back to the section.
- A visitor types "my drill won't hold the bit."
- The same model turns that sentence into numbers.
- The system finds the stored sections whose numbers are closest and shows them in order.
A section titled "Tightening a worn chuck" might come out near the top, although the visitor never used the word "chuck," the part of a drill that grips the bit.
The size of each section matters. If one embedding has to summarize a whole long manual, it becomes a vague average of many topics and matches nothing sharply. If the pieces are single sentences, each may lack the context needed to make sense. Teams usually try a few sizes and keep whichever finds the right material most often.
The same model must be used for the stored sections and for the question. Mixing two models would be like measuring one town with latitude and longitude and another with street numbers.
How this differs from a chatbot
An embedding model does not write replies. It takes content in and returns numbers. A chat model takes text in and produces more text.
A chat model does use internal embeddings too: each token is turned into a list of numbers before the network processes it, as in how a language model produces a sentence. But when people speak of "using embeddings," they usually mean a separate step that stores these lists so they can be compared later.
The stored collection often lives in what is called a vector database, a "vector" being another name for a list of numbers. Such a database is built to find nearest neighbors quickly among very large numbers of items, often by accepting a very good approximate answer instead of checking every item.
Where closeness misleads
Similarity scores are useful, but they measure something narrower than people expect.
Opposites can be neighbors. "The medicine is safe" and "The medicine is not safe" share a topic and most words. Depending on the model, they may score as quite similar.
Numbers and codes blur. Order 10452 and order 10425 look alike. For exact identifiers, ordinary text matching is more dependable.
Topic can beat answer. A passage that repeats your question may score higher than the passage that answers it.
Rare or specialized terms may be placed poorly if the model saw little of that field or language.
Scores are relative. A score of 0.8 from one model does not mean the same as 0.8 from another, and there is no universal threshold for "the same."
For these reasons, good search systems often combine embeddings with keyword matching, filters such as date or author, and sometimes a second, closer reading of the top results.
Bias and privacy
Because the positions are learned from human writing and images, they can reflect human prejudices. Researchers have shown that word embeddings can link occupations or personal traits with gender in stereotyped ways. If such a system ranks job applicants or search results, those associations can affect real people. Testing outcomes for different groups is part of responsible use, as discussed in how bias gets into AI systems.
Embeddings are also not a safe disguise. The numbers look meaningless to a person, but they carry information about the original, and research has shown that some content can be partly reconstructed or inferred from them. Protect an embedding store of private documents as carefully as the documents themselves, with access controls and a way to delete entries.
Practical points if your team uses them
You do not need the mathematics to ask good questions.
- Which model creates the embeddings, and does it handle your languages?
- Where are the vectors stored, and who can query them?
- What happens when a source document changes or is deleted?
- If you switch embedding models, will you re-embed everything? Vectors from different models generally cannot be compared directly.
- How was search quality tested on real questions from your users?
A simple test set goes a long way. Collect questions people actually ask, mark which documents should come back, and check the results after every change.
Common questions
Does an embedding contain a definition of the word?
No. It records a position relative to other items. Whatever "meaning" it holds comes from those relationships, learned from how content appears in data.
Can I read one?
You can print the numbers, but they will not tell you much on their own. Their value comes from comparing them. People sometimes squash many dimensions down to two for a chart, which is helpful for exploring but distorts some distances.
Is similarity the same as truth?
No. Two false statements can be very similar, and a true correction can sit close to the error it corrects. Embeddings help find related material. Deciding what is accurate remains a separate job.