News for hackers. Stuff that matters.
Re:Is Cosine-Similarity of Embeddings Really About Similarity? by apstroll on Tuesday March 12, 2024 @03:49AM (#39677113)
Cosine Similarity is very much about similarity, but it's quite fickle and indirect.

Given a function f(l, r) that measures, say, the logprobability of observing both l and r, and that the function takes the form f(l, r) = <L(l), R(r)>, i.e. the dot product between embeddings of l and r, then cosine similarity of x and y, i.e. normalized dot product of L(x) and L(y) is very closely related to the correlation of f(x, Z) and f(y, Z) when we let Z vary.

There are no comments on this comment yet.