GlossaryFloor 1 · The Modela solid block on its own: the prediction machineFloor 1 · The Model
embedding
No. 053 · v2026-08FR: embedding (plongement)An embedding is the translation of a text into a long list of numbers, arranged so that two texts of similar meaning give neighbouring lists. Like coordinates on a map, where nearby towns talk about nearby things.
What it is not
An embedding is not a summary: it cannot be read back, and nothing allows the original text to be reconstructed from it. Nor is it a database: it stores nothing, it represents; it is the vector database that files these representations away and knows how to find the closest ones. And it is not a keyword search engine in disguise: it ignores exact words in favour of meaning, which is its strength and sometimes its flaw.
In depth
The geometry
The principle lies in geometry. Each text becomes a point in a space of several hundred or several thousand dimensions, and the distance between two points measures how close their meanings are. A question and the paragraph that answers it therefore end up as neighbours even without sharing a single word: “how do I cancel my subscription” finds “end of contract procedure”. That is exactly what a keyword search cannot do, and it is what makes the technique so useful for retrieving badly indexed information.
Likeness and relevance
The trade-off is that similarity of meaning is not relevance. Two texts can be very close and yet have nothing to do with the need: a clause that forbids something and a clause that permits it look very much alike, since they speak about the same object. This is why serious systems do not stop at the nearest neighbour: they combine search by meaning with search by exact words, then have the results sorted a second time by a model that is more expensive but more discerning.
Two practical rules
Two practical rules avoid the most frequent errors. The first: the embeddings of one model are only comparable with each other; changing model forces everything to be recomputed, because there is no reason for the two spaces to coincide. The second: how the text is chunked before the computation determines the quality of the search as much as the model itself. A whole paragraph gives an averaged point, therefore a blurred one; a fragment that is too short loses its context. It is an editorial setting as much as a technical one.
Under the hood2 steps · the real shape of the objects
An embedding is a vector, and “close” is an arithmetic operation on that vector. Nothing more: no understanding is involved, which explains both what the technique succeeds at and what it misses.
- 01
A text becomes a point
The text is replaced by a list of numbers of fixed length, the same for a word and for a paragraph. Closeness is then measured by the angle between two lists, which allows two texts that share no word to be brought together.
embed("how do I cancel my subscription") // → [0.021, -0.184, 0.077, 0.003, ...] 1,024 numbers, always 1,024 // closeness is an angle, not an overlap of vocabulary const cos = (a, b) => dot(a, b) / (norm(a) * norm(b)); cos(embed("how do I cancel my subscription"), embed("end of contract procedure")); // 0.83 not one word in common cos(embed("how do I cancel my subscription"), embed("the cat is asleep on the sofa")); // 0.04- 1,024
- The dimension, fixed by the embedding model. A word and a thirty-page report give a list of the same length: the longer the text, the more the point is an averaged summary, and therefore a blurred one.
- cos
- A cosine similarity: dot product divided by the norms. That is the whole computation, and it consults nothing.
The trapThe values above mean something only inside a single space. That is the first of the two practical rules from layer 2, and it can be seen here: a score of 0.83 compares to nothing coming from another model.
- 02
Why the closest is not the right one
Here is the counter-example that governs the whole design of a serious search. Two opposite clauses speak about the same object, with almost the same words: they are therefore very close, and neighbourhood alone will choose badly.
cos(embed("remote working is allowed two days a week"), embed("remote working is not allowed")); // 0.91 <- opposites // hence the two-pass ranking: recall wide, then judge expensively const candidates = dedupe([ ...index.byMeaning(question, { k: 50 }), // neighbourhood: catches rephrasings ...index.byWords(question, { k: 50 }), // lexical: catches acronyms and references ]); // reranking reads the question AND the passage together, as a pair: // far more expensive, so reserved for the 100 candidates, not the corpus. const kept = (await rerank(question, candidates)).slice(0, 5);- byWords
- The lexical search, which neighbourhood does not replace: a reference number, an in-house acronym or a rare proper noun are found through their characters, not through meaning.
- rerank
- A second model that scores the question/passage pair instead of comparing two points computed separately. That is what catches the case above, because it reads the negation.
The trapThe upstream chunking weighs as much as the model, and the `chunking` entry deals with it. What matters here: the vector never rescues a badly placed cut, it inherits it.
What variesThe dimension, the thresholds and the interface names vary from one embedding model to the next, and the similarity values shown here are illustrative: a score only means something inside one and the same space, never compared with that of another model. What does not vary: a vector of fixed length, a similarity that measures closeness of meaning without judging relevance, and an index that has to be recomputed in full as soon as you change model.
Relations where the neighbours live
Check 3 questions · click your answer
Level 1 · Recognise
Can the original text be recovered from its embedding?
Level 2 · Distinguish
A vector search returns a clause that forbids exactly what the user wanted to allow. Why?
Level 2 · Distinguish
You change embedding model. What must you do with your existing vectors?
Who works with this 1 role
The roles for which this term is part of the ordinary work.
Lexigraph, "Embedding", v2026-08, https://www.lexigraph.org/en/embedding/, CC BY 4.0.