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 条
  • [31] Generalising a triangle inequality
    Retkes, Zoltan
    MATHEMATICAL GAZETTE, 2018, 102 (555): : 422 - 427
  • [32] A FURTHER TRIANGLE INEQUALITY
    LEUENBERGER, F
    AMERICAN MATHEMATICAL MONTHLY, 1961, 68 (03): : 296 - &
  • [33] SCALENE TRIANGLE INEQUALITY
    BLUMBERG, W
    FRASER, M
    COLLEGE MATHEMATICS JOURNAL, 1984, 15 (04): : 352 - 353
  • [34] Maudlin on the Triangle Inequality
    Dees, Marco
    THOUGHT-A JOURNAL OF PHILOSOPHY, 2015, 4 (02): : 124 - 130
  • [35] PROOF OF TRIANGLE INEQUALITY
    SMILEY, MF
    AMERICAN MATHEMATICAL MONTHLY, 1963, 70 (05): : 546 - &
  • [36] Similarity triangle logic
    Zahiri, Saeide
    Saeid, Arsham Borumand
    SOFT COMPUTING, 2021, 25 (10) : 6841 - 6849
  • [37] Similarity triangle logic
    Saeide Zahiri
    Arsham Borumand Saeid
    Soft Computing, 2021, 25 : 6841 - 6849
  • [38] Apply the Triangle Inequality
    Fedak, Ivan V.
    FIBONACCI QUARTERLY, 2021, 59 (03): : 278 - 278
  • [39] ANOTHER TRIANGLE INEQUALITY
    BANKOFF, L
    AMERICAN MATHEMATICAL MONTHLY, 1969, 76 (01): : 87 - &
  • [40] A GENERALIZATION OF TRIANGLE INEQUALITY
    BOUWSMA, WD
    AMERICAN MATHEMATICAL MONTHLY, 1969, 76 (09): : 1072 - &