Glossary · Phase 1 · Building with LLMs
Cosine similarity
How alike two vectors' directions are, from 1 (same direction) through 0 (unrelated) to -1 (opposite).
You have two vectors. How alike are they? The standard measure is cosine similarity. It compares the directions two arrows point in and ignores how long they are. Think of two hikers reading their compasses. You care which way each one faces, not how far each has walked.
Try it now
That's why embedding search finds what keyword search misses.
Learn it properly
Embeddings · Meaning as a list of numbers, so text can be compared. About 25 minutes.
Other terms from the same lesson
- embedding: A list of numbers that captures what a piece of text means, so similar meanings get similar numbers.
Never trained an AI?
Teach a small one to write, right in your browser. It takes about 20 seconds and needs no account.