LLMs encode semantic meaning into the direction of embedding vectors, making cosine similarity ideal because it directly quantifies the angular relationship, thereby capturing the closeness of meaning between prompts.
Open the full topic