LearnGenerative AI

Embeddings

Turn words into lists of numbers, and find out why “king − man + woman” lands on “queen”.

  • Generative AI
  • Language models
  • Fundamentals

Click two words to compare them, or switch to Analogy and click three. The panel shows the 10 numbers behind each word. The words are in English.

How it works

Meaning as a list of numbers.

An embedding turns a word into a vector, a list of numbers, so that words used in similar ways get similar numbers. Here every word has 10 numbers with readable names, such as royal, young, animal or big, so you can see what each one means. Real models learn hundreds or thousands of numbers from text, and no single number has a name.

Similarity is the cosine of the angle between two vectors: 1 when they point the same way, 0 when they have nothing in common. It is computed with all 10 numbers. The map is only a flat view of those 10 dimensions, so two words can sit close together on the map and still be less similar than they look.

Directions carry meaning. Taking “man” away from “king” leaves roughly “royal”, and adding “woman” lands on “queen”; on the map this is a parallelogram. These vectors are hand-made, so the answers come out exact. In learned embeddings the answer is just the nearest word, and the trick works less reliably.