vishesh-t27 commited on
Commit
4fc2dbc
·
verified ·
1 Parent(s): 708bc4c

Clarify re-normalization after truncation for dot product vs cosine

Browse files
Files changed (1) hide show
  1. README.md +1 -1
README.md CHANGED
@@ -231,7 +231,7 @@ Scores at each size on a 28-task subset of the three benchmarks (13 English, 6 C
231
  | 256 | 25% | 66.80 | 72.60 | 79.33 | 72.91 | -0.90 |
232
  | 128 | 12.5% | 65.86 | 70.89 | 78.05 | 71.60 | -2.21 |
233
 
234
- * **Re-normalize after truncating:** a cut unit-length vector is no longer unit length, so normalize it again before you store it or compare it with a dot product. Cosine similarity gives the same ranking either way. In our checks, cut vectors compared with a dot product without re-normalizing lost 0.5 to 2 points.
235
  * **Queries and documents must use the same size.**
236
 
237
  Pass `truncate_dim` and `normalize_embeddings=True` to let Sentence Transformers do both:
 
231
  | 256 | 25% | 66.80 | 72.60 | 79.33 | 72.91 | -0.90 |
232
  | 128 | 12.5% | 65.86 | 70.89 | 78.05 | 71.60 | -2.21 |
233
 
234
+ * **Re-normalize after truncating when using dot product:** truncation changes the vector's norm. Re-normalizing the shortened vectors makes the dot product equivalent to cosine similarity. If you use cosine similarity directly, explicit re-normalization is not necessary.
235
  * **Queries and documents must use the same size.**
236
 
237
  Pass `truncate_dim` and `normalize_embeddings=True` to let Sentence Transformers do both: