Back to Basics

What Is an Embedding and What Is It Used For?

What Is an Embedding and What Is It Used For?
AI Tutorials Team 7 March 2026

An embedding is a list of numbers representing the meaning of a piece of text. That sounds abstract until you see what it enables: search that finds documents about a subject rather than documents containing a word, recommendations based on similarity, and every retrieval system that answers questions about your own files.

How does text become numbers?

A model trained for the purpose reads the text and produces a fixed-length list of values, typically several hundred or a few thousand of them. The same input always produces the same output, and the values themselves are meaningless individually. What matters is where the text lands relative to everything else.

Think of it as a position in a space with a very large number of directions. Similar meanings end up near one another; unrelated ones end up far apart.

What does similarity actually mean here?

Distance, measured mathematically. The usual measure is cosine similarity, which compares the angle between two lists of numbers rather than their magnitude, giving a score between minus one and one.

The useful property is that this reflects meaning rather than wording. A question about how to cancel a subscription lands near a document titled ending your membership, despite sharing almost no words. Keyword search misses that entirely; embeddings do not.

Where are embeddings used?

  • Semantic search. Finding documents by meaning rather than by matching terms.
  • Retrieval systems. Selecting which chunks of your material to put in front of a model.
  • Recommendations. Finding items similar to something a person engaged with.
  • Clustering. Grouping thousands of survey responses or support tickets by theme without reading them.
  • Deduplication. Spotting near-identical records that differ in wording.
  • Classification. Sorting text by comparing it against labelled examples.

Are embedding models the same as chat models?

No, and using the right one matters. Embedding models are smaller, faster and much cheaper, because their job ends with producing the vector. They do not generate text and cannot answer a question.

A typical system uses both: an embedding model to find the relevant material, then a language model to answer using it. Confusing the two leads to expensive designs where a large model is asked to do work a small one does better.

What are the practical constraints?

Embeddings from different models are not comparable, so changing model means regenerating everything you have stored. Each model has an input limit, which is why long documents are split into chunks before embedding. And dimension count varies between models, affecting storage and search speed more than quality.

There is also a quiet failure worth knowing: a chunk that is too long produces an averaged, blurry representation that matches nothing well, which is why chunking strategy affects retrieval quality as much as the model does. Overlapping chunks slightly is the usual remedy, so that a sentence near a boundary appears in both.

Do they capture meaning reliably?

Well enough to be useful and imperfectly. Negation is a known weakness, since a sentence and its opposite can land close together. Domain-specific language embeds poorly if the model saw little of it. And anything depending on context outside the chunk is lost, because the model only sees what it was given.

What do they cost to generate?

Very little, which is one reason retrieval systems are practical. Embedding models are priced at a small fraction of chat models, and embedding an entire document library is usually a one-off cost measured in pence rather than pounds.

The ongoing cost is storage and search rather than generation, and it only becomes significant at a scale most projects never reach.

Why is this worth understanding?

Because it explains why a document search tool sometimes returns something obviously irrelevant. The retrieval step found the closest match by meaning, and closest is not the same as correct. When a system built on your documents gives a wrong answer, the first thing to examine is what it retrieved, and embeddings are the reason it retrieved that rather than something else.