Solving Cosine Similarity Underestimation between High Frequency Words by 2 Norm Discounting

Saeth Wannasuphoprasit, Yi Zhou, Danushka Bollegala


Abstract
Cosine similarity between two words, computed using their contextualised token embeddings obtained from masked language models (MLMs) such as BERT has shown to underestimate the actual similarity between those words CITATION.This similarity underestimation problem is particularly severe for high frequent words. Although this problem has been noted in prior work, no solution has been proposed thus far. We observe that the 2 norm of contextualised embeddings of a word correlates with its log-frequency in the pretraining corpus.Consequently, the larger 2 norms associated with the high frequent words reduce the cosine similarity values measured between them, thus underestimating the similarity scores.To solve this issue, we propose a method to discount the 2 norm of a contextualised word embedding by the frequency of that word in a corpus when measuring the cosine similarities between words.We show that the so called stop words behave differently from the rest of the words, which require special consideration during their discounting process.Experimental results on a contextualised word similarity dataset show that our proposed discounting method accurately solves the similarity underestimation problem.An anonymized version of the source code of our proposed method is submitted to the reviewing system.
Anthology ID:
2023.findings-acl.550
Volume:
Findings of the Association for Computational Linguistics: ACL 2023
Month:
July
Year:
2023
Address:
Toronto, Canada
Editors:
Anna Rogers, Jordan Boyd-Graber, Naoaki Okazaki
Venue:
Findings
SIG:
Publisher:
Association for Computational Linguistics
Note:
Pages:
8644–8652
Language:
URL:
https://aclanthology.org/2023.findings-acl.550
DOI:
10.18653/v1/2023.findings-acl.550
Bibkey:
Cite (ACL):
Saeth Wannasuphoprasit, Yi Zhou, and Danushka Bollegala. 2023. Solving Cosine Similarity Underestimation between High Frequency Words by ℓ2 Norm Discounting. In Findings of the Association for Computational Linguistics: ACL 2023, pages 8644–8652, Toronto, Canada. Association for Computational Linguistics.
Cite (Informal):
Solving Cosine Similarity Underestimation between High Frequency Words by ℓ2 Norm Discounting (Wannasuphoprasit et al., Findings 2023)
Copy Citation:
PDF:
https://aclanthology.org/2023.findings-acl.550.pdf
Video:
 https://aclanthology.org/2023.findings-acl.550.mp4