Term
cosine similarity
Meaning
A similarity measure between two vectors, equal to their dot product divided by the product of their Euclidean norms. It ranges over the cosine of the angle between the vectors and ignores their magnitudes.
Source Neural Turing Machines
How papers use it 23 papers
Neural Turing Machines
Use Serves as the similarity function \( K[u,v] = u\cdot v / (\|u\|\,\|v\|) \) inside content-based addressing, where it compares the key vector emitted by a head with each memory row. The resulting similarities are scaled by the key strength \( \beta_t \) and normalised with a softmax to form the content weighting. The authors state that this is the similarity measure in their current implementation.
Deep Learning Face Representation by Joint Identification-Verification
Use An alternative verification constraint that the paper compares against the L2 norm loss. The paper notes that the cosine constraint only restricts the angle between vectors and not their magnitude, which it gives as a reason it is less effective at reducing intra-personal variation than the L2 norm.
Meaning A pairwise verification loss that applies a sigmoid to a scaled and shifted cosine similarity between two feature vectors and compares the result with a binary same-identity target.
Rethinking Supervision Scaling in On-Policy Distillation: From Dense Supervision to Stochastic Horizons
Use Computed as pairwise matrices over blockwise OPD gradients for mathematics and code, both for raw block gradients and for centered residuals across response positions. It indicates how strongly the shared update direction and the position-specific residuals align.
Meaning A measure of directional agreement between two vectors, equal to their dot product divided by the product of their norms. Its values lie between -1 and 1.
Explanations that Transfer: Interpreting Medical Retrieval with Sparse AutoEncoders
Use Used as the retrieval score: a query's sparse code is compared with the sparse codes of corpus documents, and documents are ranked by this similarity. The same scoring applies to the sparse codes produced by the SAE, not to the original dense embeddings.
Meaning A similarity score between two vectors, equal to the cosine of the angle between them. It is computed as the dot product divided by the product of the two vector norms, takes values between -1 and 1, and is larger when the vectors point in more similar directions.
VGGFace2: A dataset for recognising faces across pose and age
Use Used as the similarity score between two subject templates in verification and identification. Each template is a vector formed by averaging face descriptors, and for IJB-A and IJB-B it is averaged from media vectors and then L2 normalised. The resulting score is used in pose probing, where a 3×3 matrix is built, and in age probing, where a 2×2 matrix is built.
Meaning A similarity measure between two vectors based on the angle between them, computed as the dot product divided by the product of their norms. Values near 1 mean the vectors point in nearly the same direction.
Generative Image Inpainting with Contextual Attention
Use Serves as the matching score between each foreground feature and each background patch feature inside the contextual attention layer. The scores are then converted into attention weights with a scaled softmax over background positions.
Meaning A similarity measure between two feature vectors equal to their inner product after each vector is scaled to unit length, so it depends only on their directions and not their magnitudes.
Semantics derived automatically from language corpora contain human-like biases
Use The basic association score between target and attribute word vectors.
Meaning The cosine of the angle between two vectors, used to measure how alike they are.
Cross-lingual Language Model Pretraining
Use Used to measure how close the embeddings of word translation pairs from the MUSE dictionaries are, where higher values mean closer pairs. It is reported next to L2 distance, where lower is closer. XLM gives 0.55, compared with 0.38 for MUSE and 0.36 for Concat.
Meaning A similarity measure between two vectors based on the angle between them. Higher values mean the vectors point in more similar directions.
Memorizing Normality to Detect Anomaly: Memory-augmented Deep Autoencoder for Unsupervised Anomaly Detection
Use Used as the similarity d(z, m_i) between the query encoding z and each memory item m_i. A softmax over these similarities gives the attention weights for memory addressing. The paper adopts it following a prior memory-network design.
Meaning A similarity measure between two vectors equal to the dot product divided by the product of their Euclidean norms, so it depends only on the angle between them.
WiTac: Wrist-Informed Tactile Representations for Contact-Rich Manipulation
Use Measures action-direction alignment between a predicted joint-command change and the demonstrated short-horizon change over 25 contact-matched test pairs per task. Values are averaged over the two observations in each pair and then over pairs. Higher means the readout points in a direction closer to the demonstrated adjustment; the metric is used to compare DINO, WiTac-NW and WiTac under linear probes.
Meaning Cosine similarity is the dot product of two vectors divided by the product of their Euclidean norms, giving a value between minus one and one that reflects how well the two vectors point in the same direction.
Boosting Adversarial Attacks with Momentum
Use Computed between two successive perturbations during attacks on Inc-v3 to check how stable the update direction is across iterations. The paper compares I-FGSM with MI-FGSM this way and reads the higher similarity of MI-FGSM as a more stable update direction.
Meaning A measure of the angle between two vectors, computed as their dot product divided by the product of their norms. Its values lie between -1 and 1, and values near 1 mean the two vectors point in nearly the same direction.
LaST$_0$: Latent Spatio-Temporal Chain-of-Thought for Robotic Vision-Language-Action Model
Use The latent loss compares predicted and ground-truth embeddings with cosine similarity.
Meaning A measure of the angle between two vectors that ignores their lengths.
A Primer in BERTology: What we know about how BERT works
Use Used to characterize BERT's embedding space: two random words have, on average, a much higher cosine similarity than would be expected if the embeddings were directionally uniform. This high similarity is the evidence that the embeddings are concentrated in a narrow region of the space.
Meaning A similarity measure between two vectors equal to the cosine of the angle between them, ranging from -1 to 1, where values near 1 mean the vectors point in nearly the same direction.
Convolutional Neural Networks for Sentence Classification
Use Used to rank the nearest neighbouring words of each word vector in a nearest-neighbour analysis. The top 4 neighbours are listed for vectors in the static channel and for the fine-tuned vectors in the non-static channel of the multichannel model trained on SST-2.
Meaning A similarity measure between two vectors, equal to the cosine of the angle between them, so that vectors pointing in similar directions score high.
Consistent Video-to-Video Translation via Explicit Correspondences
Use Measures how close a query key is to each stored key in both the write and read steps.
Meaning The normalized dot product between two vectors.
Supervised Learning of Universal Sentence Representations from Natural Language Inference Data
Use Serves as the scoring function s in the pairwise ranking loss for caption-image retrieval, where it scores how well a projected caption and a projected image match. The learned linear maps U and V first project captions and images into a shared embedding space, and the cosine score is then computed in that space.
Meaning A similarity measure between two vectors, computed as their dot product divided by the product of their Euclidean norms. Its value ranges from -1 to 1 and depends only on the angle between the vectors, not on their lengths.
Dense Passage Retrieval for Open-Domain Question Answering
Use Tested as an alternative similarity to dot product in the dense retriever ablation, where it performs worse than both dot product and Euclidean distance. The dense retriever itself is trained with dot product, and cosine is only discussed as a related case.
Meaning A similarity measure between two vectors defined as the cosine of the angle between them, so it depends only on direction and not on length. For unit-length vectors it equals the inner product.
GloVe: Global Vectors for Word Representation
Use Used to answer analogy questions: the predicted word d is the vocabulary word whose vector is closest, by cosine similarity, to the vector w_b − w_a + w_c. The paper notes that a multiplicative alternative, 3COSMUL, performed worse than cosine similarity in almost all of its experiments.
Meaning A similarity measure between two vectors based on the angle between them, computed as the dot product of the vectors divided by the product of their lengths. Values near 1 indicate vectors pointing in nearly the same direction.
From Frequency to Meaning: Vector Space Models of Semantics
Use The usual measure for comparing frequency vectors in this survey.
Meaning The inner product of two vectors after normalization to unit length.
CatBoost: unbiased boosting with categorical features
Use Scores each candidate split of an oblivious tree by comparing the vector of leaf values Δ with the gradient vector G, using \( \cos(\Delta,G) \). The split with the minimum value of this loss is selected, so a smaller cosine is preferred. In Ordered mode, the gradients for each example come from the preceding examples in the chosen permutation.
Meaning A similarity measure between two nonzero vectors, equal to the cosine of the angle between them, computed as their dot product divided by the product of their norms. Values near 1 mean the vectors point in nearly the same direction.
Qwen3 Embedding: Advancing Text Embedding and Reranking Through Foundation Models
Use Serves as the similarity function s in the contrastive embedding loss, and is also used during data construction to keep only synthetic query-document pairs whose cosine similarity is greater than 0.7. Approximately 12 million pairs survive this filter for the second supervised stage.
Meaning A similarity measure between two vectors equal to the cosine of the angle between them, so it depends on direction rather than length.
SimCSE: Simple Contrastive Learning of Sentence Embeddings
Use Used as the similarity sim(h1, h2) inside the contrastive objective, computed between sentence embeddings of the anchor and its positive or negative candidates. The formula is the inner product of the two representations normalized by their norms.
Meaning A similarity measure between two vectors equal to the inner product of the vectors divided by the product of their Euclidean norms. It depends only on the angle between the vectors, not their lengths.
Conditional Generative Adversarial Nets
Use Ranks the word vectors in the vocabulary against each generated sample vector, so that the nearest words can be read off as candidate tags. In the MIR Flickr tagging experiment, the 20 closest words are retrieved for each of 100 generated samples per image, and the 10 most frequent of those words are kept as the generated tags.
Meaning A similarity measure between two non-zero vectors based on the angle between them, computed as the dot product divided by the product of the vector lengths, \( \cos(\mathbf{a},\mathbf{b}) = \frac{\mathbf{a}\cdot\mathbf{b}}{\lVert\mathbf{a}\rVert\,\lVert\mathbf{b}\rVert} \). Values near 1 indicate vectors pointing in nearly the same direction, and vector length does not affect the score.