Course 9, lesson 82 of 100, Ages 14+

Embeddings

Meaning as numbers

Like I’m 5

Imagine every word lives on a giant map. Words with similar meanings live close together, like ‘puppy’ right next to ‘dog’.

The big idea

An embedding turns text, images or sounds into a list of numbers, called a vector, that captures meaning. Items with similar meanings get vectors that point in similar directions.

Because similarity becomes simple maths, embeddings power semantic search, recommendations, clustering and duplicate detection. 'How do I reset my password?' lands close to 'I forgot my login', even with no shared words.

Examples

  • Semantic search: Find help articles by meaning, not exact words.
  • Recommendations: Products with nearby vectors are suggested together.
  • Clustering: Group thousands of customer comments into themes.

How it works

  1. Turn each piece of text into an embedding vector.
  2. Compare vectors with a similarity score.
  3. Use the closest matches for search, grouping or recommendations.

Check your understanding

What does an embedding capture?
Options: Meaning, as a list of numbers; The font of the text; The file size.
Answer: Meaning, as a list of numbers. Similar meanings get similar vectors.
Why can embeddings match 'forgot my login' with 'reset password'?
Options: Their meanings are close even without shared words; They have the same letters; By luck.
Answer: Their meanings are close even without shared words. Embeddings compare meaning, not spelling.

Remember

Embeddings turn meaning into vectors, so similarity becomes maths.

Talk about it

Which three words would sit closest to 'ocean' on a meaning map?

Go deeper

Similarity is usually measured with cosine similarity. Vector databases use approximate nearest-neighbour indexes (such as HNSW) to search millions of embeddings quickly.