Ria draws two nonzero vectors from a common origin and rotates one through aligned, perpendicular, and opposite positions while Ava watches the score.
Problem: The retrieval system needs a reproducible score for comparing query and document vectors, but a score must be interpreted within the model and task.
Resolution: The reader learns cosine similarity's full negative-one-to-one range and understands that identical direction is not identical meaning.

Cosine similarity measures vector alignment on a -1 to 1 scale. A high score is model-dependent evidence, not proof that two texts have identical meaning.
What cosine computes
Similarity search compares a query vector with candidate vectors under a chosen metric. A mathematical representation expresses an item as numbers so a system can compute with it.
For two nonzero vectors, cosine similarity divides their dot product by the product of their lengths. That normalization focuses the score on alignment. If vectors have already been normalized to unit length, their dot product equals cosine similarity.
Normalization removes magnitude from the comparison. The vectors [1, 1] and [10, 10] point in the same direction, so their cosine similarity is 1 even though their lengths differ. Whether ignoring that length is desirable depends on how the representation uses magnitude.
The zero vector is a boundary case because it has no direction and its length is zero. The cosine formula would divide by zero, so implementations need an explicit policy rather than inventing a semantic score. Checking library behavior matters when empty or failed records can produce zero vectors.
Use the whole range
A score of 1 means the vectors point in the same direction, 0 means they are orthogonal, and -1 means they point in opposite directions. Some embedding distributions use only part of that range in practice, but the mathematical definition remains -1 to 1.
Cosine distance is related but not always reported with the same convention. A library may expose one minus cosine similarity, while an API may transform or rescale a value for ranking. A number copied from one interface cannot safely be compared with a number from another until the definitions match.
The full mathematical range also does not promise that a real dataset will occupy it evenly. A collection may cluster in a narrow positive band. In that setting, the difference between 0.78 and 0.82 could matter more than the unused negative half of the scale, but only evaluation can show that.
Scores need calibration
The same numerical score can behave differently across model versions, domains, and datasets. Teams should choose thresholds or ranking rules from measured relevance on their own task. A score is not a universal probability of shared meaning.
Thresholds turn a continuous ranking signal into a decision, so false positives and false negatives must be counted. A duplicate detector may prefer a strict boundary. A discovery tool may accept a wider candidate set and let a later stage filter it. One threshold cannot serve both risks automatically.
Changing the embedding model requires recalibration even when the API still says cosine similarity. The vector distribution can move, and a previously useful cutoff can accept too much or reject too much. Keep a judged evaluation set and rerun it after model, preprocessing, or domain changes.
Ranking and thresholding answer different questions. Ranking asks which candidates compare best within one set. Thresholding asks whether a score is good enough for an action. A useful top result can still fall below an acceptance boundary, and a high-scoring pair can still require human review when the consequence is serious.
Glossary
- Cosine similarity
- The normalized dot product of two nonzero vectors, ranging from -1 to 1.
- Similarity metric
- The mathematical rule used to compare vectors and rank candidates. | Example: Changing the metric can change which stored item is considered nearest.
- Unit vector
- A vector scaled to length 1. Its dot product then equals cosine similarity.
- Threshold
- A task-specific score boundary chosen from evaluation, not a universal semantic rule.
Try it yourself
- Explain the arrow picture in one sentence, then name one reason two close directions can still retrieve an unhelpful result.
- Verify whether an API returns cosine similarity, cosine distance, or a transformed score before comparing values.
- Recalibrate thresholds after changing the embedding model or the data domain.
