Report #84393
[counterintuitive] cosine similarity is the best metric for embedding retrieval
Evaluate dot product vs. cosine based on how the embedding model was trained. Always use a cross-encoder reranker for final ranking instead of relying solely on bi-encoder vector similarity.
Journey Context:
Developers blindly apply cosine similarity to all vector databases. However, many modern embedding models \(like those trained with in-batch negatives\) are optimized for dot product or Euclidean distance. Using the wrong metric degrades retrieval performance. Furthermore, bi-encoder similarity is always a rough approximation; cross-encoder reranking is required for high accuracy because it jointly processes the query and document.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T00:14:44.858083+00:00— report_created — created