XavierFok
← all posts

Embeddings, explained with one picture

2026-08-15 · by Xavier Fok

# Embeddings, explained with one picture

You search a help center for how do I cancel and get nothing useful back, even though the answer sits right there under the title ending your subscription. Every word you typed is missing from that article, so keyword search scores it a zero and moves on. The information was in the system the whole time. The search simply could not see that cancel and ending your subscription are the same thought wearing different words.

That failure is the oldest weakness in search. It matches spelling. Embeddings are the fix, and the word carries far more intimidation than the idea deserves. It sounds like graduate mathematics, and the thing underneath fits in a single picture. Hold that picture and you can build a working meaning based search in an afternoon.

The map of meaning

Imagine a giant map. Instead of places it holds meanings, and every word, sentence, or paragraph gets a spot on it. The rule of the map is short: things that mean similar things sit close together, and things that mean different things sit far apart.

So cat and kitten are neighbors. Cat and dog sit a short walk apart, related without being the same. Cat and car, nearly identical on paper, live on opposite sides of the map, because they share nothing in meaning.

Notice what changed. Spelling stopped mattering and meaning took over. That is the entire trick, and everything else in this post is detail layered on top of it. Once meaning has a place on a map, finding related things becomes finding what is nearby. You stop having to guess which words an author happened to use. You only need to land near them in meaning, and you can get there from a question that shares no vocabulary at all with the answer.

An embedding is an address

An embedding is where a piece of text sits on that map, written down as a list of numbers.

On a paper map an address takes two numbers, how far across and how far up. An embedding does the same job with far more numbers, typically hundreds and sometimes past a thousand, pinning one exact location in a space with that many directions. Nobody can picture a space with a thousand directions. You do not need to. The math behaves the same way it does on a flat map, and every intuition from two dimensions carries straight over.

So whenever someone says embedding, translate it in your head: a list of numbers saying where this text sits on the map of meaning. A fancy address, nothing more.

Why so many numbers? Because meaning has a huge number of independent ways to differ. Two pieces of text can share a topic while differing completely in mood. They can match in tone and diverge in formality. A map with only two directions runs out of room almost immediately and everything starts colliding. Give it hundreds of directions and there is finally space to keep every shade of difference separate. Each extra number is one more way the map can tell two ideas apart.

Where the numbers come from

Nobody assigns coordinates by hand. A dedicated embedding model does it: text goes in, the list of numbers comes out. These models learned placement by reading enormous amounts of text and tracking which words and phrases keep appearing in similar situations. Words used in the same kinds of sentences drift toward the same neighborhood, which is how a model worked out, with nobody ever telling it directly, that cancel belongs near ending your subscription.

Here is the freeing part for anyone building things: the inside of that model can stay a mystery to you. Treat it like the power socket in the wall. Nobody studies the power station before plugging in a lamp. Text in, coordinates out, and you can build useful things on that interface the same afternoon you learn it exists.

Measuring closeness

The last piece is a score. Given two embeddings, a small piece of math compares the two lists and returns a single number for how close the two points sit. High score, similar meaning. Low score, unrelated. The formula itself never needs to live in your head; the intuition does the whole job.

And with that, search by meaning assembles itself in front of you.

Four steps to a working search

Say I have a few hundred help articles.

Step one, ahead of time: run every article through the embedding model and store its coordinates. This happens once. Step two, at search time: run the user's question through the same model. Step three: score the question's point against every stored article point. Step four: sort by that score and show the closest articles first.

That is the whole system. How do I cancel lands next to the article about ending a subscription and comes back on top with zero words in common. The first time this works on your own data it feels like a trick, and by then you know exactly why it happens.

The recipe barely changes when the data does. Swap help articles for product descriptions and you have product search. Swap in past support tickets and every new ticket finds its closest predecessor. Swap in the paragraphs of one long document and a question jumps straight to the relevant passage. Embed everything once, embed the question, take the nearest points. Learn that pattern one time and you have read the engine behind a startling amount of modern software.

What this quietly powers

Recommendation features that say you might also like this are often lookups for nearby points on exactly this kind of map. When a chatbot answers questions from your own documents, the step where it finds the right passage to read is usually this same machinery: embed the question, pull the closest chunks, read only those. Grouping similar support tickets leans on it too. So does spotting near duplicate content, and so does sorting a pile of raw feedback into themes.

One small idea, hiding behind a remarkable share of the features that look intelligent from the outside.

The honest limits

Embeddings inherit the quality of the model that produced them. A strong model places meaning precisely. A weak one smears distinct ideas together, and every search built downstream goes fuzzy with it. The model also carries a point of view from whatever text it was trained on, so specialized jargon it rarely saw can land in the wrong neighborhood entirely.

Scale costs money. Generating embeddings carries a small price per piece of text, and once millions of points exist, finding the nearest ones quickly takes real tooling built for that job rather than a simple loop over everything.

Closeness also hides a failure people forget. The search always returns the closest thing it has, even when nothing it has is any good. Ask about something the collection never covered and it will cheerfully serve the least bad option, which looks confident and helps nobody. The standard fix is a cutoff: below some minimum score, report no good match found rather than pretending. And even above the cutoff, related and correct are different words. The nearest article is the most related one, and for anything that truly matters a person or a stricter check still belongs in the loop.

None of this shrinks how useful the idea is. It just means you use it with clear eyes.

What to actually remember

If your searches are exact lookups where the words always match, keyword search is fine and you can skip all of this.

The moment you want software to find things by what they mean, the way a person naturally would, this is the single most useful idea to carry. And the version worth carrying is small. Text becomes a point. Similar meanings sit close. Search is finding what is nearby. Keep that picture and you can reason about retrieval, recommendations, and most of the clever features in modern apps without ever touching the math underneath.

More breakdowns like this one live on [xavierfok.com](/).

Get new guides and videos first — join the Telegram channel.