06 · AI Fundamentals Lab
How does a computer know that two words mean nearly the same thing?
It turns each word into a list of numbers — a position in space — and then simply measures the distance. Move between words here and watch “firewall” land next to “router” and nowhere near “fire”, even though it is spelled out of “fire” and “wall”.
What the seven dimensions mean
Each word gets one number per dimension, from −1 (strongly not this) through 0 (nothing to do with it) to +1 (strongly this).
The honest caveat, up front: these seven dimensions were invented so that you can read them. A real embedding model uses hundreds or thousands of dimensions, learned from text, and none of them has a name a human would recognise — meaning is smeared across all of them at once. What carries over is everything else on this page: the numbers are coordinates, and similarity is the angle between them.
Pick a word, meet its neighbours
Hand-built illustrative space — the ranking below is computed live from the seven numbers, not from live model output.
The 7 numbers
This is the whole word, as far as the computer is concerned. Bars to the right of the centre line are positive, bars to the left are negative.
Nearest neighbours
Ranked by cosine similarity: 1.00 means the two lists of numbers point in exactly the same direction, 0.00 means they are unrelated, and a negative score means they point opposite ways.
The map
Seven dimensions will not fit on a screen, so we have to pick two and throw the other five away. Change the axes and watch the same 40 words rearrange. Illustrative space, positions computed from the real vectors.
Compare two words
The score and the breakdown are computed live from the hand-built vectors.
Cosine similarity compares direction, not size. Two words can sit far apart and still score high if they lean the same way.
Why anyone bothers
Search built on keywords compares letters. Ask it for “firewall” and it will never return a ticket that says “packet filtering appliance”, because the two share no words at all. Your analyst gets nothing and concludes the knowledge base is empty.
Embedding search compares positions instead. Every document becomes a point; your question becomes a point; the system returns whatever is nearest. That is the whole retrieval step of a RAG system — the part that decides which documents the model is even allowed to see.
Try it on nine sentences
Each sentence is scored by averaging the vectors of the words this toy space knows. Words it does not know contribute nothing at all — “filtering”, “appliance” and “subnet” are simply skipped here. A real model has a vector for every word, which is precisely why it does this far better than we can.
Three short experiments
Answer from what you actually saw on the other tabs, then open the reveal. The numbers in each reveal are computed from the same vectors you just used.
Embeddings turn meaning into coordinates, so “close together” becomes something a computer can measure.
Search, clustering, deduplication and every RAG retrieval step are the same move underneath: place things in space, then measure the distance. Judge an embedding model by whether the things your users would call similar actually land near each other in your domain — not by how many dimensions it has.
My observations
Kept in this browser tab only, for this session.