News for hackers. Stuff that matters.
Re:Is Cosine-Similarity of Embeddings Really About Similarity? by SR2Z on Tuesday March 12, 2024 @11:33AM (#39680735)
You don't need to call cosine to compute cosine similarity - most of the time, a normalized dot product is sufficient.

Needless to say, dot products are directly supported in hardware via the FMA unit.

Re:Is Cosine-Similarity of Embeddings Really About Similarity? by queuebert on Tuesday March 12, 2024 @12:54PM (#39681811)
Yes, this would be fast assuming the vectors are pre-normalized, obviating the need to repeatedly calculate two square roots.
Re:Is Cosine-Similarity of Embeddings Really About Similarity? by SR2Z on Tuesday March 12, 2024 @03:36PM (#39683936)
Even if the vectors are NOT normalized, you don't always need to normalize them.

Add in nd indices and the costs tend to be very small.