Visual explainer
Word Embeddings
How computers represent words as dense vectors, allowing semantic meaning to be treated as math.
You give each word its own slot with one 1 and thousands of zeros. Cat, dog, and car all sit equally far apart, so you'll see no hint of meaning.
Dense Beats Sparse
You swap 10,000 sparse slots for 100 dense numbers. Cat becomes [2.0, 1.0] with every slot filled, so small shifts now move meaning instead of jumping slots.
Close Means Similar
You dot cat [2,1] with dog [2,2] side by side and get cosine 0.949 near 18 degrees. Cat with car [0,3] gives 0.447 near 63 degrees, so friends sit closer than strangers.
Context Pulls Together
You count neighbors and let them tug each dot. Cat and dog share pet, feed, and vet, so training drags them close while car drifts toward road words.
Gaps Tell Truth
You measure the same trio on one ruler in this fixture. One-hot says both gaps equal root 2, while dense says 0.28 for cat-dog and 2.60 for cat-car, which matches your gut.
Pick Your Width
You start near 100 dims for small vocabs and grow toward 300 for big ones. Flip smaller when training wobbles, since extra slots cost memory without adding sense.
Where It Breaks
You force bank to one dot for money and river. It settles halfway, 1.3 from each group, and answers both queries badly until you add context.
The Quick Version
- One-hot keeps all gaps equal.
- 100 dense numbers replace 10,000 zeros.
- Cosine 0.949 beats 0.447 for closeness.
- Shared contexts drag friends together.
- 0.28 versus 2.60 matches your gut.
- Grow dims only when words still collide.
- One bank dot fails both meanings.