dot product
The sum of the products of two vectors' matching values, a similarity score that grows with both alignment and length.
In more detail
For unit-length vectors the dot product equals cosine similarity and is the cheapest to compute, which is why many embedding models normalise their output. Without normalisation, longer vectors score higher whatever their direction, so check what the model recommends.
Related terms
- cosine similarity — A similarity score between two vectors from the angle between them, from 1 for the same direction to -1 for opposite, ignoring their lengths.
- Euclidean distance — The straight-line distance between two vectors, the square root of the summed squared differences.
- unit vector — A vector scaled to length one, so comparisons depend only on its direction.
Taught in
- What An Embedding Is — AI Engineering: LLM Apps, RAG & Agents
- Embedding Models — AI Engineering: LLM Apps, RAG & Agents
- Vector Indexes And Databases — AI Engineering: LLM Apps, RAG & Agents
- How RAG Works And When To Use It — AI Engineering: LLM Apps, RAG & Agents
- Retrieval That Finds The Right Thing — AI Engineering: LLM Apps, RAG & Agents