Tech

Embedding

It's like giving every word its own spot on a playground, so a computer that can't understand language can still tell which words belong together.

  • 3 min read
  • 2 figures
  • Verified 2026-10-14

Definition

An embedding is a way to turn data like words, sentences, or pictures into coordinates made of many numbers. The coordinates are chosen so that things with similar meanings sit close together. That way, a computer can find similar things just by calculating distance and direction, even though it doesn't understand what anything means.

A Game of Finding Spots on the Playground

Imagine a gym class where you line up your classmates on the playground. There's just one rule: stand near people who like the same things you do. The kids who love soccer gather on one side, and the kids who love drawing gather on the other.

Once everyone is in place, something neat happens. You don't have to ask who is similar to whom. You can just measure the distance between two people. You don't even need to know their names. Where they stand tells you how they relate.

We play the same game when we teach a computer about words. A computer doesn't know what the letters in 'apple' mean. You might think you could just label apple as number 1 and lion as number 2. But that doesn't work. The fact that 1 and 2 are neighbors has nothing to do with what the two words mean.

So instead, each word gets a set of numbers that works like its spot on the playground. These coordinates are called an embedding.

Direction Carries Meaning, Not Just Distance

When the spots on the playground are arranged well, direction starts to mean something too, not just distance. Draw an arrow from where 'man' stands to where 'king' stands. Then start at 'woman' and walk the same direction for the same length.

You end up near 'queen.' That's why people say 'king minus man plus woman equals queen.' It works because the arrow carries the idea of royal rank.

Thanks to this, a computer can do quite a lot without knowing what any word means. Type 'cheap laptop' into a search box, and it also finds 'inexpensive laptop.' The two phrases stand close together.

Recommendation features run on the same idea. They pick other videos that sit near the one you just watched. Calculating which spots are nearby is the same thing as finding similar items.

A Bit More Precisely

People don't assign these spots one by one. The computer reads a huge amount of text and adjusts the arrangement on its own. It nudges words closer together when they show up with similar neighbors (their context), and it repeats that nudge over and over. 'Cheap' and 'inexpensive' rarely appear in the same sentence. But both often show up next to words like 'laptop' and 'price,' so they drift close together.

The playground is also much bigger than we tend to picture. It doesn't have just two directions, left-right and up-down. It stretches in hundreds or even thousands of directions. So the coordinates are made of hundreds or thousands of numbers. But no single number comes with a label like 'sweetness' or 'size.'

The math doesn't always work out neatly, either. If you follow the arrow, you only land near 'queen,' not exactly on her spot. And many word pairs don't work this way at all.

If the text the computer read is skewed, the arrangement gets tilted too. Biases in what people have written seep into the coordinates, and developers are working to spot and fix that.

Common misconceptions

Myth

The numbers in an embedding are values that people filled in one by one after analyzing what each word means.

Fact

People don't set these values. They come from a computer reading a huge amount of text and adjusting the coordinates itself, so that words that appear in similar contexts end up close together.

Myth

A calculation like 'king - man + woman = queen' works out exactly for any word.

Fact

The result only lands near the right spot. Some pairs work well, but many don't. It's a fascinating property, not a guaranteed formula.

Where you meet it

  1. When you search for 'running shoes' on a shopping site and 'sneakers' show up too, it's because the two words sit close together.

  2. When a music app picks songs with a similar vibe to the ones you play a lot, it's because every song has been given its own spot.

In one sentence

Embedding gives words coordinates so that similar meanings sit close together, which lets a computer work with meaning just by calculating distances.

Created 2025-06-29 Updated 2026-10-14 Verified 2026-10-14