Lab 3: What Are Embeddings?

See how text becomes numbers — and how those numbers capture meaning.

🔢
The Engine: Text → Numbers that carry meaning
Character codes carry spelling (A = 65). An embedding model produces a different kind of number — 1,536 of them, scored on features it learned by reading — so that similar meanings land close together. A separate model does this, not the chat model. Vector and embedding: one object, two words.

Section 1: Text → Vector

Type any text and watch it become a 1,536-dimensional vector. Try one word, then a whole sentence — the vector is the same length every time.

Section 2: How Similar Are Two Sentences?

Cosine similarity measures the angle between two vectors. Small angle → score near 1 → similar meaning. Run all four pairs first and read the scores side by side.

Try these revealing pairs
Takeaway: An embedding model turns any text into one fixed-length vector. Similar meanings land close together. Cosine similarity measures the angle between two vectors — a small angle means a high score means similar meaning. Scores are relative: rank them, never threshold them. This is the mathematical engine behind semantic search in Lab 2, and behind retrieval in Lab 4 and the full pipeline in Lab 6.