What is an embedding for?
A computer does not understand the meaning of words: it handles numbers. An embedding translates a text, an image or a sound into a list of numbers (a vector) that captures its meaning. Two pieces of content about the same thing end up with similar vectors, even if they do not use the same words.
This measurable closeness makes it possible to search by meaning, group similar documents or recommend content. Embeddings are stored in a vector database and form the basis of search in a RAG system.
How an embedding works
- 1 Step 1 The content It starts with the content to be represented: a document passage, an image or an audio clip.
- 2 Step 2 The embedding model A specialised model converts it into a vector of several hundred to a few thousand numbers (dimensions).
- 3 Step 3 The comparison The closeness of two vectors is measured, for example with cosine similarity: the higher the score, the closer the meanings.
- 4 Step 4 Putting it to use These scores are used to rank search results, group documents or detect duplicates.
Business use cases
- Internal search Find a procedure by asking a question, without knowing the exact title of the document.
- Customer service Match a new request with tickets already resolved to suggest the right answer.
- Data analysis Automatically group customer reviews or open-ended feedback by theme.
- Multilingual Find a document written in French from a question asked in English, thanks to a multilingual model.
Keywords or embeddings?
| Keyword search | Embedding search | |
|---|---|---|
| Principle | Finds documents containing the words typed | Finds documents that are close in meaning |
| Synonyms and rephrasing | Missed without a list of synonyms | Taken into account naturally |
| Exact terms (references, codes) | Very reliable | Less precise |
| Ideal for | An identifier or a specific phrase | Questions in natural language |
The two approaches are complementary and are often combined in the same search engine.
Frequently asked questions
-
Not directly: the vector is not designed to be read back. However, research shows that partial reconstruction is possible, so embeddings of sensitive data should be protected like the data itself.
-
A token is a unit of text, a word or part of a word. The embedding used in semantic search represents the meaning of an entire passage as a single vector.
-
Rarely. Off-the-shelf models, available via API or hosted in-house, suit most uses. Adapting a model is mainly justified for highly specialised vocabulary.
