mlsanityData to 7 Oct 2026

A Triangle Inequality for Cosine Similarity

arXiv 2107.04071 ↗First posted 8 Jul 2021cs.LG cs.DBcited by 13

Not on the map. Why?

Abstract (arXiv)

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.

Key facts. Cited by 13 papers in the map (data through 7 Oct 2026). Builds on 2 of its 22 references that are in the map. First posted on arXiv 8 Jul 2021.

Builds on

2 of 22 references.

References · 2

  1. 2019ELKI: A large open-source library for data analysis - ELKI Release 0.7.5 "Heidelberg"cited by 10
  2. 2020BETULA: Numerically Stable CF-Trees for BIRCH Clusteringcited by 4

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2022: 2; 2023: 3; 2024: 3; 2025: 2; 2026: 3.

13 papers.

Sort: