AI

Embedding

Also called: vector, vector embedding

An embedding is a vector, a list of numbers, representing the meaning of a word, sentence or document: two similar texts have similar vectors.

A computer does not understand words; it handles numbers. An embedding translates an item, whether a token, a sentence, a paragraph or even an image, into a vector of several hundred or several thousand numbers. These numbers place the item in a mathematical space where distance reflects similarity of meaning.

Embeddings are everywhere in AI. Inside an LLM, each token is first converted into a vector before passing through the Transformer's layers. Outside, dedicated embedding models are used for semantic search: “fan failure” and “the fan has stopped spinning” get neighbouring vectors even though they have almost no words in common. This is the foundation of RAG: documents are turned into vectors and stored in a vector database, which makes it possible to find, in a fraction of a second, the passages that answer a question.

For a document assistant, the choice of embedding model matters as much as the choice of LLM: it must handle your language and your industry's vocabulary well. These models are much smaller than an LLM and run easily alongside it on the same GPU, but the initial vectorisation of large archives benefits from a fast card. Note that if you change embedding models, all documents have to be vectorised again.

When we install a private AI assistant, we set up the vectorisation of your documents with a model suited to your language.