Embeddings

IntermediateMachine Learning

Last updated June 10, 2026

What is Embeddings in simple terms?

In simple terms, embeddings turn words or images into coordinates on a kind of meaning-map, where similar things sit close together. That's how AI can tell that "doctor" and "physician" are nearly the same, even though they're spelled differently.

What is Embeddings?

Embeddings are a way of representing words, images, or other data as lists of numbers, arranged so that items with similar meaning end up with similar numbers — letting a computer measure how related two things are even when they share no words in common.

Computers don't understand words the way we do — underneath, they only handle numbers. Embeddings are the clever trick that bridges that gap. An embedding takes a piece of data, such as a word, a sentence, or even a picture, and represents it as a list of numbers. The magic isn't in the numbers themselves but in how they're arranged: the system learns to place related things near each other and unrelated things far apart. So the embedding for "cat" lands close to the embedding for "kitten" and not far from "dog," while "helicopter" sits somewhere else entirely. You can picture it as a vast map of meaning where every word or image has a location, and closeness on the map means closeness in meaning.

What makes this so powerful is that it lets a computer compare things by what they mean rather than by how they're spelled. A plain keyword search treats "physician" and "doctor" as unrelated because the letters differ; with embeddings, the two sit almost on top of each other, so a search can match them. This is the engine behind semantic search, recommendation systems, and a great deal of modern language AI. It's also a key ingredient in retrieval-augmented generation: documents are turned into embeddings and stored so that, when you ask a question, the system can find the passages closest in meaning to your query and feed those to the model. To measure how close two embeddings are, systems commonly use a calculation called cosine similarity, which scores how aligned two of these number-lists are.

These number-lists are learned, not hand-written. By processing enormous amounts of text, a model picks up which words and ideas tend to appear in similar contexts, and it arranges its embeddings to reflect those patterns — which is why the result captures genuine relationships in meaning rather than surface spelling. A famous demonstration is that the arithmetic can line up sensibly: the relationship between "king" and "queen" turns out to mirror the relationship between "man" and "woman." Embeddings are quietly foundational to a lot of AI: any time a system seems to grasp that two differently worded things are really about the same thing, there are almost certainly embeddings underneath doing the work.

Real-world example of Embeddings

A cooking website wants its "more like this" feature to actually understand food. Using embeddings, every recipe is converted into a list of numbers that captures what the dish is really about. Now when a user lingers on a spicy Thai green curry, the site can pull up other recipes whose embeddings sit nearby — a Malaysian laksa, a coconut-based fish stew — even though none of them share the words "Thai" or "green curry" in their titles. A clumsy keyword system would only match recipes with the same words; the embedding-based one matches by the flavor and character of the dish, because that's what got encoded into the numbers. The result feels less like a search and more like a recommendation from someone who genuinely gets your taste.

Related terms

Frequently asked questions about Embeddings

What is the difference between embeddings and tokens?

They're consecutive steps. Tokenization first chops text into tokens — small chunks like words or word-pieces. Embeddings then turn those tokens (or whole sentences, or images) into lists of numbers that capture meaning, positioned so similar items sit close together. So tokens are the raw pieces of text, while embeddings are the meaning-rich numerical form the model actually reasons with. Tokenizing tells you what the pieces are; embedding tells you what they mean in relation to everything else.

How do embeddings work?

A model trained on huge amounts of data learns to assign every item a list of numbers — its embedding — arranged so that things appearing in similar contexts get similar numbers. The learning is what does it: by seeing which words, sentences, or images tend to occur together, the model positions related ones near each other on a high-dimensional map of meaning. To compare two items afterward, a system measures the distance or angle between their embeddings, often with cosine similarity. The closer they are, the more related they're judged to be.

What are embeddings used for?

Anywhere a computer needs to judge how similar two things are by meaning rather than exact wording. They power semantic search (finding relevant results even when the words differ), recommendation systems (surfacing items like ones you liked), and clustering (grouping related content). They're also central to retrieval-augmented generation, where documents are embedded so the right passages can be found and handed to a language model. In short, embeddings are the mechanism behind most AI that seems to understand that two different-looking things are really about the same thing.