Data & representations · Glossary term
What is Cosine Similarity?
The normalized dot product of two vectors. It compares their direction rather than their magnitude and ranges from -1 to 1 for real-valued vectors.
“How similar two vectors are.”
What is the common confusion about Cosine Similarity?
High cosine similarity only has meaning relative to the embedding model and the data distribution. It does not prove factual or semantic equivalence.
Learn Cosine Similarity in the course
Lessons that name Cosine Similarity in a title or section
- Norms and Distances
Your distance function defines what "similar" means. Choose wrong and everything downstream breaks. Language: Python Implement L1, L2, cosine, Mahalanobis, Jaccard, and edit distance functions from…
- Image Retrieval & Metric Learning
A retrieval system ranks candidates by a distance in embedding space. Metric learning is the discipline of shaping that space so the distances mean what you want.
- Speaker Recognition & Verification
ASR asks "what did they say?" Speaker recognition asks "who said it?" The math looks the same — embeddings plus cosine — but every production decision hinges on a single EER number.
- RAG (Retrieval-Augmented Generation)
Your LLM knows everything up to its training cutoff. It knows nothing about your company's docs, your codebase, or last week's meeting notes.
Covered in Phase 01: Math Foundations, Phase 04: Computer Vision, Phase 06: Speech & Audio and Phase 11: LLM Engineering.
Related terms
- EmbeddingA learned mapping from discrete items (words, images, users) to dense vectors in continuous space, where similar items end up close together
- Semantic SearchRetrieval that represents a query and candidates in an embedding space and ranks candidates using a vector-similarity function.
- RerankerA second-stage model or scoring function that reorders a small candidate set using a richer comparison between the query and each candidate.
- Approximate Nearest Neighbor (ANN)A search method that returns vectors likely to be among the nearest to a query without exhaustively comparing the query with every stored…
- Contrastive LearningTraining by pulling similar pairs closer and pushing dissimilar pairs apart in embedding space.
- Shared Embedding SpaceA common vector space in which representations from different modalities can be compared with the same similarity function.
More terms in Data & representations
This entry comes from glossary/terms.md on GitHub. Browse all 250 glossary terms.