Definition
A distance metric in RAG systems used to measure the straight-line (L2) proximity between two vector embeddings; lower values indicate higher semantic similarity. It is the primary distance function for finding 'nearest neighbors' in a vector database when the magnitude of the vectors is as significant as their direction.
Measures absolute distance between coordinates, unlike Cosine Similarity which measures the angle between vectors regardless of their length.
"A rigid measuring tape stretched in a straight line between two distinct points in a 3D room."
- Vector Embedding(Prerequisite)
- Cosine Similarity(Alternative Metric)
- L2 Norm(Mathematical Basis)
- Normalization(Optimization (makes L2 and Cosine Similarity equivalent))
Conceptual Overview
A distance metric in RAG systems used to measure the straight-line (L2) proximity between two vector embeddings; lower values indicate higher semantic similarity. It is the primary distance function for finding 'nearest neighbors' in a vector database when the magnitude of the vectors is as significant as their direction.
Disambiguation
Measures absolute distance between coordinates, unlike Cosine Similarity which measures the angle between vectors regardless of their length.
Visual Analog
A rigid measuring tape stretched in a straight line between two distinct points in a 3D room.