benwtrent commented on issue #13281:
URL: https://github.com/apache/lucene/issues/13281#issuecomment-2245953147

   @msokolov @jmazanec15 
   
   I don't know of many `int8` models/datasets out there that require cosine. 
But, I did a benchmark with Cohere's int8 embeddings here: 
https://huggingface.co/datasets/Cohere/wikipedia-2023-11-embed-multilingual-v3-int8-binary
 which state that `cosine` is the correct space metric for their vectors.
   
   I took 1M english embeddings and calculated the true nearest neighbors with 
Cosine. Using the same HNSW settings here are my recalls:
   
    - For cosine: 0.957
    - For dot-product: 0.941
    - For MIP: 0.941
   
   So, its obviously not a 1-1 even for these embeddings.
   
   I am not sure we can get rid of cosine for byte without storing the 
magnitude in the dataset to account for the loss. 
   
   Other byte sized datasets I could find use Euclidean distance (e.g. 
https://github.com/microsoft/SPTAG/tree/main/datasets/SPACEV1B).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to