← Back to Workshop Hub MODULE 1 · EMBEDDINGS

From Tokens to Meaning

How AI turns words into numbers that capture meaning, so a “vendor proposal” and a “supplier quote” end up close together.

01 · The idea

Words become places on a map

After tokenising, each word is just an ID number, like a file number. Embeddings give each word a position instead, so related words sit close together.

Token IDs

An ID only says where a word is filed. A position says what it is close to.
Tell me more

A hospital analogy. A file number such as Patient #4827 is useful for filing and tells you nothing else. Two consecutive numbers may have nothing in common. An embedding is closer to a seating plan where people with similar needs sit together.

Where do the positions come from? The model learns them by reading a huge amount of text. Words that appear in similar company, such as “vendor” and “supplier” near “proposal” and “contract”, end up close together. Nobody places them by hand.

What it makes possible. Searching by meaning, finding passages that answer a question, grouping similar documents, and spotting things that look unlike the rest.

The IDs and positions on this page are illustrative examples.

02 · Before and after

From mostly zeros to meaningful numbers

The older approach gave each word one switch in a huge row. Embeddings use a compact list of numbers where every one carries meaning.

0vendor vs supplier
0vendor vs scalpel
One-hot

One-hot cannot tell “vendor” and “supplier” are related. An embedding can.
Why was one-hot a problem?

The numbers in the embedding rows are illustrative. Real embeddings are typically hundreds to a few thousand numbers long, and no single number has a meaning a person can read.

03 · Explore

Walk around a meaning map

Drag to rotate, scroll to zoom, and click a word to see its closest neighbours.

drag · scroll · click a word
What to look for

Close together means similar in meaning. Far apart means unrelated.
Is this the real thing?

It is a simplified picture. Real embeddings have hundreds to a few thousand dimensions, and a person cannot see that. Techniques that flatten them to three dimensions keep neighbours roughly together but distort the exact distances.

The word positions here are hand-placed for teaching. They are not output from a real model.

04 · Search by meaning

Find the passage, even with different words

The question and every passage become positions on the map. The passages closest to the question score highest.

Your question

Closest passages · longer bar = closer in meaning · illustrative scores

Pick a passage

Click any result to see why it scored the way it did.

Matching on meaning finds the right passage when the wording differs.
How is “close” measured?
MeasureIn plain words
Cosine similarityCompares the direction two lists of numbers point in. Closer to 1 means more similar. A common choice for text.
Straight-line distanceHow far apart the two positions are. Smaller means more similar.
Dot productMultiply and add. Larger means more similar.

Example pairs (illustrative scores, 0 to 1): vendor and supplier 0.92 · budget and expenditure 0.88 · leave entitlement and annual leave allowance 0.84 · PDPA and data protection 0.79 · vendor and contract 0.71 · vendor and patient 0.18 · vendor and scalpel 0.08.

05 · In Amazon Quick

Why Quick can find the right passage

Meaning-based matching is what lets a question find the right part of a document in your Space, even when the wording is different.

Step 1 · Your question

You never see embeddings. You do see the result, so always check the cited passage.
What to remember, and what to ask