Skip to main content
All CollectionsAPIEmbeddings
Which distance function should I use?
Which distance function should I use?

Distance function for embedding calculations

Updated over 10 months ago

We recommend cosine similarity. The choice of distance function typically doesn’t matter much.

OpenAI embeddings are normalized to length 1, which means that:

  • Cosine similarity can be computed slightly faster using just a dot product

  • Cosine similarity and Euclidean distance will result in the identical rankings

Did this answer your question?