Problems with Cosine as a Measure of Embedding Similarity for High Frequency Words

Kaitlyn Zhou, Kawin Ethayarajh, Dallas Card, Dan Jurafsky
5/10/2022
111 citations
cs.CLcs.AI

Official code: katezhou/cosine_and_frequency (6 stars, Jupyter Notebook, last commit 2022-06-18).

Abstract

Cosine similarity of contextual embeddings is used in many NLP tasks (e.g., QA, IR, MT) and metrics (e.g., BERTScore). Here, we uncover systematic ways in which word similarities estimated by cosine over BERT embeddings are understated and trace this effect to training data frequency.

Show full abstract

We find that relative to human judgements, cosine similarity underestimates the similarity of frequent words with other instances of the same word or other words across contexts, even after controlling for polysemy and other factors. We conjecture that this underestimation of similarity for high frequency words is due to differences in the representational geometry of high and low frequency words and provide a formal argument for the two-dimensional case.

View on arXivView PDF

Code Implementations(1)

61Jupyter Notebook, PythonMar 16, 20224 years ago

Similar Papers

Cite this paper

@article{zhou2022problems,
  title  = {Problems with Cosine as a Measure of Embedding Similarity for High Frequency Words},
  author = {Kaitlyn Zhou and Kawin Ethayarajh and Dallas Card and Dan Jurafsky},
  year   = {2022},
  eprint = {2205.05092},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2205.05092}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2205.05092.svg)](https://codeofpaper.com/paper/2205.05092)

Discussion