Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why is there such a big difference in cosine similarity between embeddings of the same pair when using padding=max_length versus padding=true? #19

Open
qianyue76 opened this issue Jan 21, 2024 · 2 comments

Comments

@qianyue76
Copy link

When I was embedding a relevant text pair using the m2-bert-80M-32k-retrieval model, the cosine similarity obtained with padding=max_length was 0.7, while with padding=true (to save memory) it was close to 0. This resulted in semantic retrieval being completely impossible with padding=true. The same situation occurred with the 2k and 8k models as well.Why is this the case? And is padding=true completely unusable?

@DanFu09
Copy link
Collaborator

DanFu09 commented Jan 21, 2024 via email

@qianyue76
Copy link
Author

I don't know why the padding to max_length with just adding (token_id) 0s make such a big difference to the embedding performance?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants