Embedding

A list of numbers representing a piece of data, arranged so that similar things end up close together.

Machine Learning Intermediate 1 min read Start here

Also known as: Vector Embedding

Definition

An embedding maps something discrete — a token, a sentence, an image, a product — to a vector of floating-point numbers, typically a few hundred to a few thousand of them. The mapping is learned, and the useful property is geometric: things that are similar in meaning end up near each other in the space.

That property is what makes semantic search work. Instead of matching keywords, you embed the query and the documents and look for the nearest vectors, which finds "how do I cancel my plan" in a document that only ever says "terminating a subscription".

Distances are usually measured by cosine similarity, which compares direction and ignores magnitude.

Why it matters

Embeddings are the bridge between unstructured content and anything that needs to compare, cluster or retrieve it — including every RAG pipeline.

How it relates to other terms

See also Vector Database A database built to store embeddings and find the nearest ones fast, which is what makes semantic search pract... Prerequisite Retrieval-Augmented Generation Fetching relevant documents at query time and putting them in the prompt, so the model answers from your data... See also Token The unit a language model actually reads and writes — usually a word fragment rather than a word or a characte...
Referenced by

Related terms

A model built from layers of simple weighted units, trained by adjusting those weights until the output matches the target.

Beginner Machine Learning

When a model learns the training data so closely — including its noise — that it performs worse on anything new.

Beginner Machine Learning

Was this definition helpful?

Definitions are reviewed by our editorial team. Spotted a problem? Tell us.