Definition
L2 distance, also known as Euclidean distance, is a metric that calculates the straight-line length between two points in a high-dimensional vector space. In RAG pipelines, it measures the semantic dissimilarity between a query embedding and document embeddings; a lower L2 score indicates higher relevance.
Geometric straight-line distance, not angular similarity (Cosine) or Manhattan distance (L1).
"A laser pointer measuring the direct 'as-the-crow-flies' distance between two stars in a galaxy."
- Vector Embedding(Prerequisite)
- Cosine Similarity(Alternative Metric)
- Nearest Neighbor Search(Application)
- Normalization(Preprocessing Step)
Conceptual Overview
L2 distance, also known as Euclidean distance, is a metric that calculates the straight-line length between two points in a high-dimensional vector space. In RAG pipelines, it measures the semantic dissimilarity between a query embedding and document embeddings; a lower L2 score indicates higher relevance.
Disambiguation
Geometric straight-line distance, not angular similarity (Cosine) or Manhattan distance (L1).
Visual Analog
A laser pointer measuring the direct 'as-the-crow-flies' distance between two stars in a galaxy.