Start with the big idea
An embedding represents data as a vector of numbers. Models trained for similarity can place semantically related text or images in nearby directions of a high-dimensional space.
Understand it in more detail
A vector has many coordinates. An embedding model learns a mapping from input items to vectors. This mapping is designed by the training objective, so nearby vectors may correspond to related meanings for that use case.
Cosine similarity compares direction using (A·B) / (||A|| ||B||). It is 1 for identical directions, 0 for perpendicular vectors and -1 for opposing directions, provided neither vector is zero.
Semantic search can compare a question vector with stored document vectors to retrieve promising passages. This provides candidates for inspection; it does not prove the retrieved passages are current, authoritative or correct.
Worked example
For A=(1,0) and B=(0,1), cosine similarity is 0. For A=(1,0) and C=(2,0), it is 1. These simplified vectors show geometry, not actual language embeddings.
A misconception to avoid
Embedding proximity reflects what a model captured for a task. It is not a universal measure of truth, safety, or absolute semantic equivalence.
Experiment: explore vector similarity
Move two arrows by changing their X and Y coordinates. Compare their direction using cosine similarity. These are classroom vectors, not a trained embedding model. High similarity does not verify a claim's truth.
Predict: What happens to cosine similarity if B is exactly twice A? What happens if B points in the opposite direction? Can a vector with zero length have a defined direction?
Check your understanding
Think first, then open each answer to check your explanation. These self-checks do not record a score.
1. What is cosine similarity for vectors pointing in exactly the same direction?
1, assuming both vectors are non-zero.
2. Can the most similar search result contain a false claim?
Yes. Similarity ranks relatedness, not factual reliability.
Try it yourself
Draw five imaginary book-topic vectors on two axes. Identify nearest neighbors, then discuss why a two-dimensional teaching diagram cannot reveal the full behavior of a high-dimensional model.
Explain it back: Summarize the main idea in your own words and name one limitation or risk.
Continue learning
Read an independent reference: https://www.sbert.net/. This link is for reference, not a requirement to create an account. External websites may have different privacy and access policies.
Educational pilot. Terminology, age suitability and activities are subject to expert review. These pages do not send your answers to a server.