Gradient

Courses

∇\nabla∇The maths behind AI0/72
π\piπMaths0/84
⋆\star⋆AI for everyone0/10
Γ\GammaΓGame theory0/49
py\texttt{py}pyPython for AI0/15
y^\hat{y}y^​Build your own AI0/15
All courses

Tuition

My tuitionOlympiad trackCompetitions

Practice

ProjectsAsk a questionTrain on a GPUExplorationsMaths StoriesUnsolved problemsPlaygroundScience labsMock testsOlympiad

Reference

GlossaryBlogDiscoveries
Blog › Explore in 3D

25 November 2026 · 4 min readInteractive 3D

Blue and white abstract artwork about neural networks
Photo by Google DeepMind on Unsplash

What are word embeddings? Words as points

Computers cannot read, but they can measure distance. Turn the space and see animals, fruits, vehicles and feelings form their own neighbourhoods.

A language model cannot work with the word “cat” directly. It needs numbers. So every word is given a list of numbers, and that list is treated as a point in space. Words used in similar ways end up close together. That list is called an embedding.

Tap a word. Its three nearest neighbours light up and join it with lines.

Meaning as position

Nobody places the words by hand. During training, the model nudges each word’s numbers so that words appearing in similar sentences drift together. “Cat” and “dog” both appear near “pet”, “food” and “vet”, so they end up as neighbours. “Car” appears near “road” and “fuel”, so it lives somewhere else entirely.

Directions can mean something too

In real embeddings, even the directions between words can carry meaning. A famous example: the step from “man” to “woman” is similar to the step from “king” to “queen”. The model was never taught this; it fell out of reading lots of text.

Our model uses three numbers per word so you can see it. Real models use hundreds or thousands, which gives room for many more kinds of similarity at once.

A tiny example

Give each word two numbers: how royal it is and how male it is. King = [0.9, 0.9], queen = [0.9, 0.1], man = [0.1, 0.9], woman = [0.1, 0.1]. Then king − man + woman = [0.9, 0.1], which is exactly queen. Real embeddings have hundreds of numbers learned from text, but the famous arithmetic works the same way, at least roughly.

  1. king − man = [0.8, 0.0] (the “royal” part)
  2. add woman: [0.8, 0.0] + [0.1, 0.1] = [0.9, 0.1]
  3. nearest word to [0.9, 0.1] is queen

How the numbers are learned

Nobody chooses the numbers by hand. A model reads billions of sentences and adjusts each word’s list so that words appearing in similar places get similar lists: “tea” and “coffee” both follow “a cup of”, so they end up close together. This idea, that a word is known by the company it keeps, is called the distributional hypothesis.

Where embeddings are used

  • Search: finding pages about “cheap flights” when you typed “low-cost air tickets”.
  • Translation: words with the same meaning in two languages end up near each other.
  • Chatbots: every word piece is turned into an embedding before anything else happens.
  • Recommendations: songs, products and films get embeddings too.

Embeddings can carry bias from the text they learned from, for example linking certain jobs with one gender. Good systems measure and reduce this.

Sentence and image embeddings

The same idea extends beyond words. Whole sentences get embeddings so that “How do I reset my password?” and “I forgot my login” land near each other. Images get embeddings too, and some models put pictures and captions in the same space, so a photo of a dog sits near the words “a dog”.

Glossary

  • Vector space: the space where embeddings live.
  • Dimension: one number in the list.
  • Nearest neighbour: the closest point to a given one.
  • Vocabulary: all words or tokens the model knows.

Try these yourself

  1. Q1. With royal/male numbers, what is prince likely to be? Near [0.8, 0.9]
  2. Q2. Paris − France + India ≈ ? New Delhi
  3. Q3. Which pair should be closer: cup and mug, or cup and river? Cup and mug
  4. Q4. Why are 3D pictures only a sketch? Real embeddings have hundreds of dimensions

Where it came from

Word2vec, released by Google researchers in 2013, made embeddings fast to learn and famous for the king and queen example. Today every chatbot starts by turning text into embeddings.

In short

Embeddings place words as points so that meaning becomes distance and direction. They are learned from how words are used together.

Keep going

  • Lesson: embeddings
  • Glossary: embedding
  • Cosine similarity
  • What is token?
  • What is bigram model?
  • How can random dots find π? Monte Carlo
  • What does an artificial neuron do?

Read and listen in

Indian languages

World languages

Questions people ask

What is a word embedding?

A list of numbers that represents a word, learned so that words with similar meanings get similar lists.

Why does king − man + woman ≈ queen?

Because the difference between related words points in a consistent direction, so adding and subtracting those directions moves between them.

How many numbers does an embedding have?

Usually a few hundred to a few thousand. The 3D pictures show only three so we can see them.

More articles

  • What is cosine similarity? How alike two things are
  • How can random dots find π? Monte Carlo
  • What does an artificial neuron do?