A Triangle Inequality for Cosine Similarity

被引:8
|
作者
Schubert, Erich [1 ]
机构
[1] TU Dortmund Univ, Dortmund, Germany
关键词
Cosine similarity; Triangle inequality; Similarity search; METRIC-SPACES;
D O I
10.1007/978-3-030-89657-7_3
中图分类号
TP18 [人工智能理论];
学科分类号
081104 ; 0812 ; 0835 ; 1405 ;
摘要
Similarity search is a fundamental problem for many data analysis techniques. Many efficient search techniques rely on the triangle inequality of metrics, which allows pruning parts of the search space based on transitive bounds on distances. Recently, cosine similarity has become a popular alternative choice to the standard Euclidean metric, in particular in the context of textual data and neural network embeddings. Unfortunately, cosine similarity is not metric and does not satisfy the standard triangle inequality. Instead, many search techniques for cosine rely on approximation techniques such as locality sensitive hashing. In this paper, we derive a triangle inequality for cosine similarity that is suitable for efficient similarity search with many standard search structures (such as the VP-tree, Cover-tree, and M-tree); show that this bound is tight and discuss fast approximations for it. We hope that this spurs new research on accelerating exact similarity search for cosine similarity, and possible other similarity measures beyond the existing work for distance metrics.
引用
下载
收藏
页码:32 / 44
页数:13
相关论文
共 50 条
  • [1] SIMILARITY, SEPARABILITY, AND THE TRIANGLE INEQUALITY
    TVERSKY, A
    GATI, I
    PSYCHOLOGICAL REVIEW, 1982, 89 (02) : 123 - 154
  • [2] Similarity, kernels, and the triangle inequality
    Jaekel, Frank
    Schoelkopf, Bernhard
    Wichmann, Felix A.
    JOURNAL OF MATHEMATICAL PSYCHOLOGY, 2008, 52 (05) : 299 - 305
  • [3] The triangle inequality constraint in similarity judgments
    Yearsley, James M.
    Barque-Duran, Albert
    Scerrati, Elisa
    Hampton, James A.
    Pothos, Emmanuel M.
    PROGRESS IN BIOPHYSICS & MOLECULAR BIOLOGY, 2017, 130 : 26 - 32
  • [4] Relaxed triangle inequality for the orbital similarity criterion by Southworth and Hawkins and its variants
    Milanov, D. V.
    Milanova, Yu. V.
    Kholshevnikov, K. V.
    CELESTIAL MECHANICS & DYNAMICAL ASTRONOMY, 2019, 131 (01):
  • [5] Relaxed triangle inequality for the orbital similarity criterion by Southworth and Hawkins and its variants
    D. V. Milanov
    Yu. V. Milanova
    K. V. Kholshevnikov
    Celestial Mechanics and Dynamical Astronomy, 2019, 131
  • [6] A Triangle Inequality
    Smotzer, Thomas
    AMERICAN MATHEMATICAL MONTHLY, 2012, 119 (06): : 523 - 524
  • [7] INEQUALITY FOR A TRIANGLE
    BANKOFF, L
    AMERICAN MATHEMATICAL MONTHLY, 1961, 68 (04): : 380 - &
  • [8] TRIANGLE INEQUALITY
    MACLEAN, HA
    AMERICAN MATHEMATICAL MONTHLY, 1978, 85 (02): : 105 - 106
  • [9] A TRIANGLE INEQUALITY
    KLAMKIN, MS
    SIAM REVIEW, 1980, 22 (04) : 509 - 511
  • [10] A triangle inequality
    AMERICAN MATHEMATICAL MONTHLY, 1999, 106 (05): : 476 - 476