Embeddings: meaning as maps

How AI turns words, images and songs into points in space where closeness means similarity.

โฑ 5 min read

Computers only understand numbers. So how does a model know that "puppy" is close to "dog" but far from "spreadsheet"? It gives every word a list of numbers, an embedding, so that similar meanings land near each other.

same direction:โ€œ+ femaleโ€dogpuppycatkittenpizzapastabreadkingqueenmanwoman
A 2-D sketch of embedding space (real ones have hundreds of dimensions). Related words cluster, and directions can carry meaning.

๐Ÿ“ Words as coordinates

Each token becomes a vector, e.g. 768 numbers long.

These numbers are learned during training. Nobody hand-picks them; they emerge from which words appear in similar contexts.

๐Ÿงฎ Maths on meaning

Famous result from word2vec: king โˆ’ man + woman โ‰ˆ queen.

Directions in the space can capture concepts like gender, tense, or country โ†’ capital.

๐Ÿงฉ Quick quiz

In a good embedding space, "cat" and "kitten" should beโ€ฆ

๐Ÿ“ Measuring closeness

Cosine similarity compares the angle between two vectors: 1 = same direction, 0 = unrelated.

It's how semantic search finds documents that mean the same thing even with different words.

๐ŸŒ Embeddings everywhere

Not just words: sentences, images (CLIP puts images and captions in the same space), products, songs, users.

Recommendation systems, search engines and RAG (Advanced level) all run on embeddings.

๐Ÿงฉ Quick quiz

Where do embedding values come from?

โœจ Before you drift off

  • Embeddings turn things into vectors where closeness = similarity.
  • They're learned, not hand-written.
  • Cosine similarity measures how close two embeddings are.
  • They power search, recommendations and RAG.

๐Ÿ“š Go deeper (free & open)