A Triangle Inequality for Cosine Similarity
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
Built on by
Citing papers per year: 2022: 2; 2023: 3; 2024: 3; 2025: 2; 2026: 3.
13 papers.
Sort:
- 2025Federated Domain Generalization with Data-free On-server Matching Gradientcited by 7
- 2025Statistical Hypothesis Testing for Auditing Robustness in Language Modelscited by 7
- 2023CADIS: Handling Cluster-skewed Non-IID Data in Federated Learning with Clustered Aggregation and Knowledge DIStilled Regularizationcited by 5
- 2023FedGrad: Mitigating Backdoor Attacks in Federated Learning Through Local Ultimate Gradients Inspectioncited by 4
- 2023tinyCLAP: Distilling Constrastive Language-Audio Pretrained Modelscited by 2
- 2024Accelerating k-Means Clustering with Cover Treescited by 1
- 2024Tangential Randomization in Linear Bandits (TRAiL): Guaranteed Inference and Regret Boundscited by 1
- 2022Design of the topology for contrastive visual-textual alignmentcited by 0
- 2022On Projections to Linear Subspacescited by 0
- 2024LGDE: Local Graph-based Dictionary Expansioncited by 0
- 2026Dynamic Topology Optimization for Non-IID Data in Decentralized Learningcited by 0
- 2026Beyond L2: Generalizing Abductive Latent Explanations to Diverse Prototype-Based Architecturescited by 0
1 more
- 2026On the Triangle Inequality for the Jaccard Distance in Arbitrary Lattices18 Aug 2026
- 2026Beyond L2: Generalizing Abductive Latent Explanations to Diverse Prototype-Based Architectures17 Aug 2026
- 2026Dynamic Topology Optimization for Non-IID Data in Decentralized Learning3 Feb 2026
- 2025Statistical Hypothesis Testing for Auditing Robustness in Language Models9 Jun 2025
- 2025Federated Domain Generalization with Data-free On-server Matching Gradient24 Jan 2025
- 2024Tangential Randomization in Linear Bandits (TRAiL): Guaranteed Inference and Regret Bounds19 Nov 2024
- 2024Accelerating k-Means Clustering with Cover Trees19 Oct 2024
- 2024LGDE: Local Graph-based Dictionary Expansion13 May 2024
- 2023tinyCLAP: Distilling Constrastive Language-Audio Pretrained Models24 Nov 2023
- 2023FedGrad: Mitigating Backdoor Attacks in Federated Learning Through Local Ultimate Gradients Inspection29 Apr 2023
- 2023CADIS: Handling Cluster-skewed Non-IID Data in Federated Learning with Clustered Aggregation and Knowledge DIStilled Regularization21 Feb 2023
- 2022On Projections to Linear Subspaces26 Sep 2022
1 more
- 2025Federated Domain Generalization with Data-free On-server Matching Gradientcited by 7
- 2025Statistical Hypothesis Testing for Auditing Robustness in Language Modelscited by 7
- 2023CADIS: Handling Cluster-skewed Non-IID Data in Federated Learning with Clustered Aggregation and Knowledge DIStilled Regularizationcited by 5
- 2023FedGrad: Mitigating Backdoor Attacks in Federated Learning Through Local Ultimate Gradients Inspectioncited by 4
- 2023tinyCLAP: Distilling Constrastive Language-Audio Pretrained Modelscited by 2
- 2024Accelerating k-Means Clustering with Cover Treescited by 1
- 2024Tangential Randomization in Linear Bandits (TRAiL): Guaranteed Inference and Regret Boundscited by 1
- 2022Design of the topology for contrastive visual-textual alignmentcited by 0
- 2022On Projections to Linear Subspacescited by 0
- 2024LGDE: Local Graph-based Dictionary Expansioncited by 0
- 2026Dynamic Topology Optimization for Non-IID Data in Decentralized Learningcited by 0
- 2026Beyond L2: Generalizing Abductive Latent Explanations to Diverse Prototype-Based Architecturescited by 0
12 most cited of 13 All 13 (JSON)
- 2026On the Triangle Inequality for the Jaccard Distance in Arbitrary Lattices18 Aug 2026
- 2026Beyond L2: Generalizing Abductive Latent Explanations to Diverse Prototype-Based Architectures17 Aug 2026
- 2026Dynamic Topology Optimization for Non-IID Data in Decentralized Learning3 Feb 2026
- 2025Statistical Hypothesis Testing for Auditing Robustness in Language Models9 Jun 2025
- 2025Federated Domain Generalization with Data-free On-server Matching Gradient24 Jan 2025
- 2024Tangential Randomization in Linear Bandits (TRAiL): Guaranteed Inference and Regret Bounds19 Nov 2024
- 2024Accelerating k-Means Clustering with Cover Trees19 Oct 2024
- 2024LGDE: Local Graph-based Dictionary Expansion13 May 2024
- 2023tinyCLAP: Distilling Constrastive Language-Audio Pretrained Models24 Nov 2023
- 2023FedGrad: Mitigating Backdoor Attacks in Federated Learning Through Local Ultimate Gradients Inspection29 Apr 2023
- 2023CADIS: Handling Cluster-skewed Non-IID Data in Federated Learning with Clustered Aggregation and Knowledge DIStilled Regularization21 Feb 2023
- 2022On Projections to Linear Subspaces26 Sep 2022
12 newest of 13 All 13 (JSON)