Cosine Similarity serves as a useful tool for evaluating the similarity of two dimensional vectors. It is oftentimes used for finding “nearest neighbors” in a high dimensional Latent Space. In the Large Language Model world it is particularly useful in systems like Retrieval Augmented Generation for fetching similar embeddings to a given query, but also for general “similar semantic meaning” clustering.

It also has applications in model training and evaluation, such cases include CLIP for using Cosine Similarity to match the corresponding vectors for a image and its label.