Comparison
Cosine similarityvsDot product and Euclidean distance
Cosine similarity
you rank results by the angle between two vectors, which is a dot product over two magnitudes and one line of code.
The standard similarity measure between two embeddings: the cosine of the angle between them, ranging from -1 to 1, higher meaning more similar. One line of code: dot product divided by the product of magnitudes.
Full entry →Dot product and Euclidean distance
the index makes you choose a distance operator, and for the normalised vectors most models emit the choice barely changes the ranking.
Alternative similarity and distance measures. For the normalised vectors most embedding models emit, cosine similarity and dot product rank results identically. Your vector index will ask you to pick one; match whatever the model's documentation recommends.
Full entry →