Skip to content

What is an embedding?

An embedding is a numerical representation of content, which lets a system compare it with other content based on the similarity an AI model has learned.

An embedding is a numerical representation of content, such as a sentence, in the form of a vector, an ordered sequence of numbers. A model trained on examples computes the vector so that similar content maps to nearby vectors. In document search, the model represents a question and the available texts in the same mathematical space; the system compares their vectors and returns the closest results. A search can therefore find text worded differently from what was typed, but cannot guarantee that every result is correct. Similarity depends on the model and the task it was trained for and does not necessarily track whether a statement is true. Embeddings can support semantic search, which compares the meaning of texts, or document retrieval in RAG. An embedding is the representation itself, separate from the application that uses it and from any system that stores it and makes it searchable.

See also: Vector databaseA vector database stores numerical vectors and makes them searchable by similarity, requiring choices on completeness, response time, and access control.

What dimensionality does and does not capture

Dimensionality is the number of values in a vector. For a given format, more values take more space, but a longer vector does not guarantee better results. In Matryoshka Representation Learning, the model is trained so that the first part of its vector is usable on its own. You can then weigh size against quality without assuming truncation works for every model.

A proximity score does not verify contract terms. Two texts about the same subject may differ on a crucial negation or date. Finding exact codes and words may also require hybrid search, which pairs vector comparison with keyword matching.

The hidden cost: switching embedding models

Comparing questions and documents requires compatible representations in the same space. The Sentence Transformers documentation distinguishes symmetric search, such as finding similar questions, from asymmetric search, such as matching a short question to a paragraph. Some models use different instructions for questions and documents. Switching models means recomputing the document vectors and updating the index that makes them searchable, unless compatibility is documented and verified. The budget should cover compute, storage, and testing of the new search.

An enterprise example

A procurement team wants to find termination clauses across contracts that word them differently. It collects real user questions and marks the relevant passages, including cases with negations and codes. It compares models on whether those passages rank among the top results and measures compute and update costs. A close match still needs human review before it can support a legal conclusion. A vector database can manage the vectors, but it does not replace this evaluation.

Why it matters for decision makers

Public benchmarks are a starting point, not a guarantee for your own documents. The 2023 MTEB study compared 33 models across 8 task types and found that no method led on every task type. In an RFP, ask for evidence on your actual language, documents, and questions, plus the procedure for exporting data and rebuilding vectors. Beyond vector length, the decision turns on measurable quality and replacement cost.

Frequently asked questions

An embedding is a numerical representation of content; a vector database can store it and make it searchable, but is not the only way to compare vectors.

Compare results on representative Italian questions and documents, and check domain terminology, costs, and migration options.
  • Vector databaseA vector database stores numerical vectors and makes them searchable by similarity, requiring choices on completeness, response time, and access control.
  • RAGRAG combines search and generation: it retrieves external sources relevant to a question and passes them to a language model, which draws on them to answer.
  • Hybrid search and rerankingHybrid search combines lexical and semantic results; reranking reorders the candidates by relevance before showing them or passing them to a language model.
  • Fuzzy matchingApproximate string comparison: it scores how similar two values are instead of answering an exact yes or no.
  • Principal component analysis (PCA)PCA condenses many correlated variables into a few axes that keep most of their variation: useful for sensors and processes, but axes aren't business variables.

See it in the universe

If you need the AI in production, not in a demo, that is my job.

See AI integrations

Or write to me.