Tokens · IDs · vectors · the geometry of meaning
It turns every word into an arrow in space, then measures the angle between arrows. That's the whole idea. Let's build it from a single word, with real numbers you can see and a compass you can spin.
Step 1 · The journey in
A model does math, and math needs numbers — so before anything else, your text has to become numbers. It happens in three quick hops. Pick a word and watch it travel all the way in:
Step 2 · What that list of numbers actually is
Real models use vectors with hundreds or thousands of numbers, which nobody can picture. So we're going to cheat — beautifully. Here are ten words, each hand-given a vector of just four numbers, where every number means something you can read:
So "king" leans hard toward royal, person, male, adult, while "cat" leans toward not-royal, animal, neutral. Flip through the words and read their arrows — notice how the numbers just are the meaning, broken into parts:
Real embeddings work exactly like this — the model just discovers its own thousands of dimensions instead of our tidy four, and no single one is as clean as "royalty." But the principle is identical: a word is a point in space, and its coordinates carry its meaning.
Step 3 · Comparing two arrows
Here's the key move, and it's more intuitive than it sounds. To ask "are these two words related?", you don't measure the distance between the arrow tips. You measure the angle between the arrows.
Two arrows pointing the same way — a tiny angle — mean nearly the same thing. At a right angle, they're unrelated. Pointing opposite ways, they're opposites. That single number, "how aligned are they," is called cosine similarity: it's just the cosine of the angle. Spin the compass and feel it:
Same direction, close in meaning. Opposite direction, opposite meaning. Meaning became geometry.
Why the angle and not the distance? Because it ignores how "big" a vector is and cares only about direction — so a word used a thousand times and a word used twice can still count as identical in meaning if they point the same way. Direction is meaning; length is mostly noise.
Step 4 · Real words, real angles
The compass above was abstract. Let's feed it two real words from our list. Pick any two and see their arrows drawn at the true angle between them, their four-number vectors side by side, and the verdict:
Step 5 · The payoff
Here's where it all pays off. Take one word, measure its angle to every other word, and rank them. The closest ones — the smallest angles, the highest cosines — are its nearest neighbors in meaning. Pick a word and watch its relatives sort themselves out:
Pick "king" and the top of the list fills with man, prince, queen — royals and people — while cat and dog sink to the bottom with negative scores. Nobody wrote a rule that "king relates to prince." It falls out of the numbers, purely from the angles. That is the entire trick behind a machine that seems to understand which words belong together.
You just ran a search engine — not on letters, but on meaning.
Step 6 · Where this actually runs the world
"Turn things into vectors, then compare directions" is one of the most useful tricks in all of software. Once you can measure meaning as an angle, a surprising amount becomes easy:
Search that finds "how do I fix a flat" when you typed "puncture repair" — matching meaning, not keywords. Turn the query and every document into vectors; return the nearest.
Before an AI answers about your files, it embeds your question, finds the closest passages by cosine, and reads those. Same neighbor-search, on your PDFs.
"More like this." Songs, films, products become vectors; the nearest neighbors are the suggestions. Netflix and Spotify live on this.
Group thousands of support tickets by theme, or spot two near-identical entries — words that huddle in the same patch of space belong together.
And the deepest use of all: this is the very first thing that happens inside every large language model. Before it reasons about a single word, it turns your tokens into vectors exactly like these — just with thousands of learned dimensions instead of our four. Everything a model does, it does to arrows in space.
The whole idea, in one breath
Four steps turn language into geometry — and once meaning is a direction in space, a machine can measure it, search it, and sort it. That's how "king" learns it belongs beside "queen," and a world away from "cat."