Home / Natural Language Processing

What are Embeddings?

Embeddings place words in a space where distance means meaning. Click around the map — similar words live in the same neighbourhood.

How to Explore

01Click any word on the map to select it.
02Click a second word — a line appears with their cosine similarity.
03Run the analogy to see vector arithmetic in action.

Vector Arithmetic

king − man + woman ≈ ?

Similarity Readout

Select two words on the map.

The Embedding Space (2D projection)

20 WORDS
Real embeddings have hundreds of dimensions; this map is a 2D projection. The clusters — royalty, animals, fruit, vehicles, emotions — emerge purely from how words are used in text.

Embeddings: Meaning as Geometry

The idea that turned words into vectors — and made "king − man + woman ≈ queen" computable.

The Definition

An embedding is a learned mapping from a discrete symbol (a word, a token, a product ID) to a dense vector of real numbers, built so that semantic similarity becomes geometric proximity. "Cat" and "kitten" end up close together; "cat" and "carburetor" end up far apart. Meaning is encoded as position.

Why Geometry Wins

Sparse encodings (one-hot, bag-of-words) treat every word as an isolated symbol — mathematically, all one-hot vectors are mutually perpendicular, so no similarity is expressible. Embeddings break that isolation:

  • Similarity is a dot product: cosine similarity between vectors gives a graded, continuous measure of relatedness.
  • Generalization comes free: a model that learns something about "cat" automatically transfers most of it to the nearby "kitten".
  • Relations become directions: the vector from "man" to "king" is roughly the same as from "woman" to "queen" — the direction itself means "royalty".

Interactive Exploration Guide

  1. Click "cat", then "kitten". Same cluster, short line, high cosine similarity — the geometry says "related" without any dictionary.
  2. Click "cat", then "truck". The line spans clusters and the similarity collapses. Distance is the meaning difference.
  3. Run the analogy. Watch the arrows: subtracting "man" from "king" isolates a royalty direction; adding "woman" lands almost exactly on "queen". Arithmetic on meaning — the demo that made word2vec famous.

Key Takeaway

Embeddings are the representation layer of modern NLP: dense, learned vectors where distance encodes similarity and directions encode relations. Every transformer, every LLM, every recommender system begins by embedding its inputs. How these vectors are learned is the subject of the next module.

Cheat sheet

What are Embeddings?

An embedding is a learned mapping from a discrete symbol (a word, a token, a product ID) to a dense vector of real numbers, built so that semantic similarity becomes geometric proximity. "Cat" and "kitten" end up close together; "cat" and "carburetor" end up far apart. Meaning is encoded as position.

NLP · vizlearn.in/natural_language_processing/what_are_embeddings.html