A computer does not experience the word “doctor” the way a person does. In its raw form, text is not meaning that a machine can directly compare or measure.

Yet AI systems need a way to recognise that “doctor” is more closely related to “nurse” than to “mountain.” They also need to find an article about “reducing expenses” when a user searches for “how to cut costs,” even though the wording is different.

This is where embeddings come in: numerical representations that help models compare data and detect useful relationships.

What is an embedding?

An embedding represents an item—such as a word, sentence, image, user, or product—as a vector, which is an ordered list of numbers. A vector may contain hundreds or thousands of values; an embedding is not simply one number assigned to each word.

These values are learned so that items considered similar for a particular task or training dataset are positioned closer together in an embedding space. Mathematical measures such as cosine similarity, dot product, or Euclidean distance can then estimate how close two vectors are.

Imagine a very large map with many dimensions that people cannot directly visualise. Every item has a position on that map, and the distances between positions help a system identify relationships.

Do embeddings turn meaning into numbers?

That phrase is useful as a simple introduction, but it is not literally accurate. An embedding does not store the complete “true meaning” of an item, and individual dimensions are usually difficult to interpret on their own.

A more precise description is that an embedding is a numerical representation trained to preserve relationships that are useful for a task. A semantic-search model may place sentences with related topics or intentions near one another. A recommendation system may place products near each other when similar users interact with them.

Closeness therefore depends on the model, its training data, and its objective. There is no single universal embedding map, and different models can produce different vectors and similarity results for the same text.

How are embeddings learned?

Many techniques build on the idea that items appearing in similar contexts often have useful relationships. “Coffee” may frequently appear near “cup,” “morning,” and “drink.” “Tea” appears in many similar contexts, so a model can learn related representations for the two words.

Other systems learn from question-and-answer pairs, images and captions, or user behaviour in recommendation platforms. During training, numerical values are adjusted until comparisons become useful for the intended task.

What is the difference between static and contextual embeddings?

Earlier approaches such as Word2Vec commonly assigned one fixed vector to each word. This creates a problem for words with multiple meanings: “bank” can describe a financial institution or the side of a river, but a static embedding does not easily separate those uses.

Modern language models often produce contextual representations, meaning that a word’s representation can change according to the surrounding sentence. Dedicated embedding models can also generate one vector for a complete sentence, paragraph, image, or other item rather than representing only individual words.

Where are embeddings used?

Semantic search: Finding results related to the meaning of a query rather than only matching identical keywords.

Retrieval-augmented generation (RAG): Dividing documents into passages, embedding each passage, retrieving those most similar to a question, and providing them to a generative model.

Recommendation systems: Comparing users, products, or content to identify potentially relevant suggestions.

Clustering and classification: Grouping similar texts or images, or using embeddings as features for a classifier.

Similarity and duplicate detection: Identifying content that expresses similar ideas with different wording.

These applications do not become reliable merely because vectors exist. Results also depend on the embedding model, how data is divided, the similarity measure, the selected threshold, and the quality of evaluation.

How do embeddings relate to tokens?

A token is a unit produced when text is split by a tokenizer. Inside a language model, tokens are converted into numerical representations that the model processes and updates according to context.

However, an embedding API designed for search or retrieval may accept text containing many tokens and return one vector representing the entire input. One embedding does not necessarily equal one token, and the two terms are not interchangeable.

How is similarity measured?

Vectors are compared with mathematical measures. Cosine similarity, for example, compares the direction of two vectors more than their absolute size. A higher similarity score generally indicates that the items are closer according to that model and measure.

The score alone does not prove that a result is correct. Thresholds and metrics should be tested on real data from the intended application. Similarity suitable for an online shop may not be sufficient for medical or legal search.

What are the limitations?

Embeddings learn patterns from training data and can reproduce its biases or its weak representation of some languages and communities. Closeness also does not always mean agreement: “cheap” and “expensive” may be close because both often appear in discussions of price, even though they are opposites.

Some detail may be lost when a long passage is compressed into a single vector. Vector similarity is not proof of factual accuracy and should not replace source verification in sensitive applications.

When using an external embedding service, organisations should also review its privacy and data-handling policies before sending confidential documents or personal information.

In short

An embedding is a dense numerical representation of an item such as text or an image in a multidimensional space. It allows systems to compare items and detect relationships learned from data.

Embeddings support semantic search, document retrieval, recommendations, clustering, and many other applications. But they are not complete translations of meaning or guarantees of truth. Their usefulness depends on the model, the data, the task, and careful evaluation.