Cosine-similarity is the cosine of the angle between two vectors, or equivalently the dot product between their normalizations. A popular application is to quantify semantic similarity between high-dimensional objects by applying cosine-similarity to a learned low-dimensional feature embedding. This can work better but sometimes also worse than the unnormalized dot-product between embedded vectors in practice. To gain insight into this empirical observation, we study embeddings derived from regularized linear models, where closed-form solutions facilitate analytical insights. We derive analytically how cosine-similarity can yield arbitrary and therefore meaningless `similarities.' For some linear models the similarities are not even unique, while for others they are implicitly controlled by the regularization. We discuss implications beyond linear models: a combination of different regularizations are employed when learning deep models; these have implicit and unintended effects when taking cosine-similarities of the resulting embeddings, rendering results opaque and possibly arbitrary. Based on these insights, we caution against blindly using cosine-similarity and outline alternatives.
A Fast Text Similarity Measure for Large Document Collections using Multi-reference Cosine and Genetic Algorithm
使搜索引擎快速、准确的重要因素之一是一个简洁、无重复的索引。为了从索引中删除重复和接近重复的文档,搜索引擎需要一个快速可靠的重复和接近重复的文本文档检测系统。解决这个问题的传统方法,如蛮力比较或简单的基于散列的算法是不合适的,因为它们是不可扩展的,并且不能有效地检测近似重复的文档。本文提出了一种新的基于特征的文本相似性检测方法,该方法具有速度快、可扩展性好、可靠性高、占用存储空间少等优点。在CiteseerX、Enron、Gold Set of Near-Duplicate News Articles等流行的文本文档数据集上进行了实验,结果表明,该方法在准确性和性能方面都优于最先进的算法。所提出的方法是基于使用参考文本生成签名的文本文档的想法。本文的新颖之处在于使用遗传算法来生成更好的参考文本。
ScoreShield: Differentially Private Release of Similarity Scores
School of Engineering and Applied Sciences, Harvard University(哈佛大学工程与应用科学学院);School of Engineering, École Polytechnique Fédérale de Lausanne (EPFL)(洛桑联邦理工学院工程学院)