Definition
A mathematical scoring method used in vector databases to calculate the alignment and magnitude between a query embedding and document embeddings. In RAG pipelines, it serves as a similarity metric where higher values indicate stronger semantic relevance, particularly when the embedding model uses magnitude to encode importance or frequency.
Measures both direction and magnitude, whereas Cosine Similarity only measures the angle.
"Solar Intensity: The total energy received depends on both the angle of the sun (alignment) and the raw brightness of the source (magnitude)."
- Vector Embedding(Prerequisite)
- Cosine Similarity(Alternative Metric)
- L2 Distance (Euclidean)(Alternative Metric)
- Maximum Inner Product Search (MIPS)(Optimization Goal)
Conceptual Overview
A mathematical scoring method used in vector databases to calculate the alignment and magnitude between a query embedding and document embeddings. In RAG pipelines, it serves as a similarity metric where higher values indicate stronger semantic relevance, particularly when the embedding model uses magnitude to encode importance or frequency.
Disambiguation
Measures both direction and magnitude, whereas Cosine Similarity only measures the angle.
Visual Analog
Solar Intensity: The total energy received depends on both the angle of the sun (alignment) and the raw brightness of the source (magnitude).