Definition

Embedding

An embedding is a numeric vector produced by a model for an input such as a token, document, image or query. The vector’s geometry supports comparisons defined by the model and the chosen similarity measure. Compare vectors from compatible encoders and check their retrieval performance on representative inputs.

Compare directions with cosine similarity

In a two-dimensional example, query vector (1, 0) has cosine similarity 1 with (2, 0). Its similarity with (3, 4) is 3/5, or 0.6. Cosine ranks the vectors by direction and ignores their lengths. Real retrieval systems use more dimensions and should check whether nearest results are useful on labeled search examples.

Vector embeddings and cosine similarity

Intelligence at Scale by Shashank Agarwal

Explained in

Chapter 5: Inside the Machine

Everything you need to know about what's happening inside the box. No PhD required.

Related terms

This is one term. The chapter is the argument.

Intelligence at Scale: 22 chapters, 65,000 words, 80-plus diagrams. Kindle, paperback and hardcover on Amazon.

Buy on Amazon.com
← All terms