AI Fundamentals · Part 3 of 5
Video Part 3 of 5 0:39

Understanding embeddings

How AI models turn token numbers into coordinates with real meaning, and why distance between ideas powers modern search.

Step 5 on the mapHow it works underneath →
Title card reading: Tokens give models words. Embeddings give them meaning.

A token number is only an identity, like a part number. Nothing about the number for “coffee” tells the model it has anything to do with “tea”. An embedding replaces that single number with a long list of numbers, often hundreds or thousands of them, that together describe what the word means. Think of them as coordinates. Words with similar meanings land close together, and unrelated words land far apart.

The model learnt those positions during training by noticing which words turn up in the same company. Coffee and tea appear in the same kinds of sentences, so they end up near each other. “Bank” ends up somewhere between money and rivers, which is the problem the next entry, on attention, solves.

Embeddings matter outside the model too. Modern search takes your question, turns it into coordinates, and looks for the documents whose coordinates sit nearest. It is matching meaning rather than exact letters, which is why a search for “cheap flights” can find a page that says “low-cost airfares”. The same trick is how an AI assistant finds the right passage in a pile of your documents, and it is the job a vector database exists to do.

The line to keepTokens are IDs. Embeddings are coordinates. Distance is meaning.

Transcript of the video

A token number is just an ID. It doesn't know that coffee and tea are both hot drinks.

An embedding replaces that single ID with a list of coordinates: numbers that describe what the word actually means.

In this space, geometry is meaning. Words with similar ideas sit close together, while unrelated words sit far apart.

That is how modern search works. Not matching exact letters, but measuring the distance between ideas.

Tokens are IDs. Embeddings are coordinates. Distance is meaning.

Found this useful?

Subscribe for the next one, or tell me what you want explained. I take requests.