Module 1.1
Before attention, before transformers, before any of it: a sentence becomes a list of numbers, and "similar meaning" becomes "pointing the same direction." Drag through a few vector pairs and watch what "similarity" actually computes to.
The math
Norm and dot product are the only two ingredients. Cosine similarity is just their ratio — it cancels out length and keeps only direction.
The code
This is the entire computation. No library hides anything here — np.dot and np.linalg.norm are doing exactly the sums above.
The Nimbus thread
"Why did my Nimbus export fail?"
Illustrative embedding values, not real model output — the point is the operation, not the exact numbers.
So what
Attention, retrieval, everything downstream in this series is this exact same dot-product-over-norms computation — just repeated millions of times, over higher-dimensional vectors.
Go deeper (optional)
This page showed the dot product as a formula. 3Blue1Brown's classic explanation is about why that formula measures projection — the "duality" between a vector and the linear function it defines. Longer than most clips here (15 min), but it's the definitive treatment of this exact idea.
3Blue1Brown — "Dot products and duality," Essence of Linear Algebra ch. 9. Supplementary, not required to follow this page.