Embeddings & vectors
How do you compare two embeddings to measure relatedness?
To compare two embeddings you measure the angle or distance between their vectors. Cosine similarity, the cosine of the angle between them, is the standard tool: higher means more related, and for length-one vectors it reduces to a dot product.
To compare two embeddings, you measure the angle or distance between their vectors. Cosine similarity, the cosine of the angle between them, is the standard tool: higher means more related. OpenAI notes that because its embeddings are normalized to length one, “cosine similarity can be computed slightly faster using just a dot product.”[1] This is the arithmetic that turns “are these about the same thing?” into a single comparable score.
References
- Embeddings guide — OpenAI