Skip to content

Cosine Distance

A measure of difference between two embeddings: one minus cosine similarity.

Formula

distance = 1 − cosine_similarity(a, b)
  • similarity = 1 → distance = 0 (vectors are identical);
  • similarity = 0 → distance = 1 (unrelated);
  • similarity = −1 → distance = 2 (opposite).

Why a Separate Metric

Many vector databases (such as Qdrant) work with distances: the smaller the value, the closer the points. Cosine distance converts similarity into a familiar scale where "smaller = closer".

See Also

← All terms